Add release branching and cherry picking process#669
Conversation
WalkthroughAdds an automated release-branch creation workflow triggered by version tags, updates release-drafter to filter by commitish and include release branches, adds a cherry-pick automation script with documentation, and updates site navigation/sidebar entries. Changes
Sequence Diagram(s)sequenceDiagram
actor Developer
participant Git
participant GitHub
participant Actions as "GitHub Actions"
participant Origin as "Origin (remote)"
Developer->>Git: Push tag vX.Y.Z
Git->>GitHub: Push tag
GitHub->>Actions: Trigger workflow on tag
Actions->>Actions: Extract tag, derive release branch name
Actions->>Origin: Create & push release-vX.Y branch
Origin->>GitHub: New branch available
GitHub-->>Developer: Release branch created
sequenceDiagram
actor Developer
participant Script as "hack/cherry-pick.sh"
participant Git as "git"
participant GH as "gh (GitHub CLI)"
participant Origin as "Origin (remote)"
participant GitHub as "GitHub"
Developer->>Script: ./hack/cherry-pick.sh <PR#> release-vX.Y
Script->>Git: Verify working tree clean & fetch
Script->>GH: Query PR merge commit and title
GH-->>Script: Return commit hash & title
Script->>Git: Create cherry-pick branch from origin/release
Script->>Git: git cherry-pick -m1 <commit>
alt conflicts
Script-->>Developer: Prompt to resolve conflicts and continue
Developer->>Git: Resolve conflicts and git cherry-pick --continue
end
Script->>Origin: Push cherry-pick branch
Script->>GitHub: Open PR via gh
GitHub-->>Developer: PR opened targeting release branch
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/release-drafter.yml:
- Around line 28-29: In the workflow for release-drafter/release-drafter@v6
remove the invalid input filter-by-commitish and keep only commitish: ${{
github.ref_name }}, then add filter-by-commitish: true to the release-drafter
configuration file (the .release-drafter.yml config used by release-drafter) so
the filter-by-commitish key is defined in the config (not the workflow) to
enable branch-target filtering.
🧹 Nitpick comments (2)
hack/cherry-pick.sh (2)
60-64: Re-running the script after a failure will fail atgit switch -cif the local branch already exists.If a previous attempt partially completed (e.g., conflicts), the user resolves and retries from scratch,
git switch -cwill refuse to create the branch. Consider either deleting the existing local branch first or switching togit switch -C(force-create).Proposed fix
-git switch -c "${CHERRY_PICK_BRANCH}" "origin/${RELEASE_BRANCH}" +git switch -C "${CHERRY_PICK_BRANCH}" "origin/${RELEASE_BRANCH}"
45-52: Two separateghAPI calls could be combined into one.Minor optimization — both
mergeCommit.oidandtitlecan be fetched in a singlegh pr viewcall.Proposed optimization
-MERGE_COMMIT=$(gh pr view "${PR_NUMBER}" --json mergeCommit --jq '.mergeCommit.oid') -if [[ -z "${MERGE_COMMIT}" ]]; then - echo "Error: PR #${PR_NUMBER} has no merge commit. Is it merged?" - exit 1 -fi - -PR_TITLE=$(gh pr view "${PR_NUMBER}" --json title --jq '.title') +PR_DATA=$(gh pr view "${PR_NUMBER}" --json mergeCommit,title) +MERGE_COMMIT=$(echo "${PR_DATA}" | jq -r '.mergeCommit.oid') +if [[ -z "${MERGE_COMMIT}" || "${MERGE_COMMIT}" == "null" ]]; then + echo "Error: PR #${PR_NUMBER} has no merge commit. Is it merged?" + exit 1 +fi +PR_TITLE=$(echo "${PR_DATA}" | jq -r '.title')Note: this adds a
jqdependency, so the simpler two-call approach is also fine.
2a0f0b4 to
b086eda
Compare
Summary by CodeRabbit
New Features
Documentation
Chores