OCM-12992 | chore: set git-cliff for handling changelog update#1075
OCM-12992 | chore: set git-cliff for handling changelog update#1075amandahla wants to merge 1 commit intoterraform-redhat:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest-required |
|
/jira refresh |
|
@amandahla: No Jira issue is referenced in the title of this pull request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@amandahla: This pull request references OCM-12992 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira cherrypick OCM-12992 |
|
@amandahla: Ignoring requests to cherry-pick non-bug issues: OCM-12992 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@amandahla: No Jira issue is referenced in the title of this pull request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
1 similar comment
|
/retest-required |
71331aa to
7378b5f
Compare
|
My concern is the per-PR overhead: contributors now need local Can we simplify this to a release-owner-only step (run once per release) and keep a single |
As we discussed, we are changing the goal of this task to automate changelog creation only during the release process, without adding new steps for contributors. I will validate how to use the tool git-cliff in our project to achieve that. |
7378b5f to
b5ed192
Compare
|
/retest |
72f3c4c to
ac1c8aa
Compare
70fc04b to
44a3cc7
Compare
b8da85e to
0b8e287
Compare
|
|
||
| # Preprocessors to transform commit messages from our format to parseable format | ||
| # Transform: "OCM-12345 | feat: add feature" -> "feat: add feature" | ||
| # This allows commit_parsers to match on type while preserving the message |
There was a problem hiding this comment.
with the current parser/template setup, git-cliff can still skip valid Jira-formatted commits (OCM-XXXX | feat/fix/docs: ...) as “does not belong to any group”, which can silently drop user-facing entries from the generated changelog.
Could we harden commit_parsers so they match both Jira-prefixed and plain conventional commit forms directly (instead of relying only on preprocessing)?
There was a problem hiding this comment.
Good point. I updated the config to capture the maximum number of commits from the full history.
My changes:
- Show only the first line of each commit in the changelog (hide body/footer).
- Strip OCM-NNNN: and OCM-NNNN | prefixes from messages.
- Remove Signed-off-by: ... <...> lines from messages.
- Skip commits that mention “konflux” or “changelog” (case-insensitive).
- Skip single-word commit messages (e.g. “F”, “Init”).
- Skip commits with message “Update README.md”.
- Add fallback parsers for non-conventional messages: “fix” and “documentation” (case-insensitive) for grouping.
- Add catch-all parser so unmatched commits go to “Other” under ENHANCEMENTS.
There was a problem hiding this comment.
I re-ran the latest config and still found one edge case: because fix is unanchored, a docs message like docs: add prefix ... is still matched as Bug fixes (because of prefix).
Would you be open to anchoring the fix parser (for example ^fix(\(|:|\b)), and keeping broad fallback rules at the very end? I think that would keep grouping safer without losing coverage.
There was a problem hiding this comment.
Good catch. I changed the regex to (?i)(^|.*\s)fix(\s|:) so will be more strict to catch only starting with fix or the word fix (case insensitive) and moved the documentation to be before the "fix" parser.
1e6bf2f to
0b570fc
Compare
|
/retest |
0b570fc to
58b7437
Compare
58b7437 to
f4df26a
Compare
| # <!-- 1 --> entries are used to force an order | ||
| # Setting scope as a way to create subcategories | ||
| { message = "^feat", group = "<!-- 1 -->FEATURES", default_scope="Ignore scope"}, | ||
| { message = "fix", group = "<!-- 2 -->ENHANCEMENTS", default_scope="Bug fixes"}, |
There was a problem hiding this comment.
as parsers are first-match wins, because of that, messages containing fix inside another word (like prefix) can still land in Bug fixes. Could we also anchor that main fix parser, for example:
{ message = "(?i)^fix(\\(|:|\\b)", group = "<!-- 2 -->ENHANCEMENTS", default_scope = "Bug fixes" }
(and keep your broader fallback at the end)?
That should keep the same coverage while avoiding false positives.
PR Summary
Actions:
See an example here:
amandahla/test-actions#14
GitHub Repository Settings Requirements
What commits will be considered
Detailed Description of the Issue
We need an automated way of updating CHANGELOG during the release process.
What this PR changes
Add a GitHub workflow for automatically submitting a PR that updates CHANGELOG file in main branch.
Related Issues and PRs
Type of Change
Previous Behavior
Behavior After This Change
GitHub workflow automatically updates the changelog file by submitting a PR.
How to Test (Step-by-Step)
Preconditions
N/A
Test Steps
N/A
Expected Results
Proof of the Fix
N/A
Breaking Changes
Breaking Change Details / Migration Plan
N/A
Developer Verification Checklist
[JIRA-TICKET] | [TYPE]: <MESSAGE>.make testpasses.make fmtpasses.make buildpasses.