feat(version): derive a git-based build version for dev builds#105
Draft
rgao-coreweave wants to merge 1 commit into
Draft
feat(version): derive a git-based build version for dev builds#105rgao-coreweave wants to merge 1 commit into
rgao-coreweave wants to merge 1 commit into
Conversation
Builds made ahead of the release tag now report a distinguishable version. The build bakes a BUILD_VERSION into dist/version.mjs from `git describe`, using semver build metadata (the +… part, ignored for precedence): an exact clean tag stays `0.2.9`, anything ahead reads `0.2.9+8.gabc1234[.dirty]`. BUILD_VERSION flows into the surfaces that identify the running build: CLI --version/help banner, status `version`, daemon service.version, the tracer, and the plugin/agent span attributes. The clean VERSION is kept where it must match the release tag (MARKETPLACE_REF, install metadata, weave.integration.version). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
HiveMind Sessions4 sessions · 17m · $4.63
View all sessions in HiveMind → Run |
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.
Problem
Releases bump the version, tag
vX, and push in one shot, somainalways carries the last released version. A dev build offmainreports the same string as the published release (e.g.0.2.9) even when it has unreleased commits, so there's no way to tell "released 0.2.9" from "0.2.9 plus N dev commits" in the CLI or in Weave.Approach
Industry standard for distinguishing dev builds without manual bookkeeping: derive the version from
git describe. We attach it as semver build metadata (the+…part), which semver §10 defines as ignored for precedence — exactly right for "same release, plus dev provenance". The clean released string is left untouched.BUILD_VERSIONexport. Defaults toVERSION; the build (scripts/build/copy-version-module.mjs) overwrites it indist/version.mjsfromgit describe.0.2.90.2.9+8.gabc1234….dirty0.2.9BUILD_VERSIONflows into the build-identity surfaces: CLI--version/help banner,statusversion, daemonservice.version, the tracer, and thegen_ai.agent.version/weave.claude_code.plugin.versionspan attributes.VERSIONis kept where it must match the release tag:MARKETPLACE_REF, install metadata (settings.version), andweave.integration.version.renderVersionModule) now emitsBUILD_VERSIONtoo, so version bumps don't drop the export.Verification
New unit tests cover the
git describe→ build-metadata mapping (clean tag, ahead, dirty, pre-release base, bare sha, fallbacks) and the no-git fallback.npm run checkpasses (76 tests).Notes / decisions
+) vs pre-release (-): went with build metadata so dev builds don't sort below the release they're built on. Appending a pre-release to the current version (e.g.0.2.9-rc.0) would sort lower than0.2.9, making a dev build look older than its base. If you'd rather adopt the "open the next dev version" model (0.3.0-dev.0after each release), that's a small change to the release workflow instead — happy to switch.npm run dev(tsx from source, no build step) still reports the cleanVERSION; only built/installed artifacts get the derived suffix. That's the realistic dev-build path (--source=localbuilds first).🤖 Generated with Claude Code