semantic-release / semantic-release/commit-analyzer

Exclamation mark (!) after type/scope completely ignores commit

Open
#759 13 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

released on @beta
Dominant language
JavaScript
Stars
448
Forks
82
Avg merge
17h 41m
Merged PRs (30d)
4

Description

I'm using the following config:

module.exports = {
  branches: ['master', 'test_commit'],
  repositoryUrl:
    'ssh://git@*********',
  plugins: [
    [
      '@semantic-release/commit-analyzer',
      {
        preset: 'conventionalcommits'
      }
    ],
    '@semantic-release/release-notes-generator',
    '@semantic-release/changelog',
    '@semantic-release/npm',
    [
      '@semantic-release/git',
      {
        message:
          'chore(release): [XX-000] ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
      }
    ]
  ]
};

This seems to work normally when committing feat: or fix: to trigger minor or patch versions, but when the commit message includes ! after scope it is completely ignored. This is the results of the analysis running on my machine with -d (dryrun)

[12:17:21 PM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat!: add new feature
  semantic-release:commit-analyzer Analyzing with default rules +0ms
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: should trigger mnr
  semantic-release:commit-analyzer Analyzing with default rules +1ms
  semantic-release:commit-analyzer The rule { type: 'feat', release: 'minor' } match commit with release type 'minor' +0ms
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is minor
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat!: should trigger mjr
  semantic-release:commit-analyzer Analyzing with default rules +0ms
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat!: [XX-1234] Commit test
  semantic-release:commit-analyzer Analyzing with default rules +1ms
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[12:17:21 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 4 commits complete: minor release
[12:17:21 PM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[12:17:21 PM] [semantic-release] › ℹ  The next release version is 4.1.0

As you can see above all the commits with feat!: give: The commit should not trigger a release

I'm running with --debug and I see that my config is loaded normally:

 semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: { preset: 'conventionalcommits' } +0ms
[12:17:12 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"

Adding BREAKING CHANGES: <desc> footer is respected normally.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in @semantic-release/commit-analyzer with the conventionalcommits preset and the feat!: examples shown in the report. Compare that parsing path with the BREAKING CHANGES footer behavior; done means a commit using ! after the type or scope triggers the expected major release and the existing analysis output is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
release
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.