fix: Correct calculation of commits for changelog for release workflows#1971
Conversation
…mine the correct range of commits for the changelog. On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughComputes the previous non-RC release tag, derives a changelog range, exports it from the release-versioning script, adds tests for the helper, and threads the changelog_range through the release-candidate workflow into git-cliff. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
piotrjanik
left a comment
There was a problem hiding this comment.
LGTM, one corner case to check
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
I added a semver check and a test for your mentioned case. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/scripts/release-versioning.js:
- Around line 256-267: findPreviousTag currently picks the highest stable tag
without ensuring it is older than newTag; update findPreviousTag to first parse
newTag via parseVersion and filter tags to only those stable tags whose semantic
version is strictly less than newTag's version (compare major, minor, patch
arrays element-wise using parseVersion results) before sorting and returning the
top candidate; reference parseVersion, newTag, and findPreviousTag in your
change so the comparison logic ensures returned tag is actually previous to
newTag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9a67ed05-6dba-494b-8374-d59d2953a2f8
📒 Files selected for processing (2)
.github/scripts/release-versioning.js.github/scripts/release-versioning.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/scripts/release-versioning.test.js
…t-cliff On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
just a nit - while checking your tests I was confused that RCs are not included. While the docs way "...stable semver..." I only made the connection after reading it again. |
matthiasbruns
left a comment
There was a problem hiding this comment.
ignore my nit - I do not want to block because of nits
…ws (open-component-model#1971) On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Add new function to calculate the latest previous non-RC tag to determine the correct range of commits for the changelog. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Improved release versioning to compute and expose the previous release tag and a concrete changelog range for release-candidate flows, pass that range into the changelog generator, and surface these values in step summaries and workflow outputs (first-release behavior preserved). * **Tests** * Added comprehensive tests covering prior-release detection, RC and edge-case scenarios to ensure correct changelog-range behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) gerald.morrison@sap.com
What this PR does / why we need it
Add new function to calculate the latest previous non-RC tag to determine the correct range of commits for the changelog.
Summary by CodeRabbit