| name | fix-cherry-pick-pr |
| description | Repair cherry-pick pull requests in tikv/pd when automated cherry-picks leave committed conflict markers, drift from the source PR, or need parity verification against the original PR. Use when given a source PD PR and its cherry-pick PR, or a cherry-pick PR that references an original PR, and asked to compare diffs, resolve release-branch cherry-pick conflicts, run failpoint-aware verification, and push the fixed cherry-pick branch. |
Fix Cherry-Pick PR
Overview
Repair and verify cherry-pick PRs in tikv/pd.
Compare the source PR and the cherry-pick PR first, then fix the cherry-pick branch without losing release-branch-only code.
1. Identify the PR pair
- Inspect the cherry-pick PR with
gh pr view <pr> --repo tikv/pd --json number,title,body,baseRefName,headRefName,headRepositoryOwner,url,commits.
- Extract the source PR number from one of:
- a title suffix like
(#10131)
- body text like
This is an automated cherry-pick of #10131
- the head commit message when the body is ambiguous
- Read the linked issue if present to confirm the real bug and expected behavior.
- Treat GitHub
mergeable status as insufficient. A PR can be mergeable while still containing committed conflict markers in the patch.
2. Compare source and cherry-pick diffs before editing
- Compare changed files first:
gh pr diff <source-pr> --repo tikv/pd --name-only
gh pr diff <cherry-pick-pr> --repo tikv/pd --name-only
- Compare the final aggregate diff, not raw commit count. Cherry-pick PRs can have extra cleanup commits.
- Normalize diff output when checking parity:
diff -u \
<(gh diff <source-pr> --repo tikv/pd | awk | ) \
<(gh diff <cherry-pick-pr> --repo tikv/pd | awk | )