question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version not bumping

See original GitHub issue

I have a remote instance (Jenkins) running the release script. That’s been working fine but running it on a new instance is producing different results. The issue is that the bump part of the release script is not occurring. The script is literally the same and I’m using npm ci to ensure the package versions are consistent.

Any thought on why this could produce different results running the same script on different systems? Are there some git repository expectations that might be missing? It produces the right tag it’s just not bumping the version.

New instance output. Note the missing bump logs.

+ npm run release -- --release-as patch

> @mob/mobile@1.0.0 release /var/lib/jenkins/workspace/commonjsmodule-publish_master
> standard-version "--release-as" "patch"

✔ outputting changes to CHANGELOG.md
✔ committing CHANGELOG.md
✔ tagging release v1.0.1
ℹ Run `git push --follow-tags origin master` to publish

Running locally.

$ npm run release -- --release-as major

> @mob/mobile@1.0.0 release /Users/ralph.smith/Workspace/mobile
> standard-version "--release-as" "patch"

✔ bumping version in package.json from 1.0.0 to 1.0.1
✔ bumping version in package-lock.json from 1.0.0 to 1.0.1
✔ outputting changes to CHANGELOG.md
✔ committing package-lock.json and package.json and CHANGELOG.md
✔ tagging release v1.0.1
ℹ Run `git push --follow-tags origin master && npm publish` to publish

Here’s a historical log from the old instance that’s been working fine:

+ npm run release -- --release-as patch

> @mob/mobile@0.1.0 release /var/jenkins_home/workspace/_commonjsmodule-publish_master_2
> standard-version "--release-as" "patch"

✔ bumping version in package.json from 0.1.0 to 0.1.1
✔ bumping version in package-lock.json from 0.1.0 to 0.1.1
✔ outputting changes to CHANGELOG.md
✔ committing package-lock.json and package.json and CHANGELOG.md
✔ tagging release v0.1.1
ℹ Run `git push --follow-tags origin master && npm publish` to publish

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:11
  • Comments:9

github_iconTop GitHub Comments

2reactions
ihor1337commented, Oct 16, 2021

so after some digging around I figured out how to solve it for my use case. If you look at the library source, you’ll see that it checks if the package.json is gitignored and if it is it just returns from the function without bumping the version

const configPath = path.resolve(process.cwd(), updater.filename)
    try {
      if (dotgit.ignore(configPath)) return

https://github.com/conventional-changelog/standard-version/blob/master/lib/lifecycles/bump.js#L146

In my case, I’m working on a library that builds into lib folder, so we added lib to .gitgnore. It works just fine on local but fails in jenkins because jenkins workplace is located in /var/lib/jenkins/workspace/<your_repo>, since jenkins workplace is located under lib directory and lib is gitignored this condition becomes truthy in jenkins if (dotgit.ignore(configPath)) return so it just returns and doesn’t bump the version up.

The way I solved is I changed the output directory of my library from lib to dist, removed lib from .gitignore and added dist instead. After this change it worked as expected.

It would be nice if this was documented tho, or at least a warning in the console would have helped to save a LOT of time and headache.

I hope this helps the next person who runs into this.

1reaction
jbadancommented, Aug 26, 2020

@praneybehl We (speaking for @droshev here too) found the 🐛 for our implementation at least - it ended up being something in our .gitignore triggering this line: https://github.com/conventional-changelog/standard-version/blob/master/lib/lifecycles/bump.js#L155

See https://github.com/SAP/fundamental-styles/pull/1289

Hope that helps you too!

Read more comments on GitHub >

github_iconTop Results From Across the Web

release reminder or commit blocker when no version bump
I am looking for a way to get this working. version (A). check package.json of mono-repo and read file last commit ID (usually...
Read more >
not receive notification after successful push to bioconductor ...
I successfully pushed updates of package RiboDiPA to bioconductor with version bump, but didn't receive automatic notification from bioconductor. Any clues on ...
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
In systems with many dependencies, releasing new package versions can quickly become a nightmare. If the dependency specifications are too tight, ...
Read more >
npm-version - npm Docs
Bump a package version. ... Whether or not to output JSON data, rather than the normal output. In npm pkg set it enables...
Read more >
Major Version Numbers are Not Sacred - Tom Preston-Werner
In that world, the minor versions would contain breaking changes, especially for products with large API surface areas. Bumping the major ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found