Skip to content

feat: Cherry-pick PR author attribution and optional assignee #993

@rnetser

Description

@rnetser

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:

  1. 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.

  2. 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

  1. 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
  2. Add a new config option cherry-pick-assign-to-pr-author (boolean, default: false) at both global and per-repository level
  3. When enabled, the cherry-pick PR should be assigned to the original PR author using hub's -a flag

Deliverables

  • Update cherry_pick() method in runner_handler.py to accept by_label flag and use original PR user
  • Update pull_request_handler.py to pass original PR user when calling cherry_pick() from label path
  • Add cherry-pick-assign-to-pr-author config option to schema.yaml (global + per-repo)
  • Add config reading in github_api.py
  • Implement assignee logic in cherry_pick() hub command
  • Update tests
  • Update examples/config if needed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions