GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — version: derive dev versions from git workspace state by shykes · Pull Request #13278 · dagger/dagger

Conversation

@shykes

@shykes shykes commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactor the version/ Dagger module so build-time version strings come from git workspace state instead of an ad-hoc inputs filter and .changes/.next bookkeeping.

  • derive dev versions from release tags: Stop reading .changes/.next to predict the next release. Derive the next dev-version baseline from the latest v* git tag (with patch bumped) so engine/CLI dev versions are no longer coupled to Changie release-note state. Tagged release commits still resolve to the semver tag at HEAD.
  • remove unused GitRepository constructor arg: Drop the public git *GitRepository argument from the constructor — no caller passes it; the module already derives its private GitRepository from gitParent.Directory(\".git\").AsGit().
  • add workspace git shim: Drop the inputs *Directory argument and base dirty detection on git (GitRepository.Uncommitted + digest of Uncommitted.AsPatch with metadata excluded). Introduce a small workspaceGit shim that exposes only local workspace state (HEAD, branches, uncommitted, current/latest semver tag), mirroring the shape of a future core Workspace.git API so the implementation can be swapped without changing callers. Linked git worktrees are still a limitation (contextual gitParent exposes .git as a file, not a directory); a Version-level fallback emits a digestless vX.Y.Z-<timestamp>-dev from upstream tags in that case.

Test plan

  • CI green on the three engine-dev / cli-dev / release toolchains that re-export the generated version bindings
  • Spot-check dagger version from a tagged commit, an untagged clean commit, and a dirty workspace
  • Confirm dev version string still changes when uncommitted files change, and stays stable across unrelated .changes/.next edits

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
shykes added 4 commits May 13, 2026 07:41
@shykes
version: derive dev versions from release tags
16eb3f3
The version module used .changes/.next as the predicted next release
version. That coupled build-time dev version strings to Changie release
state, so changing release-note bookkeeping could change engine and CLI dev
version computation.

Derive the next dev-version baseline from git release tags instead. Dirty
and clean untagged builds now use the latest stable v* tag with its patch
component bumped. Tagged release commits still return the semver tag that
points at HEAD.

This keeps .changes/.next out of the version module without removing the
file from the repository. Release-process cleanup can delete it separately,
without mixing that workflow change into this versioning change.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
version: remove unused GitRepository constructor arg
f140041
The version module exposed an optional git *GitRepository constructor argument, but the official build paths do not pass it. Prod traces show calls to dag.Version() receiving the contextual gitParent and inputs arguments only; the module then derives its private GitRepository from gitParent.Directory(".git").AsGit() when possible.

Keeping the public git argument made the versioning model look like it was already driven by a full contextual GitRepository. In practice, that path was dead for engine-dev, cli-dev, and release callers, and it obscured the real inputs that need to be replaced by Workspace.git().

Remove the public constructor argument while preserving the private GitRepository field and the existing gitParent-derived behavior. Regenerate the version module wrapper and dependent generated clients so the removed argument no longer appears in the module API.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
version: add workspace git shim
0f67125
The version module used a contextual inputs Directory to compute dirty dev
version digests. That input set had to maintain its own large ignore filter,
separate from the real build inputs. In practice that made the digest contract
fragile: every build-input change also required remembering to update a second
filter in the version module.

Remove the inputs argument and base dirty state on git instead. When local git
metadata is available, dirty detection now uses GitRepository.Uncommitted and
dirty dev digests use the digest of Uncommitted.AsPatch with metadata excluded.
This keeps the digest tied to the actual uncommitted patch instead of a
manually-maintained source snapshot.

Add a small internal workspaceGit shim to isolate the module from the current
GitRepository plumbing. The shim deliberately represents only local workspace
git state: HEAD, branches for the legacy ImageTag path, uncommitted changes,
the current semver tag, and the latest semver tag. This mirrors the shape we
want from a future core Workspace.git API, so swapping the implementation later
should be localized to the shim.

Linked git worktrees are still a current limitation because the contextual
gitParent input exposes .git as a file, not a directory. Preserve working dev
builds for that case with an explicit Version-level fallback: when local git
cannot be loaded, compute the next patch baseline from the upstream Dagger repo
tags and emit a digestless dirty dev version like vX.Y.Z-<timestamp>-dev. Keep
that fallback outside workspaceGit so the shim does not silently pretend that a
hardcoded upstream repository is workspace state.

Regenerate the version module bindings and the generated clients in cli-dev,
engine-dev, and release so the removed inputs constructor argument is reflected
in dependent modules.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
Re-generate (target: main)
1698317
Signed-off-by: Solomon Hykes <[email protected]>
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the kind/stale label Jun 13, 2026
@shykes shykes removed the kind/stale label Jun 18, 2026
@shykes

shykes commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #13313 (VERSION files + buildinfo-based VCS info), which is the approach we're standardizing on for build/release versioning (see discussion #13287). Recording the full rationale here for future readers.

Why this is superseded

This PR refactors the version/ Dagger module to derive dev version strings from git workspace state: it computes the next dev baseline from the latest v* tag (patch-bumped) and detects dirty state via GitRepository.Uncommitted.

#13313 takes a more fundamental approach to the same problem. It deletes the version/ module entirely and replaces git-tag-walking with an explicit, committed internal/version/VERSION file (embedded via go:embed), with commit/dirty info coming from runtime/debug.ReadBuildInfo wrapped by github.com/dagger/go/buildinfo. Because the intended version is stated explicitly in the VERSION file, the tag-derivation / patch-bump / pseudoversion machinery in this PR is no longer needed — it's obsoleted by design, not just by code.

Concretely: this PR's hand-written logic lives in version/main.go, which #13313 removes. Its only non-version/ footprint is regenerated version.gen.go bindings that disappear along with the module. So there is nothing left to rebase onto the new baseline.

Ideas preserved as follow-ups on #13313 (so they aren't lost)

  • The workspaceGit seam (abstracting git access so it can swap to a core Workspace.git API): VERSION files + buildinfo-based VCS info (discussion #13287) #13313 already carries this intent as a TODO on toolchains/go's git input — migrate the repo *GitRepository input (currently +defaultPath="/", full-repo upload) to Workspace.git (Workspace.git(): contextual information about a workspace's git repository #13074) once we depend on Dagger >= 1.0.0-beta.2 (lazier, nested-workspace-aware).
  • Commit-time injection: deferred to the GitCommit work (New core type: GitCommit #13086 / core: add GitCommit type #13088) rather than the git log-in-a-container workaround used here.

Closing as superseded, not a rejection on the merits.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shykes shykes closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@shykes
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.