Check if GitHub PRs have been cherry-picked to release branches
Project description
cherry-pick-check
A CLI tool to check if GitHub PRs have been cherry-picked to release branches.
Features
- Query PRs by a specific user in a repository
- Auto-detect release branches (e.g.,
2.5,2.6) - Detect cherry-pick status for each target branch
- Display results in a formatted table with clickable links
- Support GitHub CLI and environment variable authentication
Installation
Prerequisites
- Python 3.10+
- uv package manager
Install
# Clone the repository
git clone https://github.com/your-username/cherry-pick-check.git
cd cherry-pick-check
# Create virtual environment
uv venv -p 3.10
source .venv/bin/activate
# Install the project
uv pip install -e .
Authentication
Configure GitHub authentication using one of the following methods:
Method 1: GitHub CLI (Recommended)
# Install GitHub CLI
# macOS
brew install gh
# Ubuntu
sudo apt install gh
# Login
gh auth login
Method 2: Environment Variable
- Go to https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Select scopes:
repo(private repos) orpublic_repo(public repos) - Set the environment variable:
export GITHUB_TOKEN=your_token_here
Usage
Basic Usage
# Check user's PRs from the last 30 days
cherry-pick-check <username>
Common Options
# Specify repository and source branch
cherry-pick-check zhuwenxing -r milvus-io/milvus -b master
# Specify target branches (can be used multiple times)
cherry-pick-check zhuwenxing -t 2.6
# Specify start date
cherry-pick-check zhuwenxing -t 2.6 --since 2025-10-01
# Include all release branches (including patch versions like 2.6.1)
cherry-pick-check zhuwenxing --all-branches
# Show verbose output
cherry-pick-check zhuwenxing -v
Full Options Reference
| Option | Short | Description | Default |
|---|---|---|---|
USERNAME |
- | GitHub username (required) | - |
--repo |
-r |
Repository in owner/repo format |
milvus-io/milvus |
--branch |
-b |
Source branch | master |
--target |
-t |
Target branch (can specify multiple) | Auto-detect |
--since |
- | Start date in YYYY-MM-DD format |
30 days ago |
--all-branches |
- | Include all release branches | No |
--verbose |
-v |
Show verbose output | No |
--version |
- | Show version | - |
Output
The tool displays a table with the following columns:
| Column | Description |
|---|---|
| PR # | PR number (clickable link) |
| Title | PR title |
| Status | PR state: open (yellow) / merged (green) |
| Created | Creation date |
| Merged | Merge date |
| 2.6, 2.5... | Cherry-pick status for each target branch |
Cherry-pick status indicators:
#45453(green) - Merged cherry-pick PR#45800 (open)(yellow) - Open cherry-pick PRx(red) - Not cherry-picked
Example Output
$ cherry-pick-check zhuwenxing -t 2.6 --since 2025-10-01
Repo: milvus-io/milvus
User: zhuwenxing
Branch: master
Since: 2025-10-01
Found: 14 PRs (1 open, 13 merged)
Cherry-Pick Status
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ PR # ┃ Title ┃ Status ┃ Created ┃ Merged ┃ 2.6 ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ #45624 │ test: add cdc e2e │ open │ 11-17 │ - │ x │
│ │ testcases │ │ │ │ │
├────────┼─────────────────────────┼────────┼─────────┼────────┼───────────────┤
│ #45901 │ test: refactor │ merged │ 11-27 │ 11-27 │ x │
│ │ connection method... │ │ │ │ │
├────────┼─────────────────────────┼────────┼─────────┼────────┼───────────────┤
│ #45524 │ test: refactor checker │ merged │ 11-12 │ 11-20 │ #45800 (open) │
│ │ to using ... │ │ │ │ │
├────────┼─────────────────────────┼────────┼─────────┼────────┼───────────────┤
│ #45309 │ test: add struct array │ merged │ 11-05 │ 11-10 │ #45453 │
│ │ mmap tes... │ │ │ │ │
├────────┼─────────────────────────┼────────┼─────────┼────────┼───────────────┤
│ #45189 │ test: add json dumps │ merged │ 10-31 │ 11-03 │ #45219 │
│ │ for json st... │ │ │ │ │
├────────┼─────────────────────────┼────────┼─────────┼────────┼───────────────┤
│ #44940 │ test: add struct array │ merged │ 10-17 │ 10-20 │ #44973 │
│ │ testcases │ │ │ │ │
└────────┴─────────────────────────┴────────┴─────────┴────────┴───────────────┘
Summary: 14 PRs (1 open, 13 merged) across 1 branches
Cherry-picked: 5 merged, 3 open, 6 not picked
How Detection Works
The tool searches for PRs that reference the source PR in their body. Supported formats:
Cherry-pick from master\npr: #45309pr: https://github.com/milvus-io/milvus/pull/45309backport #45309also pick pr: #45309
This is compatible with the milvus-io/milvus cherry-pick workflow.
FAQ
1. Authentication Error
Make sure you have configured GitHub authentication. See Authentication.
2. Rate Limit Error
GitHub API has rate limits. The tool will auto-wait (up to 2 minutes), or you can retry later.
3. No Release Branches Detected
If your repository doesn't use standard version naming (e.g., 2.5, 2.6), use -t to manually specify target branches.
4. Cherry-pick PR Not Detected
Make sure the cherry-pick PR body contains a reference to the source PR. See How Detection Works.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cherry_pick_check-0.1.0.tar.gz.
File metadata
- Download URL: cherry_pick_check-0.1.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed6551d1003419a3de5c180a73beefeac348803cc1c196a6cddceefea1484566
|
|
| MD5 |
f094a8d5bdf41f8ccceaae2ffed9cfea
|
|
| BLAKE2b-256 |
0a7ddffaf691a00f0715689f6d280c8c67743a5495e3865466aa0017aa9ab3dc
|
Provenance
The following attestation bundles were made for cherry_pick_check-0.1.0.tar.gz:
Publisher:
release.yml on zhuwenxing/cherry-pick-check
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cherry_pick_check-0.1.0.tar.gz -
Subject digest:
ed6551d1003419a3de5c180a73beefeac348803cc1c196a6cddceefea1484566 - Sigstore transparency entry: 730435279
- Sigstore integration time:
-
Permalink:
zhuwenxing/cherry-pick-check@e476fc3506f496bebd5cb7ca66a867a6dfb5a964 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zhuwenxing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e476fc3506f496bebd5cb7ca66a867a6dfb5a964 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cherry_pick_check-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cherry_pick_check-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
327882525dd9ddfe09981acf495e632de1b3e9ce215965b0c9b0bda078428610
|
|
| MD5 |
d72ab035b959833ddb3c1ab95376effd
|
|
| BLAKE2b-256 |
8736d4f0256b091dcb25cfd5caeaedc96c3ca50f7ef1de627ef45c08f561928d
|
Provenance
The following attestation bundles were made for cherry_pick_check-0.1.0-py3-none-any.whl:
Publisher:
release.yml on zhuwenxing/cherry-pick-check
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cherry_pick_check-0.1.0-py3-none-any.whl -
Subject digest:
327882525dd9ddfe09981acf495e632de1b3e9ce215965b0c9b0bda078428610 - Sigstore transparency entry: 730435281
- Sigstore integration time:
-
Permalink:
zhuwenxing/cherry-pick-check@e476fc3506f496bebd5cb7ca66a867a6dfb5a964 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zhuwenxing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e476fc3506f496bebd5cb7ca66a867a6dfb5a964 -
Trigger Event:
release
-
Statement type: