Skip to content

feat(release): add create-release-branch command#4587

Open
radTuti wants to merge 4 commits intotigera:masterfrom
radTuti:maestro-v0-create-release-branch
Open

feat(release): add create-release-branch command#4587
radTuti wants to merge 4 commits intotigera:masterfrom
radTuti:maestro-v0-create-release-branch

Conversation

@radTuti
Copy link
Copy Markdown
Contributor

@radTuti radTuti commented Mar 24, 2026

Summary

  • Add branch subcommand and create-release-branch Makefile target to automate
    release branch creation, config updates, and dev tag tagging
  • Support branching from both master (creates dev tag for next minor) and existing
    release branches (skips dev tag)
  • Add validation: stream format, base branch check, remote ref existence (exact match),
    and branch-already-exists guard
  • Refactor shared logic between branch and prep commands (branchBeforeCommon,
    branchActionCommon, switchBranch, modifyConfigVersions, commitConfigChanges)
  • Add contextString helper to replace bare context type assertions
  • Add --skip-branch-check and --skip-validation development flags
  • Update RELEASING.md and hack/release/README.md documentation

Validation

  • Unit tests for isReleaseBranch, isValidStream, refExistsInRemote, and dev tag
    version arithmetic (hack/release/branch_test.go)
  • Manual: make create-release-branch STREAM=vX.Y CALICO_REF=<ref> ENTERPRISE_REF=<ref>
  • Manual: make release-prep VERSION=vX.Y.Z CALICO_VERSION=<ver> on a release branch to verify prep still works after refactor

@radTuti radTuti requested a review from a team as a code owner March 24, 2026 01:39
@radTuti radTuti requested review from a team and Copilot March 24, 2026 01:39
@marvin-tigera marvin-tigera added this to the v1.43.0 milestone Mar 24, 2026
@radTuti radTuti force-pushed the maestro-v0-create-release-branch branch from 6009212 to bcd4ff3 Compare March 24, 2026 01:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new release branch subcommand (and make create-release-branch target) to automate release-branch creation, while refactoring release prep to reuse the shared branch/config/commit logic.

Changes:

  • Add release branch command to create a release branch, update version configs, commit, tag, and optionally push.
  • Refactor release prep to share common branch creation + config update logic via shared helpers.
  • Add new flags (--stream, --calico-ref, --enterprise-ref) and update release documentation.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
hack/release/branch.go New command + shared helpers for branching/config updates/commit/tag/push.
hack/release/prep.go Refactors prep to reuse shared branch/config/commit logic and uses shared cleanup.
hack/release/main.go Registers the new branch command with the CLI.
hack/release/flags.go Adds new flags for stream and component refs/prefix.
hack/release/checks.go Adds shared validation helpers for prep/branch.
hack/release/README.md Documents the new release branch command and Makefile target.
RELEASING.md Updates the release-branch preparation process docs to point at the new automation.
Makefile Adds create-release-branch target.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@radTuti radTuti force-pushed the maestro-v0-create-release-branch branch from bcd4ff3 to 2b1aeaa Compare March 24, 2026 15:27
@radTuti radTuti force-pushed the maestro-v0-create-release-branch branch from 2b1aeaa to 562ab74 Compare March 24, 2026 23:02
radTuti added 2 commits March 25, 2026 08:45
Enhance validateBranchRefs to check that the operator branch doesn't
already exist in the remote and that calico/enterprise refs exist as
branches or tags. Similarly enhance validatePrepRefs to verify version
tags exist in their respective remote repositories. Move validation
logic from prepBefore into validatePrepRefs for consistency.
Support branching from both master and release branches. Add
isReleaseBranch validation, skip-branch-check flag, and dev tag
creation only when branching from non-release branches. Consolidate
development flags under a shared category and fix error message
conventions.
@radTuti radTuti force-pushed the maestro-v0-create-release-branch branch from f28aa08 to cd28b20 Compare March 28, 2026 00:10
- Add unit tests for isReleaseBranch, dev tag version logic,
  stream format validation, and refExistsInRemote
- Replace bare context type assertions with contextString helper
  to produce clear errors instead of panics
- Use regexp.QuoteMeta on release branch prefix to prevent regex
  injection from custom prefixes
- Add stream format validation (vX.Y) in validateBranchRefs
- Fix ls-remote substring matching: parse output lines and match
  exact ref names instead of using strings.Contains
@radTuti radTuti force-pushed the maestro-v0-create-release-branch branch from 2019bcd to 3858f49 Compare March 28, 2026 01:38
@radTuti radTuti changed the title feat(release): add create-release-branch target feat(release): add create-release-branch command Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants