Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enter: start default services before executing subcommand #257

Merged
merged 15 commits into from
Mar 21, 2024

Commits on Jul 7, 2023

  1. feat: hide progress of changes to be ready

    Add a new option ``hideProgress`` in ``waitMixin`` to hide
    the progress, while waiting for changes to be ready.
    rebornplusplus committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    37e791e View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2023

  1. fix(enter): start default services before executing subcommand

    The --run option in the enter command should ensure that the default
    services have all started before executing the subcommand, as
    specified in the help info.
    
    This, however, does not seem to be the case as the current
    implementation only sends a request to the API to start the default
    services and immediately afterwards, executes the subcommand.
    This can have undesired behavior. For example, the following fails:
    
        $ pebble enter --run stop srv1
        2023-06-01T09:52:52.516Z [pebble] Started daemon.
        2023-06-01T09:52:52.546Z [pebble] POST /v1/services 29.059682ms 202
        2023-06-01T09:52:52.546Z [pebble] Started default services with change 386.
        2023-06-01T09:52:52.565Z [pebble] Service "srv1" starting: <cmd..>
        2023-06-01T09:52:52.584Z [pebble] POST /v1/services 37.51026ms 202
        error: cannot perform the following tasks:
        - Stop service "srv1" (cannot stop service while starting)
    
    It may also happen that the stop subcommand is executed, before the
    service hasn't even been initiated/started.
    
        $ pebble enter --run stop srv99
        2023-06-22T05:46:02.604Z [pebble] Started daemon.
        2023-06-22T05:46:02.619Z [pebble] Service "srv55" starting: <cmd..>
        2023-06-22T05:46:02.629Z [pebble] POST /v1/services 23.863368ms 202
        2023-06-22T05:46:02.630Z [pebble] Started default services with change 9.
        2023-06-22T05:46:02.637Z [pebble] Service "srv1" starting: <cmd..>
        2023-06-22T05:46:02.646Z [pebble] POST /v1/services 14.761043ms 202
        2023-06-22T11:46:02+06:00 INFO Service "srv99" has never been started.
    
    This commit should ensure that the default services have all started,
    before executing the subcommand. It does so by ensuring the "change"
    made by the "autostart" request is ready, before running the
    subcommand. The status of the "change" can be "Error" once it's ready;
    the subcommand will still be executed after.
    rebornplusplus committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    daeec0e View commit details
    Browse the repository at this point in the history
  2. fix(enter): log default services' start errors

    According to the feedback from @virtustom, log the error messages from
    ``waitMixin.wait()`` if there are any.
    rebornplusplus committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    67b6eab View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

  1. fix(enter): stop pebble if default services cannot start

    Exit with non-zero error code if waiting for the "change" (of default
    services start) to be ready returns any errors.
    rebornplusplus committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    4098a71 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. fix(enter): add test for subcommand waiting

    This commit adds a new test which checks that default services
    start before executing subcommand.
    rebornplusplus committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    b38f0d0 View commit details
    Browse the repository at this point in the history
  2. fix: os.Readfile is not supported in 1.14

    Go 1.14 does not support os.Readfile(), use ioutil.Readfile() instead.
    rebornplusplus committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    03d5a68 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. fix: write to cli.Stderr instead of os.Stderr

    Instead of writing errors directly to os.Stderr in rcmd.Run,
    write them to cli.Stderr which eventually points to os.Stderr;
    but useful for testing purposes.
    rebornplusplus committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    0d01e0c View commit details
    Browse the repository at this point in the history
  2. fix(enter): test default service start error reporting

    Test if default service start errors are properly reported and
    if pebble exits with non-zero error codes. This is only tested
    for the following command, for now:
    
        pebble enter --run [enter-OPTIONS..] <subcommand> [args..]
    rebornplusplus committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    1281c96 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. fix: pebble do not stop for default services start error

    This reverts commit 1281c96
    and reverts the hard-error behaviour introduced in
    4098a71. Pebble should no longer,
    at least not due to this commit, exit with non-zero error code if
    waiting for the "change" (of default services start) to be ready
    returns any errors.
    rebornplusplus committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    c01f729 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. Configuration menu
    Copy the full SHA
    236ac73 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2024

  1. Configuration menu
    Copy the full SHA
    c044a42 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b17082e View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2024

  1. Configuration menu
    Copy the full SHA
    9d57ed8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    753eb86 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2024

  1. Configuration menu
    Copy the full SHA
    b55bbf8 View commit details
    Browse the repository at this point in the history