Skip to content

fix(release): correct commit-analyzer releaseRules precedence - #91

Merged
ClaudiaFang merged 1 commit into
mainfrom
claude/fix-release-rules-order
Jul 31, 2026
Merged

fix(release): correct commit-analyzer releaseRules precedence#91
ClaudiaFang merged 1 commit into
mainfrom
claude/fix-release-rules-order

Conversation

@ClaudiaFang

Copy link
Copy Markdown
Member

Summary

  • Root cause of why PR chore(deps): patch transitive dev-dep vulnerabilities #87's chore(deps): ... security dependency patch never triggered a release: @semantic-release/commit-analyzer resolves releaseRules by last matching rule wins, not first match.
  • .releaserc.json listed the unscoped { type: "chore", release: false } catch-all after the scoped chore(deps) / chore(deps-dev) rules, so it silently overrode them for every chore commit.
  • Verified directly by importing @semantic-release/commit-analyzer and running it against the PR chore(deps): patch transitive dev-dep vulnerabilities #87 commit message both before and after this reorder — confirmed null before, patch after.
  • Fix: move the unscoped chore catch-all before the scoped overrides.

Verified behavior post-fix for representative commit types:

Commit Release
chore(deps): ... patch
chore(deps-dev): ... patch
chore: ... (no scope) none
chore(release): ... none
fix: ... patch
docs: ... none
feat!: ... + BREAKING CHANGE major

Once this merges, the next semantic-release run will re-analyze the still-unreleased chore(deps) commit from PR #87 with the corrected rules and should cut a 1.5.1 patch release.

Test plan

  • npx eslint . → 0 errors
  • npm run build → passes (incl. Obsidian 1.11.0 compat check)
  • npx vitest run → 494 passed (33 files)
  • Manually verified commit-analyzer output against representative commit messages before/after the fix

🤖 Generated with Claude Code

@semantic-release/commit-analyzer applies releaseRules in array order
where the LAST matching rule wins, not the first. The unscoped
{ type: chore, release: false } catch-all was listed after the scoped
chore(deps)/chore(deps-dev) rules, so it silently overrode them for
every chore commit — meaning security dependency bumps committed as
chore(deps) never actually triggered a patch release (confirmed by
running @semantic-release/commit-analyzer directly against the commit
message from PR #87 before/after this reorder).

Fix: move the unscoped chore catch-all before the scoped overrides so
last-match-wins produces the intended precedence.

Verified locally against representative commit messages:
- chore(deps): ... -> patch
- chore(deps-dev): ... -> patch
- chore: ... (no scope) -> no release
- chore(release): ... -> no release
- fix: ... -> patch
- docs: ... -> no release
- feat!: ... with BREAKING CHANGE -> major

lint: npx eslint . -> 0 errors

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@ClaudiaFang
ClaudiaFang merged commit 6b853ef into main Jul 31, 2026
17 checks passed
@ClaudiaFang
ClaudiaFang deleted the claude/fix-release-rules-order branch July 31, 2026 17:56
@ClaudiaFang

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.5.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant