SRVOCF-1048: Ignore Konflux bot commits in commitlint - #147
Conversation
The Konflux bot's Signed-off-by trailer exceeds 100 chars, failing the footer-max-line-length rule. Add an ignore for commits containing 'red-hat-konflux'. Also log the commit message on validation failure so users can recover their text. Issue SRVOCF-1048 Co-Authored-By: Claude <noreply@anthropic.com>
|
@twoGiants: This pull request references SRVOCF-1048 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 bug to target the "5.1.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. |
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s commit-message validation flow to reduce friction from Konflux-generated commits and to help developers recover their commit text when validation fails.
Changes:
- Adjust
commitlintignore logic to skip Konflux-related commits. - Enhance the Husky
commit-msghook to print the commit message whencommitlintfails, so the user can easily copy it back.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
commitlint.config.mjs |
Updates commitlint ignore predicate to bypass linting for Konflux-related commit messages. |
.husky/commit-msg |
Adds a helper to print the commit message on validation failure to improve recovery UX. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| logMsg() { | ||
| echo "" | ||
| echo "--- Your commit message ---" | ||
| echo "$1" | ||
| echo "---" | ||
| echo "" | ||
| } |
| ignores: [ | ||
| (message) => message.startsWith('Red Hat Konflux'), | ||
| (message) => message.includes('red-hat-konflux'), | ||
| (message) => message.startsWith('Merge commit'), |
|
/lgtm the message is echoed twice, but thats fine by me. The last one makes it more clear: [commit-msg] Validating commit message...
⧗ --- input ---
hey
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
--- Your commit message ---
hey
--- |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pmeida, twoGiants The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@twoGiants: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
Fixes SRVOCF-1048
Checklist
docs/ARCHITECTURE.md(if there are relevant changes to our layered architecture)