Summary
Cherry-pick PRs currently lose the original author's identity in label-triggered flows and cannot be assigned to the original PR author.
Problem / Motivation
When cherry-pick PRs are created, they have two issues:
-
Missing author attribution in label-triggered cherry-picks: When a cherry-pick is triggered by a cherry-pick-<branch> label (applied before the original PR is merged), the PR description says requested-by by target-branch label. This loses the identity of who opened the original PR.
-
PR ownership: Cherry-pick PRs are always created as the bot user (whoever owns the GitHub token). There's no way to assign the cherry-pick PR to the original PR author.
Requirements
- When cherry-pick is triggered by label (on merge), the description should say
requested-by by <original-pr-user> with target-branch label instead of requested-by by target-branch label
- Add a new config option
cherry-pick-assign-to-pr-author (boolean, default: false) at both global and per-repository level
- When enabled, the cherry-pick PR should be assigned to the original PR author using hub's
-a flag
Deliverables
Notes
The cherry-pick flow has two trigger paths:
- Comment-triggered (
/cherry-pick <branch>): Already knows the commenter's username
- Label-triggered (
cherry-pick-<branch> label on merge): Currently loses the original PR author identity