-
Notifications
You must be signed in to change notification settings - Fork 196
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
base: master
Are you sure you want to change the base?
Conversation
@kacf, Let me know if you want to start the integration pipeline by mentioning me and the command "start pipeline". my commands and optionsYou can trigger a pipeline on multiple prs with:
You can start a fast pipeline, disabling full integration tests with:
You can trigger GitHub->GitLab branch sync with:
You can cherry pick to a given branch or branches with:
|
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]>
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]>
Changelog: Title Ticket: None Signed-off-by: Kristian Amlie <[email protected]>
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. Finally, simplify test conditions by removing the query states from the log, since they have no effect on the flow. Signed-off-by: Kristian Amlie <[email protected]>
Merging these commits will result in the following changelog entries: Changelogsmender (rename)New changes in mender since master: Bug Fixes
Features
|
Must be merged together with mendersoftware/meta-mender#2171. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment wrt ArtifactCommit_Leave
below.
Also, I think you got confused by testing this PR with mendersoftware/meta-mender#2171 - what we need to fix for this PR is mender-image-tests
use of this new flag.
case "$1" in | ||
NeedsArtifactReboot|SupportsRollback) | ||
: | ||
;; | ||
*) | ||
case "$1" in | ||
NeedsArtifactReboot|SupportsRollback) | ||
: | ||
;; | ||
*) | ||
echo "$1" >> $TEST_DIR/call.log | ||
;; | ||
esac | ||
;; | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Search and replace error here 🔎
;; | ||
esac | ||
;; | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
*) | ||
echo "$1" >> $TEST_DIR/call.log | ||
;; | ||
esac | ||
)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fix (thanks!) should have been in a separate commit.
"--stop-after", | ||
"ArtifactCommit", | ||
"--stop-before", | ||
"ArtifactCommit_Leave", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between stopping before ArtifactCommit_Leave
or Cleanup
? For the successful case, there is no real difference. And yes, for failure it will behave different (it would stop or not), but maybe we could merge these two use cases and stop only before Cleanup
?
From the API point of view, to allow stopping before a Leave state sounds strange. Note that every other allowed state to stop before are Enter states (or Cleanup)
No description provided.