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

Support atomic bumping #26

Open
dnicolson opened this issue Nov 13, 2021 · 1 comment
Open

Support atomic bumping #26

dnicolson opened this issue Nov 13, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@dnicolson
Copy link
Contributor

If an error occurs when bumping a version it can be incomplete, in such cases the result can be that the CHANGELOG.md, package.json, and package-lock.json files are updated but no tags are added.

Here is an example of hook throwing an error relating to the Node.js version:

$ bump minor
Bumping the version...
Updating the changelog...
Making the commit...
{ Error: Command failed: git commit -a -m Bump version to 0.9.0
lint-staged requires at least version 12.13.0 of Node, please upgrade
husky - pre-commit hook exited with code 1 (error)


    at makeError (/Users/dave/.asdf/installs/nodejs/10.18.0/.npm/lib/node_modules/@fabiospampinato/bump/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/Users/dave/.asdf/installs/nodejs/10.18.0/.npm/lib/node_modules/@fabiospampinato/bump/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: 1,
  stdout: '',
  stderr:
   'lint-staged requires at least version 12.13.0 of Node, please upgrade\nhusky - pre-commit hook exited with code 1 (error)\n',
  failed: true,
  signal: null,
  cmd: 'git commit -a -m Bump version to 0.9.0',
  timedOut: false,
  killed: false }
[commit] An error occurred while making the commit
@fabiospampinato fabiospampinato added the bug Something isn't working label Feb 16, 2022
@fabiospampinato fabiospampinato changed the title Errors can cause non-atomic version bumps Support atomic bumping Aug 29, 2023
@fabiospampinato fabiospampinato added enhancement New feature or request and removed bug Something isn't working labels Aug 29, 2023
@fabiospampinato
Copy link
Owner

Atomic bumping is not really possible, in the sense that it can't be implemented in a way that no matter what you never see an half-done state, but trying to revert changes if a future step fails seems worthwhile.

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

No branches or pull requests

2 participants