clearlinux / mixer-tools

Software update mixer and related tools
Apache License 2.0
27 stars 37 forks source link

Enable mixer reset functionality #702

Open reaganlo opened 4 years ago

reaganlo commented 4 years ago

User should have an option to reset mixer to a desired version. Based on implicit behavior or through additional flags user should be able to do the following:

Note: Currently the following are the files related to mix versioning:

- mixversion
- mixer.state
- update/image/LAST_VER
- update/www/version/latest_version
- update/www/version/latest_version.sig
- update/www/version/format<format>/latest_version
- update/www/version/format<format>/latest_version.sig
reaganlo commented 4 years ago

@mbelluzzo I have listed the requirements based on our discussion. Can you please take a look at it and confirm. @ashleshaAtrey @jwakre FYI

mbelluzzo commented 4 years ago

Should --to <ver> imply --clean?

I mean, is it possible to have a sane state of the update/ folder if one rollbacks 3 builds and than issue a new build without passing --clean? Even for rolling back just a single version.

Maybe another way to think about this is: do we have an use case where --clean would not be desired? If so, is that the default case? Or instead of --clean we actually should have --no-clean to deal with this corner case.

The --no-signing is needed and looks good!

rchiossi commented 4 years ago

Should --to <ver> imply --clean?

One of the planned uses for this feature is to crete "forks" on the stream, which mean being freely able to move back an forth through previous builds (e.g. go back 2 versions in case of a format bump).

I mean, is it possible to have a sane state of the update/ folder if one rollbacks 3 builds and than issue a new build without passing --clean? Even for rolling back just a single version.

It really depends on how this is implemented. Ideally, published content won't change during a reset (everything inside update/www) unless clean is specified, in which case rolling back to an arbitrary version is possible without a clean. Relevant published content like update/www/version/latest_version and its respective sig will be overwritten once a successful build in generated, so keeping them around shouldn't affect sanity.

Maybe another way to think about this is: do we have an use case where --clean would not be desired? If so, is that the default case? Or instead of --clean we actually should have --no-clean to deal with this corner case.

Also consider that clean can be fairly dangerous and can destroy a good update stream if misused. Keeping it explicit could minimize the risk.