fix(ci): lint individual commits on PRs to catch invalid prefixes early#2514
fix(ci): lint individual commits on PRs to catch invalid prefixes early#2514ralphbean wants to merge 1 commit into
Conversation
The merge queue uses merge (not squash), so individual commit messages matter. Previously, commit-lint only checked the PR title on pull_request events and deferred per-commit linting to merge_group. This meant invalid prefixes (like `style`) only surfaced when the merge queue rejected the PR — too late for contributors to fix easily. Now commit-lint checks individual commits on pull_request events too, giving early feedback before the merge queue. Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
PR Summary by QodoFix CI commit-lint to lint individual PR commits early Description
Diagram
High-Level Assessment
Files changed (1)
|
Site previewPreview: https://532634e8-site.fullsend-ai.workers.dev Commit: |
Code Review by Qodo
1. Silent rev-list failure
|
|
🤖 Finished Review · ✅ Success · Started 4:03 PM UTC · Completed 4:16 PM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsHigh
Low
Labels: PR modifies CI workflow (.github/workflows/lint.yml) |
| MQ_BASE: ${{ github.event.merge_group.base_sha }} | ||
| MQ_HEAD: ${{ github.event.merge_group.head_sha }} | ||
| PR_BASE: ${{ github.event.pull_request.base.sha }} | ||
| PR_HEAD: ${{ github.event.pull_request.head.sha }} |
There was a problem hiding this comment.
[low] edge-case
The pull_request range uses github.event.pull_request.base.sha..github.event.pull_request.head.sha. The base SHA is the tip of the target branch at event time, not the merge-base. If main has diverged significantly from the PR fork point, git rev-list --no-merges could include commits the author did not write, leading to spurious lint failures. Unlikely in practice with typical PR workflows.
Summary
pull_requestevents, deferring per-commit linting tomerge_groupstyleon PR docs(security): add audit log integrity to threat model #2010) only surfaced when the merge queue rejected the PR — too late for contributors to fix easilypull_requestevents too, giving early feedbackTest plan
fix(ci):prefix)style) — commit-lint should fail on the PR, not wait for the merge queue