Skip to content

feat(internal/conventionalcommits): support commit override and nested commits in parsing#1776

Merged
zhumin8 merged 5 commits intomainfrom
rp-commit-override
Aug 20, 2025
Merged

feat(internal/conventionalcommits): support commit override and nested commits in parsing#1776
zhumin8 merged 5 commits intomainfrom
rp-commit-override

Conversation

@zhumin8
Copy link
Copy Markdown
Contributor

@zhumin8 zhumin8 commented Aug 18, 2025

This change moves the parsing logic to a dedicated internal/conventionalcommits package and adds support for commit overrides and nested commits.

  • Commit Override: A BEGIN_COMMIT_OVERRIDE/END_COMMIT_OVERRIDE block can be used to replace the entire commit message with the content inside the block.
  • Nested Commits: BEGIN_NESTED_COMMIT/END_NESTED_COMMIT blocks allow for multiple conventional commits to be parsed from a single commit message.

Note: an "isNested" field is added for requirement "nested commits information will only be used for release notes, and not for bumping semver", see #1769

refer to go/librarian:release-please-lite for discussions on supported/unsupported edge case scenarios.

For #1695

@zhumin8 zhumin8 force-pushed the rp-commit-override branch from 1d9d3e9 to 14909b7 Compare August 18, 2025 21:58
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 18, 2025

Codecov Report

❌ Patch coverage is 90.32258% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.43%. Comparing base (b2e2c93) to head (a5596f0).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...ternal/conventionalcommits/conventional_commits.go 89.47% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1776      +/-   ##
==========================================
+ Coverage   80.33%   81.43%   +1.10%     
==========================================
  Files          75       74       -1     
  Lines        7475     7999     +524     
==========================================
+ Hits         6005     6514     +509     
- Misses       1146     1154       +8     
- Partials      324      331       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhumin8 zhumin8 marked this pull request as ready for review August 19, 2025 15:36
@zhumin8 zhumin8 requested a review from a team as a code owner August 19, 2025 15:36
JoeWang1127
JoeWang1127 previously approved these changes Aug 19, 2025
Copy link
Copy Markdown
Contributor

@JoeWang1127 JoeWang1127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a suggestion.

@zhumin8 zhumin8 merged commit a0973af into main Aug 20, 2025
10 checks passed
@zhumin8 zhumin8 deleted the rp-commit-override branch August 20, 2025 17:52
catchyzheng pushed a commit that referenced this pull request Aug 20, 2025
…d commits in parsing (#1776)

This change moves the parsing logic to a dedicated
internal/conventionalcommits package and adds support for commit
overrides and nested commits.

- Commit Override: A BEGIN_COMMIT_OVERRIDE/END_COMMIT_OVERRIDE block can
be used to replace the entire commit message with the content inside the
block.
- Nested Commits: BEGIN_NESTED_COMMIT/END_NESTED_COMMIT blocks allow for
multiple conventional commits to be parsed from a single commit message.

Note: an "isNested" field is added for requirement "nested commits
information will only be used for release notes, and not for bumping
semver", see #1769

refer to
[go/librarian:release-please-lite](http://go/librarian:release-please-lite#heading=h.5bformyuaenc)
for discussions on supported/unsupported edge case scenarios.

For #1695
catchyzheng added a commit that referenced this pull request Aug 20, 2025
…nd nested commits in parsing (#1776)"

This reverts commit 24b98ee.
zhumin8 added a commit that referenced this pull request Aug 20, 2025
…ommits (#1769)

Add a semver package for logic to parse and increase semantic version
according to https://semver.org/, then use it to derive next version
from slices of conventional commits.

Note: according to
[go/librarian:release-command](http://goto.google.com/librarian:release-command)
and [go/librarian:commits](http://goto.google.com/librarian:commits),
nested commit information should only be used for release notes, and not
for bumping semver. This implementation simply disregard nested commit
types when determining version bumps and always do minor for them.


Note: moved conventional_commits.go to a separate package in #1776. 
TODO: Will also rename release_please_lite.go in a separate followup PR.

Additional context:
[go/librarian:release-please-lite](http://goto.google.com/librarian:release-please-lite)


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants