Digital-Sapphire/PyUpdater

How to undo mistakes?

dennisvang opened this issue · 3 comments

Example scenario

Suppose we have built, packaged, and signed a new release, but have not published/uploaded it yet.

So, locally, we've done:

pyupdater build --app-version=2.1.0 my_app.spec
pyupdater pkg --process
pyupdater pkg --sign

Now it turns out we've made a mistake: this should have been version 2.0.1 instead of 2.1.0.

How can we undo a simple mistake like that?

Documentation

It would be great if the documentation could provide some guidelines with respect to fixing mistakes.

Currently, either the documentation does not provide much information on this subject, or the information is scattered.

For example, some questions:

  • Is it safe to delete a zip archive and corresponding patch from pyu-data/deploy and pyu-data/files, if they have not been published/uploaded yet?
  • In that case, what do we do with the versions.gz file? Can we safely delete that as well?
  • And if we do that, we probably need to remove the corresponding entries from .pyupdater/config.pyu?

If the above is not safe, what would be the recommended way to roll-back mistakes that have not yet been published/uploaded?

CLI

I guess a command line tool would be very convenient here. For example, something like pyupdater undo to remove the latest version, or pyupdater rollback --app-version=2.0.0 which would remove all versions higher than 2.0.0. Of course these should only be used for unpublished versions.

@JMSwag : I started working on a possible implementation of an undo command here:

https://github.com/dennisvang/PyUpdater/tree/issue311

Would love to hear your thoughts.

@dennisvang Hey, thanks for bringing this up. There is currently no undo/rollback command. The main file that needs to be updated is the config.pyu to remove the incorrect version.

The files residing in the deploy directory can be safely deleted. If I'm not mistaken, the files directory is used for creating patches from the previous version, so you'll want to remove the incorrect package version from that directory as well.

Hope this helps.

@dennisvang this is an amazing addition, and I've been victim to stuff like this myself.
Would be amazing to get implemented.