Skip to content

fix(ci): skip merge commits in hotfix cherry-pick provenance checker#39238

Open
sergioperezcheco wants to merge 1 commit into
langgenius:mainfrom
sergioperezcheco:fix/hotfix-cherry-pick-skip-merge-commits
Open

fix(ci): skip merge commits in hotfix cherry-pick provenance checker#39238
sergioperezcheco wants to merge 1 commit into
langgenius:mainfrom
sergioperezcheco:fix/hotfix-cherry-pick-skip-merge-commits

Conversation

@sergioperezcheco

Copy link
Copy Markdown
Contributor

The Hotfix Cherry-Pick Provenance workflow iterates every commit in the PR range via 'git rev-list --reverse', which includes merge commits. When a hotfix PR branch is synced with its base hotfix branch, the resulting merge commit has no cherry-pick provenance trailer (correctly, since it is not a cherry-pick), so the checker fails the PR even though every actual cherry-picked commit carries valid provenance.

This adds --no-merges to the rev-list so only single-parent commits are validated. Merge commits cannot reasonably carry a '(cherry picked from commit )' trailer and are not the commits the provenance rule is meant to police. The reporter reproduced this on PR #38990 where four cherry-picked commits all had valid provenance but the job failed on the sync merge commit.

Verified locally against a reproduction repo: before the change 'git rev-list --reverse BASE..HEAD' returns 4 commits (including the merge), after the change it returns 3 (only the cherry-picks), and the script still correctly flags commits that genuinely lack a source trailer.

Fixes #38996

…anggenius#38996)

The Hotfix Cherry-Pick Provenance workflow iterates every commit in the
PR range via 'git rev-list --reverse', which includes merge commits.
When a hotfix PR branch is synced with its base hotfix branch, the
resulting merge commit has no cherry-pick provenance trailer (correctly,
since it is not a cherry-pick), so the checker fails the PR even though
every actual cherry-picked commit carries valid provenance.

Pass --no-merges so only single-parent commits are validated. Merge
commits cannot reasonably carry a '(cherry picked from commit <sha>)'
trailer and are not the commits the provenance rule is meant to police.
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hotfix cherry-pick provenance checker flags merge commits as missing provenance

1 participant