Repository navigation
Semver bump by branch prefix (fix/feat/release -> patch/minor/major) - #16
Merged
Merged
Conversation
…nch-name (issue #15, ADR 0008) Replaces parse-version.js (branch name -> literal version) with next-version.js: bumpTypeFromBranch (fix/feat/release -> patch/minor/ major) + bumpVersion (latest tag + bump type -> next version). The release workflow now computes the version from the latest git tag (semver-sorted) instead of reading it out of the release/x.y.z branch name — fix/*, feat/*, and release/* can all merge directly to main, each triggering its own bump; release/* branches remain optional integration staging (unchanged from ADR 0006) but no longer need a version baked into their name. 8 TDD seams green (27/27 total). Verified locally against the real v0.0.0 tag: bin/next-version.js "0.0.0" "feat/semver-bump-by-branch-prefix" -> 0.1.0, matching this very branch's expected bump. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15
Summary
Replaces the "version is read literally from the
release/x.y.zbranchname" model (ADR 0006/#7) with automatic semver bumping, per
ADR 0008:
src/release/next-version.jsreplacesparse-version.js:bumpTypeFromBranch(branchName)—fix/*->"patch",feat/*->"minor",release/*->"major", anything else ->null.bumpVersion(currentVersion, bumpType)— latest tag + bump type ->next version string (minor resets patch to 0, major resets both).
bin/next-version.jsreplacesbin/parse-version.jsas the CLI theworkflow shells out to.
.github/workflows/release.yml: the job'sifguard now checks forfix/,feat/, orrelease/prefixes (previously onlyrelease/).The version step now reads the latest
vX.Y.Ztag (semver-sorted, notby creation date) and computes the next version from it + the merging
branch's prefix, instead of parsing the branch name itself.
fix/*andfeat/*can now merge straight intomain(not forcedthrough a
release/*staging branch) and each still triggers its ownbump.
release/*branches keep working as an optional integrationbranch for staging multiple PRs first (unchanged from ADR 0006) — that
intermediate merge never bumps anything; only the final
release/* -> mainmerge does, always as a major bump.Test plan
bumpTypeFromBranch(4cases) +
bumpVersion(4 cases). Full suite 27/27.npm run lintclean.bin/next-version.jssmoke-tested directly:"0.0.0" "feat/x"->0.1.0;"0.0.0" "docs/x"-> stderr + exit 1.v0.0.0(confirmed via
git tag --list 'v*' --sort=-v:refname), and thisbranch's own name (
feat/semver-bump-by-branch-prefix) computes to0.1.0— i.e. merging this very PR is expected to tagv0.1.0andcreate release
0.1.0, which will be the live end-to-endverification of the new workflow.