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 bumping isn't working properly based on Commit types

See original GitHub issue

Hi,

I’m using commitzen to take care of my commits, but when I make a release, standard-version isn’t bumping based on my commits and only bumps patch once.

Logs

// standard-version log
> npx standard-version

√ 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
warning: LF will be replaced by CRLF in CHANGELOG.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory

warning: LF will be replaced by CRLF in CHANGELOG.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory

√ tagging release v0.1.1
i Run `git push --follow-tags origin master && npm publish` to publish
// git cz log
> git-cz                                                                                                       
                                                                                                               
cz-cli@4.0.3, cz-conventional-changelog@3.1.0                                                                  
                                                                                                               
? Select the type of change that you're committing: fix:      A bug fix                                        
? What is the scope of this change (e.g. component or file name): (press enter to skip) winston & package.json 
? Write a short, imperative tense description of the change (max 71 chars):                                    
 (59) removed unused winston config file and updated package.json                                              
? Provide a longer description of the change: (press enter to skip)                                            
                                                                                                               
? Are there any breaking changes? No                                                                           
? Does this change affect any open issues? No                                                                  
[master 8dbe6ae] fix(winston & package.json): removed unused winston config file and updated package.json      
 5 files changed, 515 insertions(+), 2319 deletions(-)                                                         
 create mode 100644 .versionrc                                                                                 
 delete mode 100644 src/config/winston.js                                                                      

But inside the Changelog.md, commits are being separated based on their types.

Dependencies

{
  "devDependencies": {
    "@babel/cli": "^7.8.4",
    "@babel/core": "^7.8.4",
    "@babel/preset-flow": "^7.8.3",
    "babel-eslint": "^10.0.3",
    "commitizen": "^4.0.3",
    "cz-conventional-changelog": "^3.1.0",
    "eslint": "^6.8.0",
    "eslint-config-airbnb-base": "^14.0.0",
    "eslint-plugin-flowtype": "^4.6.0",
    "eslint-plugin-import": "^2.20.1",
    "flow-bin": "^0.117.0",
    "standard-version": "^7.1.0"
  },
  "dependencies": {
    "app-root-path": "^3.0.0",
    "body-parser": "^1.19.0",
    "compression": "^1.7.4",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "helmet": "^3.21.2",
    "winston": "^3.2.1"
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

36reactions
kaufmann42commented, Feb 26, 2020

I think I’ve found the problem. Prior to 1.0.0, it bumps patch only. Looking through the code in bump.js, it looks like this was an intended.

For those looking for a ❗️ Solution ❗️ , I recommend just bumping to v1.0.0 and then it should work fine.

10reactions
ttouscommented, Nov 27, 2020

SemVer specifies that:

  • If there is a breaking change (whether it comes from a feature or a fix), bump the MAJOR.
  • If not, if there is a feature, bump the MINOR.
  • If not (there are only bugfixes), bump the PATCH.

We tag pre-production versions as 0.y.z because we want them to be considered unstable: breaking changes happen a lot.

Therefore, perhaps we should follow these same rules, except for the first one: no matter if there is a breaking change or not, bump the MINOR if there is a feature, and if not, bump the PATCH.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version bumping same branch works only for first bump commit
My goal is to have a simple workflow: Master branch for publishing new packages, we can branch from it, add some changes, bump...
Read more >
Generating changelog automatically with Standard Version
Using Conventional Commits. The Standard Version utility can figure out a proper release version and generate a changelog file for us. To do ......
Read more >
Automate Semantic Versioning with Conventional Commits
This allows your CI Pipeline to automate the versioning of an application by bumping version numbers in the package.json & CHANGELOG based ......
Read more >
Code version best practices with clean commit formats
To ensure that the commits are linted properly, the team must adhere to ... a semantic version bump (based on the types of...
Read more >
conventional commit messaging - Conventional Commits
Notice these types are not mandated by the conventional commits ... Automatically determining a semantic version bump (based on the types of commits...
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