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

Fixes for --stop-before flag. #1667

Merged
merged 5 commits into from
Oct 10, 2024
Merged

Fixes for --stop-before flag. #1667

merged 5 commits into from
Oct 10, 2024

Commits on Oct 9, 2024

  1. feat: Rename --stop-after flag to --stop-before.

    This is done for two main reasons:
    
    First, it is more intuitive to name the state you want to stop before
    instead of the ones you want to stop after. For example, multiple
    states lead to `ArtifactRollback_Enter`; with the `--stop-after` flag
    you'd have to specify both `ArtifactInstall_Error` and
    `ArtifactCommit_Error`.
    
    Second, in the orchestrator it is not a good fit to use
    `--stop-after`, for reasons explained in the corresponding commits
    there, and renaming keeps them more in sync.
    
    This has little effect on how it works, it's just using different
    names, so both tests and usage stay nearly the same, just
    name-adjusted.
    
    Cancel-changelog: b60beaf
    Cancel-changelog: 2c1d922
    
    Changelog: Add `--stop-before` flag which can be used with the
    `install`, `commit`, and `rollback` standalone commands to stop before
    certain states. Use `resume` to continue, which also supports the same
    flag. These are the allowed states:
    * `ArtifactInstall_Enter`
    * `ArtifactCommit_Enter`
    * `ArtifactCommit_Leave`
    * `ArtifactRollback_Enter`
    * `ArtifactFailure_Enter`
    * `Cleanup`
    The flag can be specified multiple times.
    
    Ticket: MEN-7115
    
    Signed-off-by: Kristian Amlie <[email protected]>
    kacf committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    82650fc View commit details
    Browse the repository at this point in the history
  2. refac: Move info output to the final logging step.

    This allows us to be a bit more selective when deciding whether or not
    to print it, which helps in upcoming commits.
    
    Signed-off-by: Kristian Amlie <[email protected]>
    kacf committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    a8b36bb View commit details
    Browse the repository at this point in the history
  3. fix: Fall back on bootloader when boot env modification tool is broken.

    Changelog: Title
    Ticket: None
    
    Signed-off-by: Kristian Amlie <[email protected]>
    kacf committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    e41c2ff View commit details
    Browse the repository at this point in the history
  4. test: Simplify test conditions by removing the query states.

    They have no effect on the flow anyway.
    
    Signed-off-by: Kristian Amlie <[email protected]>
    kacf committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    e1db95f View commit details
    Browse the repository at this point in the history
  5. chore: Increase robustness of `--stop-before flag.

    First and foremost, make sure that repeated resuming before the same
    state, with the same `--stop-before` flag, is a noop. It should keep
    stopping there. Also make sure that once we have started executing the
    path after that, it should no longer be possible to go back.
    
    For this we introduce some new DB flags, but since the existing ones
    have not been released yet, this should be fine.
    
    Signed-off-by: Kristian Amlie <[email protected]>
    kacf committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    056d9c2 View commit details
    Browse the repository at this point in the history