clean: handle common options
i encountered failure from lb clean --debug
, realising then that clean did not actually handle most of the set of common options.
a refactor was required to achieve the goal of fixing this, which also significantly simplifies it, avoiding all of the recursive execution.
Merge request reports
Activity
added 20 commits
-
37a3e411...9d5665c6 - 6 commits from branch
live-team:master
- 5f368531 - config: optimisation for fresh configs
- 742bc0d9 - config: optimise --ignore-system-defaults
- 17bc93c5 - config: add --ignore-saved option
- 43b6e1f9 - config: add --purge-saved option
- 74d888af - examples: use `lb config --purge-config` in `auto/clean`
- cc51afca - examples: use --ignore-saved in `auto/config`
- 9a3e3844 - clean: add --saved-config option
- e774b320 - examples: use `--saved-config` with `lb clean`
- aafdc8d0 - clean: improve arg handling
- 3130cd15 - clean: fix missing 'noauto' param for substage execution
- 8a685129 - clean: switch "cleaning chroot" to be a debug message
- 8a493693 - clean: expand debugging
- b1bef174 - clean: add missing common option handling
- 90ed006f - clean: fix option handling with refactor
Toggle commit list-
37a3e411...9d5665c6 - 6 commits from branch
added 15 commits
-
b4156e14 - 1 commit from branch
live-team:master
- 75426c38 - config: optimisation for fresh configs
- 15569de1 - config: optimise --ignore-system-defaults
- dafcc34b - config: add --ignore-saved option
- babeb80d - config: add --purge-saved option
- 7dfa32ad - examples: use `lb config --purge-config` in `auto/clean`
- 4cfb05e6 - examples: use --ignore-saved in `auto/config`
- 143adbc3 - clean: add --saved-config option
- a90a6436 - examples: use `--saved-config` with `lb clean`
- 4b4141ae - clean: improve arg handling
- 5720ebc0 - clean: fix missing 'noauto' param for substage execution
- 372e02f3 - clean: switch "cleaning chroot" to be a debug message
- 6d3d722b - clean: expand debugging
- 8934ba8e - clean: add missing common option handling
- 5cab070d - clean: fix option handling with refactor
Toggle commit list-
b4156e14 - 1 commit from branch
@hertzog with the dependent MR delayed, I can very easily rebase this without it beneath to allow it to go through if you'd like. (I'll try to not do this dependency thing in future as requested).
Please do if you want me to consider it now.
I have a few comments:
- I think I prefer to keep the message for "Cleaning chroot" visible by default, because the step takes a long time to remove all the files and it's reassuring to know what the script is doing when it seems to be stuck... if you need to make the other steps visible for consistency, then so be it.
- The processing of common options is not satisfying... you're duplicating it once more and options only take effect if they have been specified before the action. This seems to be not worth the effort.
Ok. done.
There are two core commits introducing support, the first indeed only allows them to work in certain orders, but the second refactors things such that it's more simple, and such that all combinations work as to be expected. I guess I could have implemented the commits the other way around, to refactor then add support, but it just came out this way and I didn't think it worth the effort to redo it the other way around.
- I took care of the very minor fixes that were part of this, to save effort. I'd obviously submitted this before you'd clarified that some similar small things in a different MR were fine. So this is now reduced down to the core change.
- I removed the commit changing the message to debug, as requested. I left the others debug, with a comment besides the one non-debug one so no-one thinks it's a mistake.
The duplication of the options is certainly not ideal, and I'd like to take a further look at reworking it to make use of
Arguments()
instead. I can do this before merging if you want me to, otherwise I'll look into it after.Since
config
also duplicates common options, and taking a moment to further consider that aspect, I think what I might like to do is create a simple common function that handles executing the right action for a common action, such that all three places handling common options (config
,clean
andArguments()
) will have acase
entry for all common options, and will take the action of passing the option on to this common function that take action on it. This thus removes all of that duplication.Can I take care of that after?
Edited by Lyndon BrownOk, sorry for the noise, but I've revised things to be much nicer now.
- I took care of making a common helper for taking action on common options, shared by
config
,clean
andArguments()
. - I switched the order of the two commits here, so we have a clean refactor first, then addition of the common option support.
- The common option support now uses the new helper, such that there's no horrible duplication.
- I took care of making a common helper for taking action on common options, shared by
added 26 commits
-
5cab070d...55e17b1e - 24 commits from branch
live-team:master
- 0fb938fd - clean: add missing common option handling
- d75c9b06 - clean: fix option handling with refactor
-
5cab070d...55e17b1e - 24 commits from branch
added 4 commits
-
d75c9b06...640a25f7 - 2 commits from branch
live-team:master
- 68d5165e - clean: refactor
- 9b0b10f5 - clean: add missing common option handling
-
d75c9b06...640a25f7 - 2 commits from branch
added 19 commits
-
3dc73939...21c69761 - 17 commits from branch
live-team:master
- 30c26d7d - clean: refactor
- 2d8c37d9 - clean: handle all common options
-
3dc73939...21c69761 - 17 commits from branch
added 4 commits
-
6162baf9...943c8fb5 - 2 commits from branch
live-team:master
- 101d1898 - clean: refactor
- 9290311d - clean: handle all common options
-
6162baf9...943c8fb5 - 2 commits from branch
added 22 commits
-
9290311d...18eefdd6 - 20 commits from branch
live-team:master
- 504f4eb6 - clean: refactor
- dbf8f5b6 - clean: handle all common options
-
9290311d...18eefdd6 - 20 commits from branch
added 6 commits
-
dbf8f5b6...0afd3625 - 4 commits from branch
live-team:master
- fca12831 - clean: refactor
- 263f84fe - clean: handle all common options
-
dbf8f5b6...0afd3625 - 4 commits from branch
enabled an automatic merge when the pipeline for 263f84fe succeeds