Summary
Replace the deprecated hub CLI with GitHub's official gh CLI for cherry-pick PR creation in the webhook server.
Problem / Motivation
The cherry-pick flow in runner_handler.py uses the hub CLI (v2.14.2) to create pull requests. hub is an archived/deprecated project (last release 2020) maintained by mislav. GitHub's official CLI gh is the modern replacement and is actively maintained.
Current Usage
hub is used in exactly one place — webhook_server/libs/handlers/runner_handler.py (lines 717, 725-729):
hub_cmd = f"GITHUB_TOKEN={github_token} hub --work-tree={worktree_path} --git-dir={worktree_path}/.git"
# ...
f'bash -c "{hub_cmd} pull-request -b {target_branch} -h {new_branch_name} -l {CHERRY_PICKED_LABEL} {assignee_flag} -m \'...\' -m \'...\'"'
hub is installed in the Dockerfile (lines 75-76) via a manual download from GitHub releases.
Proposed Changes
1. Replace hub command with gh equivalent
| hub flag |
gh equivalent |
Purpose |
-b <branch> |
--base <branch> |
Base branch |
-h <branch> |
--head <branch> |
Head branch |
-l <label> |
--label <label> |
Add label |
-a <user> |
--assignee <user> |
Assign user |
-m <title> |
--title <title> |
PR title |
-m <body> (2nd) |
--body <body> |
PR description |
2. Update Dockerfile
- Remove hub installation (lines 75-76)
- Add
gh CLI installation
3. Update authentication
hub uses GITHUB_TOKEN env var
gh uses GH_TOKEN or GITHUB_TOKEN env var (both work), or gh auth login
Requirements
- Replace
hub pull-request command with gh pr create in runner_handler.py
- Update Dockerfile to remove hub and add gh CLI
- Update tests for the cherry-pick flow
- Verify authentication works with gh CLI
Deliverables
Notes
This is a prerequisite for #1022 (AI-powered conflict resolution for auto cherry-pick), which will significantly modify the cherry-pick method.
Summary
Replace the deprecated
hubCLI with GitHub's officialghCLI for cherry-pick PR creation in the webhook server.Problem / Motivation
The cherry-pick flow in
runner_handler.pyuses thehubCLI (v2.14.2) to create pull requests.hubis an archived/deprecated project (last release 2020) maintained by mislav. GitHub's official CLIghis the modern replacement and is actively maintained.Current Usage
hubis used in exactly one place —webhook_server/libs/handlers/runner_handler.py(lines 717, 725-729):hubis installed in theDockerfile(lines 75-76) via a manual download from GitHub releases.Proposed Changes
1. Replace hub command with gh equivalent
-b <branch>--base <branch>-h <branch>--head <branch>-l <label>--label <label>-a <user>--assignee <user>-m <title>--title <title>-m <body>(2nd)--body <body>2. Update Dockerfile
ghCLI installation3. Update authentication
hubusesGITHUB_TOKENenv varghusesGH_TOKENorGITHUB_TOKENenv var (both work), orgh auth loginRequirements
hub pull-requestcommand withgh pr createinrunner_handler.pyDeliverables
hub pull-requestwithgh pr createinrunner_handler.pyNotes
This is a prerequisite for #1022 (AI-powered conflict resolution for auto cherry-pick), which will significantly modify the cherry-pick method.