Possibility to rollback to a previous comitted version
When a large site has just been deployed and an issue is discovered, it would be helpful if you could fast and easy revert to a previous working version
wrangler publish --rollback=1 # to rollback to last published version
Why not git checkout <working_commit> && wrangler publish?
Possibly even creating tagged commits for publishing to Workers to easily track what commits are published.
Could you provide more detail why this should be added to Wrangler vs being part of a Git workflow?
Sure @jahands - I don't track my /dist/ folder in git, perhaps I should do this, but currently I don't. So even if I checkout another commit, /dist/ folder won't change.
Currently I just created a "hacky" workaround, where in my deploy script it runs cp on current folder to "my-project" -> "my-project-1", and then I can cd into my-project-1 and run wrangler publish if I wish to redeploy.
cc @rita3ko @ashleymichal
@simplenotezy Can you share more about your setup? How does the contents of /dist/ get built? Can you share your wrangler.toml or build script?
I'm using webpack and every time I run wrangler publish it will build the script from source before publishing. So if I checkout a previous commit, wrangler will automatically re-build everything.
@jahands my /distribution/ folder is not tracked by git which i believe we pretty common. Dear build script takes around 2-3000 seconds so if I checkout a previous commit I have to wait 3000 seconds for the build process to complete (it's a pretty big site with a lot of content).
Oh wow, that's a long time! Now I understand why you would want easier ways to revert.
I don't think keeping track of multiple deployments is in the scope of wrangler/workers and better suited to other tools.
Have you considered making /distribution/ a separate repo so that you can track deployments without blowing up your development repo? I'd think git operations would be faster than rebuilding for 3000 seconds.
@simplenotezy FYI we'd like to do something like this before too long. We'll post an update when we've got more concrete plans.
I stand corrected! I'll be interested to see what this looks like.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This feature would be very nice. I have my [site] wrangler publish via Github Actions and all the process take some minutes. So if a revert is an option my deploys would be less stressful for sure. 馃槄
Most helpful comment
@simplenotezy FYI we'd like to do something like this before too long. We'll post an update when we've got more concrete plans.