Enrich checkpoint cli_version with tag and dirty state#1275
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an Entire-Version git trailer to committed checkpoints on entire/checkpoints/v1 so each checkpoint commit message records the CLI build version that created it. It introduces version formatting that preserves release/nightly versions verbatim while augmenting local dev builds with the short commit digest.
Changes:
- Added
versioninfo.FormatVersionandversioninfo.CheckpointVersionhelpers for checkpoint provenance version strings. - Introduced
trailers.VersionTrailerKey(Entire-Version) and appended it to committed checkpoint commit messages. - Added unit tests for version formatting and extended committed checkpoint tests to assert the new trailer is present.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/versioninfo/versioninfo.go | Adds version formatting helpers and a checkpoint-focused accessor. |
| cmd/entire/cli/versioninfo/versioninfo_test.go | Adds unit coverage for FormatVersion. |
| cmd/entire/cli/trailers/trailers.go | Defines the new Entire-Version trailer key constant. |
| cmd/entire/cli/checkpoint/committed.go | Writes Entire-Version trailer into committed checkpoint commit messages. |
| cmd/entire/cli/checkpoint/checkpoint_test.go | Verifies the committed checkpoint commit message includes the new version trailer. |
|
@pjbgf why as a trailer and not in metadata.json? |
|
@Soph fair point, we already have a version field in the metadata.json. Let me just amend that to ensure we have some sort of version/hash for dev versions instead. |
Pivot away from a separate Entire-Version commit trailer: the build identity already lives in metadata.json's cli_version on entire/checkpoints/v1, so enrich that field instead of duplicating it in the commit message. versioninfo.CheckpointVersion() now mirrors Go's pseudo-version scheme via runtime/debug.ReadBuildInfo(): release/nightly/mise builds keep their ldflags Version and gain a "+dirty" marker when vcs.modified was set at build time; plain `go build` binaries fall back to the embedded module pseudo-version (e.g. "v0.6.3-...-15d80761c74b+dirty"), which already carries the last known tag, the originating commit, and the dirty marker. Assisted-by: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Paulo Gomes <paulo@entire.io> Entire-Checkpoint: 9f2af0703975
Entire-Version trailer to committed checkpointscli_version with tag and dirty state
Entire-Checkpoint: a643cc5a26d4
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ca2c1cf. Configure here.
|
Note to self: test with #1273 before merging. |
|
Ah, i just saw this – i feel like #1273 probably already does what you need? |
https://entire.io/gh/entireio/cli/trails/432
Enrich metadata.json's
cli_versionfield with version + dirty information.versioninfo.CheckpointVersion()now mirrors Go's pseudo-version schemevia
runtime/debug.ReadBuildInfo():release/nightly/misebuilds keep theirldflags Version and gain a "+dirty" marker when
vcs.modifiedwas set atbuild time; plain
go buildbinaries fall back to the embedded modulepseudo-version(e.g.v0.6.3-...-15d80761c74b+dirty), which alreadycarries the last known tag, the originating commit, and the dirty marker.
Note
Low Risk
Metadata field format change only; no auth or runtime behavior changes beyond richer version strings on new checkpoints.
Overview
Checkpoint metadata now records a richer
cli_versionviaversioninfo.CheckpointVersion()instead of the plain ldflagsVersion.WriteCommittedsetsCLIVersionon both rootCheckpointSummaryand per-sessionCommittedMetadatausing that helper. Stamped release/nightly/mise builds keep their ldflags version and append+dirtywhenvcs.modifiedwas true at build time; localgo buildbinaries withVersion == "dev"fall back to the Go toolchain’s embedded module pseudo-version (tag, commit, dirty state).versioninfoaddsdescribe,readBuildInfo, and table-drivenTestDescribe. Checkpoint tests assertCheckpointVersion()in agent and CLI-version coverage.fetch_no_config_pollution_testdrops an unusedcheckpointimport and usesv2CheckpointFixtureOptionsfor the export fixture.Reviewed by Cursor Bugbot for commit ca2c1cf. Configure here.