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

Updating wrong version when using conventional commit and --ci #781

Closed
mjunior opened this issue Jun 24, 2021 · 8 comments
Closed

Updating wrong version when using conventional commit and --ci #781

mjunior opened this issue Jun 24, 2021 · 8 comments
Labels

Comments

@mjunior
Copy link

mjunior commented Jun 24, 2021

I setup im my project release-it with conventional commit plugin, but them always update my minor version. I did a commit with the message fix(docs): my fix commit and then run npm run release and release-it updated my minor version instead of patch version

//package.json
{
  "name": "portal-alelo-auto",
  "version": "2.99.0",
  "scripts": {
    "ng": "ng",
    "start": "NODE_OPTIONS=--max-old-space-size=2048 ng serve --port=4200",
    "start-prod": "NODE_OPTIONS=--max-old-space-size=2048 ng serve --prod --port=4200",
    "start:proxy": "NODE_OPTIONS=--max-old-space-size=2048 ng serve --proxy-config proxy.conf.json",
    "build": "NODE_OPTIONS=--max-old-space-size=2048 ng build --prod",
    "test": "NODE_OPTIONS=--max-old-space-size=2048 ng test --watch=false --code-coverage --browsers=ChromeHeadlessNoSandbox",
    "release-version": "node ./node_modules/semantic-release/bin/semantic-release.js",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "husky install && ngcc",
    "reinstall-ads": "echo ONLY FOR DEV ENV && npm uninstall @alelo/components && npm i alelo-design-system/packages/alelo-components-0.0.3.tgz",
    "sonar": "sonar-scanner -Dsonar.projectVersion=$(jq -r .version package.json)",
    "sonar:dev": "sonar-scanner -Dsonar.projectVersion=$(jq -r .version package.json) -Dsonar.login=\"admin\" -Dsonar.password=\"dev\" ",
    "cz": "git cz",
    "release": "release-it --ci --no-git.requireUpstream" <---
  },
  "private": true,
  "dependencies": {
    "@alelo/components": "2.5.0",
    "@angular/animations": "9.1.11",
    "@angular/cdk": "^9.0.0",
    "@angular/common": "9.1.11",
    "@angular/compiler": "9.1.11",
    "@angular/core": "9.1.11",
    "@angular/forms": "9.1.11",
    "@angular/platform-browser": "9.1.11",
    "@angular/platform-browser-dynamic": "9.1.11",
    "@angular/router": "9.1.11",
    "@fortawesome/fontawesome-free": "5.6.3",
    "@types/lodash-es": "4.17.1",
    "angulartics2": "7.5.2",
    "base64url": "^3.0.1",
    "bourbon": "5.1.0",
    "buffer": "^5.7.1",
    "core-js": "2.5.4",
    "dayjs": "1.8.11",
    "file-saver": "^2.0.5",
    "gzip-js": "^0.3.2",
    "jwt-decode": "2.2.0",
    "lodash": "4.17.11",
    "lodash-es": "4.17.10",
    "ng-recaptcha": "^7.0.1",
    "rxjs": "6.5.5",
    "subsink": "^1.0.2",
    "tslib": "1.10.0",
    "xlsx": "^0.15.6",
    "zone.js": "0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.900.7",
    "@angular-devkit/build-angular": "^0.901.13",
    "@angular-devkit/build-optimizer": "^0.900.7",
    "@angular-devkit/core": "^9.1.13",
    "@angular-devkit/schematics": "^9.1.13",
    "@angular/cli": "^9.1.13",
    "@angular/compiler-cli": "9.1.11",
    "@angular/language-service": "9.1.11",
    "@commitlint/cli": "^12.1.4",
    "@commitlint/config-angular": "^12.1.4",
    "@release-it/conventional-changelog": "^3.0.1",  <-----
    "@semantic-release/changelog": "^5.0.1",
    "@semantic-release/git": "^9.0.0",
    "@types/jasmine": "^3.6.3",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "^8.10.66",
    "codelyzer": "4.5.0",
    "cz-conventional-changelog": "^3.3.0",
    "husky": "^6.0.0",
    "jasmine-core": "^3.6.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "^4.4.1",
    "karma-chrome-launcher": "^3.1.0",
    "karma-coverage": "^2.0.3",
    "karma-coverage-istanbul-reporter": "^2.1.1",
    "karma-jasmine": "^3.3.1",
    "karma-jasmine-html-reporter": "^1.5.4",
    "karma-junit-reporter": "^2.0.1",
    "karma-mocha-reporter": "^2.2.5",
    "ng-mocks": "^9.6.4",
    "protractor": "5.4.0",
    "puppeteer": "^5.5.0",
    "release-it": "^14.10.0",   <-----
    "semantic-release": "^17.4.3",
    "sonar-scanner": "^3.1.0",
    "ts-node": "7.0.0",
    "tslint": "5.11.0",
    "tslint-sonarts": "1.9.0",
    "typescript": "3.8.3"
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}

This is my release-it.json

// release-it.json
{
  "git": {
    "commitMessage": "build: release v${version} [skip ci]",
    "commit": true,
    "tag": true,
    "push": false,
    "tagName": "next-${version}"
  },
  "npm": {
    "publish": false
  },
  "plugins": {
    "@release-it/conventional-changelog": {
      "preset": "conventionalcommits",
      "infile": "CHANGELOG.md"
    }
  }
}

And this is my git log

**63919918 build: release v2.99.0 [skip ci]** (expected v2.96.3 or 2.98.1)

7778ab75 fix(docs): my fix 03

**509c4145 build: release v2.98.0 [skip ci]** (expected version v2.96.2 or 2.97.1)

4df45a5e fix: fix

**c8af280c build: release v2.97.0 [skip ci]**  (expected version v2.96.1)

d317380f fix(docs): correçao

**c7a12222 build: release v2.96.0 [skip ci]**

@webpro
Copy link
Collaborator

webpro commented Jun 25, 2021

@mjunior
Copy link
Author

mjunior commented Jun 30, 2021

I think that I found a bug related a tagName. When I remove this flag it's works perfectly. I am going to write more about that in the weekend

@TheRealWaldo
Copy link

@webpro I also see the wrong version appear in the changelog, but it's correct in the version.

In the commit here, you can see the behavior:
TheRealWaldo/release-it@741f50e

I have the commit message as "chore(release): v${version}\n${changelog}" and I am also using tagName

@TheRealWaldo
Copy link

@webpro ignore my last comment. I think I discovered why it's doing that, and it's my implementation combined with a misunderstanding of how increment is being used internally. About to confirm.

@webpro
Copy link
Collaborator

webpro commented Jul 14, 2021

It might be related to #722, #753 and/or #761.

Please let me know any details you might have to help me fix it.

@webpro
Copy link
Collaborator

webpro commented Aug 10, 2021

I've released new versions of release-it and the conventional-changelog plugin. One fix that's included (in both) is regarding the tag prefix ("next-") in the tagName. Let's see if this helps in your use case(s).

@TheRealWaldo
Copy link

@webpro I filed release-it/conventional-changelog#26 as I could not get the latest update to run. Looks like the code now requires tagTemplate to be defined, even if git:false, and not sure what that would be, so think it's an (unrelated to this) bug?

@stale
Copy link

stale bot commented Oct 12, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Oct 12, 2021
@stale stale bot closed this as completed Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants