Skip to content

Create release branches for minor versions#159

Merged
afritzler merged 1 commit intomainfrom
chore/release-branches
Mar 3, 2026
Merged

Create release branches for minor versions#159
afritzler merged 1 commit intomainfrom
chore/release-branches

Conversation

@afritzler
Copy link
Member

@afritzler afritzler commented Mar 3, 2026

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated golangci-lint to v2.10 for improved code quality assurance
    • Updated Kubernetes testing dependencies to v1.35.0
    • Enhanced development workflow automation for release branch management and cherry-pick operations

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Walkthrough

Introduces two new automation tools for release management: a GitHub Actions workflow that creates release branches from version tags, and a Bash script for cherry-picking merged PRs into release branches. Additionally, golangci-lint is updated to v2.10 and Kubernetes test binary version is bumped to 1.35.0.

Changes

Cohort / File(s) Summary
Release Automation
.github/workflows/create-release-branch.yml, hack/cherry-pick.sh
New workflow automatically creates release branches (e.g., release-0.1) from version tags. New script enables cherry-picking merged PRs into release branches with conflict handling and PR creation.
Tool Versions
.github/workflows/lint.yml, Makefile
Golangci-lint version updated from v2.8 to v2.10 in both the GitHub Actions workflow and Makefile build configuration.
Test Dependencies
pkg/cloudprovider/metal/suite_test.go
Kubernetes binary asset version updated from 1.34.0 to 1.35.0 in test configuration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is missing entirely. The repository has a template requiring sections like 'Proposed Changes' and 'Fixes', but none were provided. Add a pull request description following the template with proposed changes, rationale, and any relevant issue references.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: introducing a GitHub Actions workflow to automatically create release branches for minor versions when tags are pushed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/release-branches

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ironcore-dev ironcore-dev deleted a comment from coderabbitai bot Mar 3, 2026
@afritzler
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
.github/workflows/create-release-branch.yml (1)

1-22: Consider handling the case where the release branch already exists.

The workflow will fail if the release branch already exists (e.g., if someone re-pushes a tag or if a branch was manually created). Consider either:

  1. Adding a check before creating the branch
  2. Using git push --force-with-lease (if overwriting is acceptable)
  3. Gracefully skipping if the branch exists

Additionally, the default checkout is a shallow clone which should work fine here since you're only creating a branch at HEAD.

💡 Optional: Add branch existence check
       - name: Create release branch
         run: |
           TAG="${GITHUB_REF#refs/tags/}"
           # Extract major.minor from tag (e.g. v0.1.0 -> release-v0.1)
           BRANCH="release-${TAG%.*}"
+          if git ls-remote --exit-code --heads origin "${BRANCH}" &>/dev/null; then
+            echo "Branch ${BRANCH} already exists, skipping creation"
+            exit 0
+          fi
           git switch -c "${BRANCH}"
           git push origin "${BRANCH}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/create-release-branch.yml around lines 1 - 22, The
workflow currently creates a new branch with BRANCH="release-${TAG%.*}" using
git switch -c and will fail if that branch already exists; update the step to
first check remote for the branch (e.g., use git ls-remote --heads origin
"${BRANCH}") and if found either skip creation (exit 0/print message) or switch
to the existing branch (git switch "${BRANCH}"), or alternatively push with safe
overwrite using git push --force-with-lease origin "${BRANCH}" depending on
desired behavior; ensure TAG/BRANCH variables and the git switch -c / git push
origin commands are updated accordingly to handle the existing-branch case
gracefully.
hack/cherry-pick.sh (1)

60-70: Consider saving and restoring the original branch.

The script switches to a new branch but doesn't return the user to their original branch after completion (or on certain failure paths). This could be surprising for users.

💡 Optional: Save and restore original branch
+# Save current branch to restore later
+ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+
 # Fetch latest remote state
 git fetch origin "${RELEASE_BRANCH}"

Then at the end (and optionally in error paths):

 echo ""
 echo "Done."
+
+# Return to original branch
+git switch "${ORIGINAL_BRANCH}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@hack/cherry-pick.sh` around lines 60 - 70, Save the current branch before
creating/switching to CHERRY_PICK_BRANCH by capturing the output of git
rev-parse --abbrev-ref HEAD (e.g., ORIGINAL_BRANCH) and add a cleanup function
that switches back to that branch; register it with trap to run on EXIT/ERR so
the script returns the user to ORIGINAL_BRANCH on success or failure, and only
attempt the switch-back if ORIGINAL_BRANCH is not the same as CHERRY_PICK_BRANCH
and is not "HEAD" (detached); update the section around the git switch -c
"origin/${RELEASE_BRANCH}" to use this saved ORIGINAL_BRANCH and ensure the
trap/cleanup is installed immediately after capturing ORIGINAL_BRANCH.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/create-release-branch.yml:
- Around line 1-22: The workflow currently creates a new branch with
BRANCH="release-${TAG%.*}" using git switch -c and will fail if that branch
already exists; update the step to first check remote for the branch (e.g., use
git ls-remote --heads origin "${BRANCH}") and if found either skip creation
(exit 0/print message) or switch to the existing branch (git switch
"${BRANCH}"), or alternatively push with safe overwrite using git push
--force-with-lease origin "${BRANCH}" depending on desired behavior; ensure
TAG/BRANCH variables and the git switch -c / git push origin commands are
updated accordingly to handle the existing-branch case gracefully.

In `@hack/cherry-pick.sh`:
- Around line 60-70: Save the current branch before creating/switching to
CHERRY_PICK_BRANCH by capturing the output of git rev-parse --abbrev-ref HEAD
(e.g., ORIGINAL_BRANCH) and add a cleanup function that switches back to that
branch; register it with trap to run on EXIT/ERR so the script returns the user
to ORIGINAL_BRANCH on success or failure, and only attempt the switch-back if
ORIGINAL_BRANCH is not the same as CHERRY_PICK_BRANCH and is not "HEAD"
(detached); update the section around the git switch -c
"origin/${RELEASE_BRANCH}" to use this saved ORIGINAL_BRANCH and ensure the
trap/cleanup is installed immediately after capturing ORIGINAL_BRANCH.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1378247 and 24f2d16.

📒 Files selected for processing (5)
  • .github/workflows/create-release-branch.yml
  • .github/workflows/lint.yml
  • Makefile
  • hack/cherry-pick.sh
  • pkg/cloudprovider/metal/suite_test.go

@afritzler afritzler merged commit ce4dbd4 into main Mar 3, 2026
12 checks passed
@afritzler afritzler deleted the chore/release-branches branch March 3, 2026 14:20
@hardikdr hardikdr added the area/metal-automation Automation processes within the Metal project. label Mar 4, 2026
@hardikdr hardikdr added this to Roadmap Mar 4, 2026
@github-project-automation github-project-automation bot moved this to Done in Roadmap Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/metal-automation Automation processes within the Metal project. chore size/L

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants