Skip to content

Feat/release command - #65

Open
maya-ots wants to merge 5 commits into
developfrom
feat/release-command
Open

maya-ots wants to merge 5 commits into
developfrom
feat/release-command

Conversation

@maya-ots

Copy link
Copy Markdown
Collaborator

What

Adds mctf release <version> to prepare and publish versioned releases using Git tags and conventional commit messages.

The command validates the version, requires a clean working tree on main or develop, generates categorized release notes from commits since the previous version tag, and supports --dry-run to preview the release without creating or pushing a tag.

Closes #50

How

  • Added version validation and conventional-commit release-note formatting in internal/release/notes.go.
  • Added Git history inspection in internal/release/commits.go, including support for the first release when no previous version tag exists.
  • Added the Cobra release command in cmd/release.go.
  • Rejects invalid versions, unsupported branches, dirty working trees, and existing release tags.
  • Creates an annotated version tag and pushes it to origin only after explicit confirmation.
  • --dry-run prints the generated release notes and planned tag without modifying tags or pushing.

Verification

  • go build ./...
  • go test ./internal/release
  • go test ./cmd
  • go test ./... fails in internal/kubernetes on Windows due to path separator mismatches and related test assertions
    (these failures are outside this PR's scope.)
  • golangci-lint run ./...
  • mctf generate --check on the sample event (not expected to be affected by this change)
  • Docs updated (docs/spec/, CHANGELOG) if behavior/CLI changed
  • Schema + make schemas synced (not applicable; no on-disk schema changes)

Additional manual verification:

  • mctf release --help
  • Invalid version is rejected.
  • Isolated dry-run test generates categorized release notes and creates no tag.
  • Isolated branch-protection test rejects a feature branch.
  • Isolated working-tree test rejects uncommitted changes.

Notes

  • No real release tag was created or pushed during testing.
  • A failed push leaves the annotated tag in the local repository (the command reports the failure).
  • The existing Kubernetes test failures are documented for separate investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: mctf release — tag + goreleaser + release notes from conventional commits

2 participants