commit-analyzer icon indicating copy to clipboard operation
commit-analyzer copied to clipboard

`The commit should not trigger a release` after recent updates

Open ashvardanian opened this issue 1 year ago • 6 comments

My commit messages look like these:

commit d2b67fb4df02293e0a6478ffa6b61a1d6c502cff (origin/main-dev)
Author: Ash Vardanian <[email protected]>
Date:   Mon May 6 00:55:26 2024 +0000

    Fix: Build graph dependency

commit 4168fcda53a75eb50bde9cd342aa42eebf253422 (main-dev)
Author: Ash Vardanian <[email protected]>
Date:   Sun May 5 06:15:13 2024 +0000

    Make: Refresh `Cargo.lock`

... and the .releaserc is configured to detect those:

    "plugins": [
        [
            "@semantic-release/commit-analyzer",
            {
                "preset": "eslint",
                "releaseRules": [
                    {
                        "tag": "Break",
                        "release": "major"
                    },
                    {
                        "tag": "Add",
                        "release": "minor"
                    },
                    {
                        "tag": "Improve",
                        "release": "patch"
                    },
                    {
                        "tag": "Make",
                        "release": "patch"
                    },
                    {
                        "tag": "Refactor",
                        "release": false
                    }
                ]
            }
        ],

But recently, all of the semantic-release pipelines simply ignore all the releases:

[6:17:19 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[6:17:19 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Make: Publish Python sources
Closes #113
[6:17:19 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[6:17:19 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge pull request #117 from ashvardanian/main-dev
Linking OpenMP
[6:17:19 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[6:17:19 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Make: Disable JS prebuild for Windows

I'm currently using semantic-release in several projects and can't run the CI without it. I've tried locating the issue, but couldn't find where its coming from. Any pointers you could share?

ashvardanian avatar May 08 '24 18:05 ashvardanian

Possibly related to https://github.com/semantic-release/release-notes-generator/issues/633

travi avatar May 08 '24 19:05 travi

Why doesn't the commit-analyzer throw an error in this situation? I also had issues with it, in my case I was trying to get the breaking change feat! syntax working. The commit analyzer just ignored them, so I assume it just silently falls back to the angular preset or something? Would have saved me many hours if it actually hard failed

HenrikPoulsen avatar May 14 '24 07:05 HenrikPoulsen

I raised it over in https://github.com/semantic-release/release-notes-generator/issues/633 as well, but I think it makes sense here as well. Updating the plugins seems like an inherently dangerous proposition when it comes to semantic-release. How am I supposed to know when an update is breaking the entire release flow like in the case outlined here? As you can see from the output there's no errors at all. So you could go week after updating something without noticing anything is wrong. We at least saw that the release-notes-generator broke from this change, but the commit-analyzer doesn't even get that far if you do what was outlined in this issue here.

Are there any suggestions for how one could automate verifying that an update doesn't break something? (even a non-major version update could still break you) How would you, in your update branch, verify automatically that things like a feat!, fix or whatever else would still want to bump? Are there things that could be done in semantic release itself to help reduce this?

If you are just doing this in a single repo it's not so much of a problem. But in my case I am considering rolling it out across hundreds of repos, specifically with the conventionalcommits plugin. I don't know how to do this successfully given issues like this being able to arise.

HenrikPoulsen avatar May 30 '24 09:05 HenrikPoulsen

Im on latest for all the packages. semantic-release v24, commit-analyzer v13, release-note-generator v14 (which does not fix this problem) But the analyzer does not classify fix(i18n): add missing translation for de as something that needs releasing.

IMO this problem is unrelated to the one mentioned in release-note-generator.

Yelinz avatar Jun 07 '24 14:06 Yelinz

are you using commitlint as well? if so, see https://github.com/semantic-release/release-notes-generator/issues/660#issuecomment-2154972720

what does npm ls conventional-changelog-conventionalcommits give you?

travi avatar Jun 07 '24 18:06 travi

Yes, I added a resolution to pin conventional-changelog-conventionalcommits to 8 as it was previously 7. But even after the pinning, no release gets triggered by the previously mentioned commit.

The used semantic release config uses the defaults, so it should use the angular preset. It is similar enough to conventionalcommits, that we had no problems until now. Therefore even tough commitlint is installed it should not matter. The angular preset is not directly installed, I assume that could cause probems?

One thing to mention as well is that the releases work for the config repository. But a repo that uses the config does not release.

EDIT: Seems like the Issue was caused by the commit being a compound message. Disgregard what I was saying. Just a stupid user error. Sorry for the wasted time

Saw that you mentioned yarn, the project uses pnpm.

pnpm why output

conventional-changelog-conventionalcommits

yz@forest:~/repos/ember-alexandria$ pnpm why conventional-changelog-conventionalcommits
devDependencies:
@adfinis/semantic-release-config 5.0.0
└─┬ @commitlint/config-conventional 19.2.2
  └── conventional-changelog-conventionalcommits 8.0.0

conventional-changelog-angular

@adfinis/semantic-release-config 5.0.0
├─┬ @commitlint/cli 19.3.0
│ └─┬ @commitlint/lint 19.2.2
│   └─┬ @commitlint/parse 19.0.3
│     └── conventional-changelog-angular 7.0.0
├─┬ @semantic-release/changelog 6.0.3
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── conventional-changelog-angular 8.0.0
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── conventional-changelog-angular 8.0.0
├─┬ @semantic-release/commit-analyzer 13.0.0
│ └── conventional-changelog-angular 8.0.0
├─┬ @semantic-release/git 10.0.1
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── conventional-changelog-angular 8.0.0
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── conventional-changelog-angular 8.0.0
├─┬ @semantic-release/github 10.0.6
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── conventional-changelog-angular 8.0.0
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── conventional-changelog-angular 8.0.0
├─┬ @semantic-release/npm 12.0.1
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── conventional-changelog-angular 8.0.0
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── conventional-changelog-angular 8.0.0
├─┬ @semantic-release/release-notes-generator 14.0.0
│ └── conventional-changelog-angular 8.0.0
└─┬ semantic-release 24.0.0
  ├─┬ @semantic-release/commit-analyzer 13.0.0
  │ └── conventional-changelog-angular 8.0.0
  └─┬ @semantic-release/release-notes-generator 14.0.0
    └── conventional-changelog-angular 8.0.0
semantic-release 24.0.0
├─┬ @semantic-release/commit-analyzer 13.0.0
│ └── conventional-changelog-angular 8.0.0
└─┬ @semantic-release/release-notes-generator 14.0.0
  └── conventional-changelog-angular 8.0.0

@semantic-release/release-notes-generator

yz@forest:~/repos/ember-alexandria$ pnpm why @semantic-release/release-notes-generator
devDependencies:
@adfinis/semantic-release-config 5.0.0
├─┬ @semantic-release/changelog 6.0.3
│ └─┬ semantic-release 24.0.0 peer
│   └── @semantic-release/release-notes-generator 14.0.0
├─┬ @semantic-release/git 10.0.1
│ └─┬ semantic-release 24.0.0 peer
│   └── @semantic-release/release-notes-generator 14.0.0
├─┬ @semantic-release/github 10.0.6
│ └─┬ semantic-release 24.0.0 peer
│   └── @semantic-release/release-notes-generator 14.0.0
├─┬ @semantic-release/npm 12.0.1
│ └─┬ semantic-release 24.0.0 peer
│   └── @semantic-release/release-notes-generator 14.0.0
├── @semantic-release/release-notes-generator 14.0.0
└─┬ semantic-release 24.0.0
  └── @semantic-release/release-notes-generator 14.0.0
semantic-release 24.0.0
└── @semantic-release/release-notes-generator 14.0.0

@semantic-release/commit-analyzer

yz@forest:~/repos/ember-alexandria$ pnpm why @semantic-release/commit-analyzer
devDependencies:
@adfinis/semantic-release-config 5.0.0
├─┬ @semantic-release/changelog 6.0.3
│ └─┬ semantic-release 24.0.0 peer
│   └── @semantic-release/commit-analyzer 13.0.0
├── @semantic-release/commit-analyzer 13.0.0
├─┬ @semantic-release/git 10.0.1
│ └─┬ semantic-release 24.0.0 peer
│   └── @semantic-release/commit-analyzer 13.0.0
├─┬ @semantic-release/github 10.0.6
│ └─┬ semantic-release 24.0.0 peer
│   └── @semantic-release/commit-analyzer 13.0.0
├─┬ @semantic-release/npm 12.0.1
│ └─┬ semantic-release 24.0.0 peer
│   └── @semantic-release/commit-analyzer 13.0.0
└─┬ semantic-release 24.0.0
  └── @semantic-release/commit-analyzer 13.0.0
semantic-release 24.0.0
└── @semantic-release/commit-analyzer 13.0.0

semantic-release

yz@forest:~/repos/ember-alexandria$ pnpm why semantic-release
devDependencies:
@adfinis/semantic-release-config 5.0.0
├─┬ @semantic-release/changelog 6.0.3
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/github 10.0.2
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/npm 12.0.0
│   │ └── semantic-release 24.0.0 peer
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── semantic-release 24.0.0 peer
├─┬ @semantic-release/commit-analyzer 13.0.0
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/github 10.0.2
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/npm 12.0.0
│   │ └── semantic-release 24.0.0 peer
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── semantic-release 24.0.0 peer
├─┬ @semantic-release/git 10.0.1
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/github 10.0.2
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/npm 12.0.0
│   │ └── semantic-release 24.0.0 peer
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── semantic-release 24.0.0 peer
├─┬ @semantic-release/github 10.0.6
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/github 10.0.2
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/npm 12.0.0
│   │ └── semantic-release 24.0.0 peer
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── semantic-release 24.0.0 peer
├─┬ @semantic-release/npm 12.0.1
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/github 10.0.2
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/npm 12.0.0
│   │ └── semantic-release 24.0.0 peer
│   └─┬ @semantic-release/release-notes-generator 14.0.0
│     └── semantic-release 24.0.0 peer
├─┬ @semantic-release/release-notes-generator 14.0.0
│ └─┬ semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/commit-analyzer 13.0.0
│   │ └── semantic-release 24.0.0 peer
│   ├─┬ @semantic-release/github 10.0.2
│   │ └── semantic-release 24.0.0 peer
│   └─┬ @semantic-release/npm 12.0.0
│     └── semantic-release 24.0.0 peer
└─┬ semantic-release 24.0.0
  ├─┬ @semantic-release/commit-analyzer 13.0.0
  │ └── semantic-release 24.0.0 peer
  ├─┬ @semantic-release/github 10.0.2
  │ └── semantic-release 24.0.0 peer
  ├─┬ @semantic-release/npm 12.0.0
  │ └── semantic-release 24.0.0 peer
  └─┬ @semantic-release/release-notes-generator 14.0.0
    └── semantic-release 24.0.0 peer
semantic-release 24.0.0
├─┬ @semantic-release/commit-analyzer 13.0.0
│ └── semantic-release 24.0.0 peer
├─┬ @semantic-release/github 10.0.2
│ └── semantic-release 24.0.0 peer
├─┬ @semantic-release/npm 12.0.0
│ └── semantic-release 24.0.0 peer
└─┬ @semantic-release/release-notes-generator 14.0.0
  └── semantic-release 24.0.0 peer

Yelinz avatar Jun 10 '24 06:06 Yelinz

Hi,

we have a similar issue but for us the releases are skipped if we use a release config that analyzes the "message"field:

  releaseRules: [
    { breaking: true, release: 'major' },
    { type: 'feat', release: 'minor' },
    { type: 'fix', release: 'patch' },
    { message: '*', release: 'patch' }
  ]
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge branch 'renovate/cgm-life.docker.artifactory.cgm.ag-automation-maven-1.x' into 'main'
chore(renovate): Update cgm-life.docker.artifactory.cgm.ag/automation/maven Docker tag to v1.8.4
See merge request cgm-de-life-infrastructure/kubernetes/automation-tools/pipeline-container-images/maven-jdk17!3
2024-07-02T07:09:11.404Z semantic-release:commit-analyzer Analyzing with custom rules
2024-07-02T07:09:11.406Z semantic-release:commit-analyzer Analyzing with default rules
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: chore(renovate): Update cgm-life.docker.artifactory.cgm.ag/automation/maven Docker tag to v1.8.4
2024-07-02T07:09:11.406Z semantic-release:commit-analyzer Analyzing with custom rules
2024-07-02T07:09:11.408Z semantic-release:commit-analyzer Analyzing with default rules
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge branch 'renovate/cgm-life.docker.artifactory.cgm.ag-automation-maven-1.x' into 'main'
chore(renovate): Update cgm-life.docker.artifactory.cgm.ag/automation/maven Docker tag to v1.8.3
See merge request cgm-de-life-infrastructure/kubernetes/automation-tools/pipeline-container-images/maven-jdk17!2
2024-07-02T07:09:11.409Z semantic-release:commit-analyzer Analyzing with custom rules
2024-07-02T07:09:11.409Z semantic-release:commit-analyzer Analyzing with default rules
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: chore(renovate): Update cgm-life.docker.artifactory.cgm.ag/automation/maven Docker tag to v1.8.3
2024-07-02T07:09:11.409Z semantic-release:commit-analyzer Analyzing with custom rules
2024-07-02T07:09:11.410Z semantic-release:commit-analyzer Analyzing with default rules
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[7:09:11 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 4 commits complete: no release
[7:09:11 AM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[7:09:11 AM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/exec"
[7:09:11 AM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/exec"
[7:09:11 AM] [semantic-release] › ℹ  There are no relevant changes, so no new version is released.

Commits with type fix or feat work as expected.

cgmEdi avatar Jul 11 '24 09:07 cgmEdi

Branches where there the branch name is capitalized are skipped:

[@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Fix: [LIVE-735] Remove feature flag for facebook live 
[@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release

it works if the branch name is lowercase like: fix: [LIVE-735] Remove feature flag for facebook live

this is problematic since Github capitalizes the branch names automatically

rj-wowza avatar Jul 11 '24 20:07 rj-wowza

Branches where there the branch name is capitalized are skipped

~~Branches~~ commits with initial capitalization do not follow the commit convention you have chosen (even if you are using the default configured for semantic-release). semantic-release does not define the conventions and you have the option to define your own.

also, semantic-release evaluates commit messages, not branch names. this has not changed in recent updates

this is problematic since Github capitalizes the branch names automatically

if you are making commits through your browser, capitalizing the first letter of the ~~branch name~~ commit message field is browser behavior that you simply need to be careful about

travi avatar Jul 12 '24 16:07 travi

FWIW I have this project which works on 23.x but does not on 24.x : package.json

{
    "name": "semantic-release-dependencies",
    "devDependencies": {
        "@semantic-release/commit-analyzer": "^13.0.0",
        "@semantic-release/github": "^10.0.3",
        "@semantic-release/release-notes-generator": "^14.0.1",
        "@terrestris/maven-semantic-release": "^3.0.1",
        "conventional-changelog-conventionalcommits": "^7.0.2",
        "semantic-release": "^24.0.0"
    }
}

.release.rc

{
    "branches": ["main"],
    "plugins": [
      [
        "@semantic-release/commit-analyzer",
        {
          "preset": "conventionalcommits"
        }
      ],
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/github",
        {
          "preset": "conventionalcommits"
        }
      ],
      [
        "@terrestris/maven-semantic-release",
        {
          "settingsPath": "maven_settings.xml"
        }
      ]
    ]
  }

Here is the build run :

$ GH_TOKEN=OMITTED npx semantic-release --no-ci --dry-run=false
[12:29:04 p.m.] [semantic-release] › ℹ  Running semantic-release version 24.0.0
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@terrestris/maven-semantic-release"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "prepare" from "@terrestris/maven-semantic-release"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "publish" from "@terrestris/maven-semantic-release"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "success" from "@terrestris/maven-semantic-release"
[12:29:05 p.m.] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[12:29:08 p.m.] [semantic-release] › ✔  Run automated release from branch main on repository [email protected]:coveo/jacktest.git
[12:29:09 p.m.] [semantic-release] › ✔  Allowed to push to the Git repository
[12:29:09 p.m.] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[12:29:09 p.m.] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication
[12:29:09 p.m.] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[12:29:09 p.m.] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@terrestris/maven-semantic-release"
[12:29:09 p.m.] [semantic-release] [@terrestris/maven-semantic-release] › ℹ  Testing if mvn exists
Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256)
Maven home: /opt/homebrew/Cellar/maven/3.9.8/libexec
Java version: 21.0.3, vendor: Azul Systems, Inc., runtime: /Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "14.5", arch: "aarch64", family: "mac"
[12:29:09 p.m.] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@terrestris/maven-semantic-release"
[12:29:09 p.m.] [semantic-release] › ℹ  Found git tag v5.0.0 associated with version 5.0.0 on branch main
[12:29:09 p.m.] [semantic-release] › ℹ  Found 1 commits since last release
[12:29:09 p.m.] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[12:29:09 p.m.] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat!: this is breaking
[12:29:09 p.m.] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[12:29:09 p.m.] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 1 commits complete: no release
[12:29:09 p.m.] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[12:29:09 p.m.] [semantic-release] › ℹ  There are no relevant changes, so no new version is released.

jebeaudet avatar Jul 30 '24 16:07 jebeaudet

You need to also upgrade to the latest major version of your preset at the same time

travi avatar Jul 30 '24 19:07 travi

Argh, so sorry for this useless noise, indeed bumping to "conventional-changelog-conventionalcommits": "^8.0.0" fixes it. Thanks @travi

jebeaudet avatar Jul 30 '24 19:07 jebeaudet

i'm closing this thread as i believe all mentioned situations have solutions. to summarize:

  • make sure that the versions of semantic-release and any extra conventional-changelog packages (likely preset) you install are compatible as there have been recent breaking changes related to these. if you are upgrading to the latest semantic-release, also upgrade to the latest preset version
  • make sure you are following the details of the commit convention you have chosen, whether that is the default angular preset included by default with semantic-release or an alternative you have opted into

travi avatar Aug 02 '24 21:08 travi