Skip to content

Enrich checkpoint cli_version with tag and dirty state#1275

Open
pjbgf wants to merge 2 commits into
mainfrom
checkpoint-version
Open

Enrich checkpoint cli_version with tag and dirty state#1275
pjbgf wants to merge 2 commits into
mainfrom
checkpoint-version

Conversation

@pjbgf
Copy link
Copy Markdown
Member

@pjbgf pjbgf commented May 27, 2026

https://entire.io/gh/entireio/cli/trails/432

Enrich metadata.json's cli_version field with version + dirty information.

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.


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_version via versioninfo.CheckpointVersion() instead of the plain ldflags Version.

WriteCommitted sets CLIVersion on both root CheckpointSummary and per-session CommittedMetadata using that helper. Stamped release/nightly/mise builds keep their ldflags version and append +dirty when vcs.modified was true at build time; local go build binaries with Version == "dev" fall back to the Go toolchain’s embedded module pseudo-version (tag, commit, dirty state).

versioninfo adds describe, readBuildInfo, and table-driven TestDescribe. Checkpoint tests assert CheckpointVersion() in agent and CLI-version coverage. fetch_no_config_pollution_test drops an unused checkpoint import and uses v2CheckpointFixtureOptions for the export fixture.

Reviewed by Cursor Bugbot for commit ca2c1cf. Configure here.

Copilot AI review requested due to automatic review settings May 27, 2026 11:42
@pjbgf pjbgf requested a review from a team as a code owner May 27, 2026 11:42
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 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.FormatVersion and versioninfo.CheckpointVersion helpers 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.

Comment thread cmd/entire/cli/versioninfo/versioninfo_test.go Outdated
@Soph
Copy link
Copy Markdown
Collaborator

Soph commented May 27, 2026

@pjbgf why as a trailer and not in metadata.json?

@pjbgf
Copy link
Copy Markdown
Member Author

pjbgf commented May 27, 2026

@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
@pjbgf pjbgf force-pushed the checkpoint-version branch from e59d06e to 314c4c6 Compare May 27, 2026 13:59
@pjbgf pjbgf changed the title Add Entire-Version trailer to committed checkpoints Enrich checkpoint cli_version with tag and dirty state May 27, 2026
Entire-Checkpoint: a643cc5a26d4
@pjbgf
Copy link
Copy Markdown
Member Author

pjbgf commented May 27, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ 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.

@pjbgf pjbgf enabled auto-merge May 27, 2026 15:11
@pjbgf pjbgf disabled auto-merge May 27, 2026 16:26
@pjbgf
Copy link
Copy Markdown
Member Author

pjbgf commented May 27, 2026

Note to self: test with #1273 before merging.

@toothbrush
Copy link
Copy Markdown
Contributor

Ah, i just saw this – i feel like #1273 probably already does what you need?

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants