Skip to content
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

A better rollback when something fails #1

Open
mgol opened this issue Dec 30, 2014 · 4 comments
Open

A better rollback when something fails #1

mgol opened this issue Dec 30, 2014 · 4 comments

Comments

@mgol
Copy link
Owner

mgol commented Dec 30, 2014

If anything throws in a process before we publish on npm, a full rollback should happen (including a push --force on a branch to the previous version?)

@mgol mgol changed the title A better rollback A better rollback when something fails Dec 30, 2014
@agonbina
Copy link

agonbina commented Mar 9, 2016

screen shot 2016-03-09 at 11 59 52 am

Hey @mgol, it would definitely be nice to rollback when something fails.

@mgol
Copy link
Owner Author

mgol commented Mar 9, 2016

Hmm, it should be enough to wrap

npm-bump/lib/cli.js

Lines 86 to 89 in e665175

run(`git checkout ${ quote(newStableVersion) } 2>/dev/null`);
run(`npm publish ${ quote(getRootPath()) }${
isPrerelease ? ` --tag ${ quote(releaseType) }` : '' }`
);
in try-catch and do the rollback on error. Wrapping more things would be problematic as it npm publish succeeded and next Git operations failed we can't revert the npm publish (we could unpublish but you can't then re-publish the same version).

Thoughts? Would you like to prepare a PR?

@mgol
Copy link
Owner Author

mgol commented Mar 9, 2016 via email

@aj-dev
Copy link

aj-dev commented Jul 28, 2016

@mgol I agree, npm publish should definitely be the last thing we do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants