-
Notifications
You must be signed in to change notification settings - Fork 388
ci: add auto cherry-pick workflow for backporting #3106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3106 +/- ##
=========================================
Coverage ? 46.30%
=========================================
Files ? 66
Lines ? 13923
Branches ? 0
=========================================
Hits ? 6447
Misses ? 7476
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Thanks for working on this! The auto cherry-pick workflow is a great addition, but it needs several enhancements to meet our requirements.
Required Changes:
1. ❌ Add Manual Trigger Support
Currently the workflow only triggers automatically. We need a manual trigger for retry scenarios.
Required: Add workflow_dispatch trigger with inputs:
on:
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to cherry-pick'
required: true
type: number
target_branch:
description: 'Target branch (e.g., 2.5, 2.6)'
required: true
type: string
pull_request_target:
types: [closed, labeled]2. ❌ Skip PRs with proto_gen Changes
PRs that modify the proto_gen/ directory should be skipped automatically since they require special handling.
Required: Add file checking before cherry-pick:
FILES_CHANGED=$(gh pr view $PR_NUMBER --json files -q '.files[].path')
if echo "$FILES_CHANGED" | grep -q "proto_gen/"; then
gh pr comment $PR_NUMBER --body "⚠️ **Auto Cherry-Pick Skipped**
This PR modifies \`proto_gen/\` directory. If backporting is needed, please cherry-pick manually.
Target branches: $TARGET_BRANCHES"
exit 0
fi3. ❌ Use Label-Based Approach Instead of Label Parsing
Current implementation uses labels like "... to N.x" which is fragile and only supports one target.
Required: Change to use explicit version labels:
- Use labels:
backport/2.6,backport/2.5, etc. - Support multiple target branches per PR
- Loop through all
backport/*labels
Example logic:
TARGET_VERSIONS=$(gh pr view $PR_NUMBER --json labels -q '.labels[].name | select(startswith("backport/")) | sub("backport/"; "")')
for VERSION in $TARGET_VERSIONS; do
# Find matching branch and cherry-pick
# Create separate backport PR for each version
done4. ❌ Add Success Tracking Label
Required: After successful cherry-pick, add backport/succeeded label to the original PR. Keep the backport/X.Y labels for reference (don't remove them).
5. ⚠️ Improve Author Notifications
Current implementation only comments on failure.
Required: Always notify the author with clear status:
- ✅ Success: List which branches were successfully backported
⚠️ Skipped: Proto changes detected, manual action may be needed- ❌ Failed: Conflicts detected, manual cherry-pick required
Summary of Label Design:
backport/2.6,backport/2.5→ Target release branches (can have multiple)backport/succeeded→ Added after all cherry-picks complete successfullybackport/manual→ (Optional) Flag for PRs requiring manual handling
Please update the workflow to address these requirements. Let me know if you have questions!
|
Thanks to warp's help on the review comments |
|
@jac0626 Please provide a design doc for this, because it reduces all contributors labor on cherry-pick simple PRs and requires a little bit more actions on a PR. Please add the design in the lark doc first, and add the rules in CONTRIBUTING.md |
ack |
183a735 to
cf5f185
Compare
19451f7 to
0bef340
Compare
directory pymilvus/grpc_gen ? @XuanYang-cn |
e489ae3 to
b612826
Compare
Signed-off-by: silas.jiang <silas.jiang@zilliz.com>
XuanYang-cn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jac0626, XuanYang-cn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add a GitHub Actions workflow to automatically cherry-pick merged PRs to target branches based on backport-to-* labels. Supports both automatic trigger on PR merge and manual trigger via workflow dispatch.