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
lifecycle: automatically clean dirty steps #2145
lifecycle: automatically clean dirty steps #2145
Conversation
Currently the snapcraft CLI will error out if a given step has already run, but has changed since doing so (e.g. if a part has been pulled, but then had a `stage-package` added). Add support for automatically cleaning the required steps instead of erroring. Leave today's behavior as the default, but add a configuration item to enable the new behavior. Simply add the following snippet to `~/.config/snapcraft/cli.cfg`: [Lifecycle] outdated_step_action = clean Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
96cc962
to
43c6721
Compare
Codecov Report
@@ Coverage Diff @@
## master #2145 +/- ##
==========================================
- Coverage 91.02% 91.01% -0.02%
==========================================
Files 193 193
Lines 12182 12200 +18
Branches 1820 1824 +4
==========================================
+ Hits 11089 11104 +15
- Misses 751 753 +2
- Partials 342 343 +1
Continue to review full report at Codecov.
|
return OutdatedStepAction[action.upper()] | ||
else: | ||
# Error by default | ||
return OutdatedStepAction.ERROR |
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.
I feel like we want to make the default the new behavior and maybe warn (a couple of times) about how to set the old behavior back.
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.
I guess I was thinking our team could flip that switch for a release or so to make sure it doesn't bite before flipping it for everyone, but yeah, if you want to flip it now and warn that's fine.
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.
OK, if we flip ourselves in a near future, that is fine as well, please create a bug task to flip the switch.
./runtests.sh static
?./runtests.sh unit
?Currently the snapcraft CLI will error out if a given step has already run, but has changed since doing so (e.g. if a part has been pulled, but then had a
stage-package
added).This PR resolves LP: #1774021 by adding support for automatically cleaning the required steps instead of erroring. It leaves today's behavior as the default, but adds a configuration item to enable the new behavior. Simply add the following snippet to
~/.config/snapcraft/cli.cfg
: