Skip to content

fix(go): match same-repo clients in the explicit Git URL form - #79

Merged
eunomie merged 1 commit into
dagger:mainfrom
eunomie:fix-same-repo-clients-beta20
Oct 23, 2026
Merged

eunomie merged 1 commit into
dagger:mainfrom
eunomie:fix-same-repo-clients-beta20

Conversation

@eunomie

@eunomie eunomie commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What

Recognize same-repo clients when dagger prints a Git module's ref in the explicit Git URL form, <clone>#<version>:<subpath>.

Why

Since dagger v1.0.0-beta.20 (dagger/dagger@81e1c30405), a module of a Git workspace prints its ref as <clone>#<version>:<subpath>. gitSelector only knew <clone>/<subpath>@<version>, so in a Git workspace no client was recognized as same-repo. Each one embedded the workspace URL and commit, and go-sdk/generate/stale failed in Git mode on every commit (dagger/dagger#14714: 70 files, +1010 -1010).

gitSelector now also reads the version after #, up to :.

The cache-namespace slowness of same-repo clients is addressed in the engine by dagger/dagger#14813 (merged).

How verified

  • go test ./... and go vet ./... pass in cmd/dagger-go-sdk-codegen. New TestWorkspaceModuleExplicitGitURL covers GitHub, a git server, a branch selector, another selector, another repository and the repository root; 4 of its cases fail without the fix.
  • On Move the repository's Go modules to the go-sdk Dang entrypoint dagger#14714 in Git mode with go-sdk main, the go-sdk changeset is that problem and nothing else: 25 client addresses, 940 source-link comments and 45 manifest hashes.

Not covered

End to end on a GitHub workspace, which always loads go-sdk from main: after merge, bump the pin in dagger/dagger#14714 and rerun go-sdk/generate/stale.

Since dagger v1.0.0-beta.20 (dagger/dagger 81e1c30405), a module of a
Git workspace prints its ref in the explicit Git URL form,
<clone>#<version>:<subpath>, instead of <clone>/<subpath>@<version>.
gitSelector only knew the second form, so no module of a Git workspace
was recognized as part of it: every same-repo client embedded the
workspace URL and commit, and go-sdk/generate/stale failed on each push.

Read the version after "#" up to ":" as well.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 22, 2026
Point the go-sdk module at github.com/eunomie/go-sdk@fix-same-repo-clients-beta20
(dagger/go-sdk#79) and regenerate the same-repo clients with it, so
that Cloud runs this PR with that change. With it, the go module's
caches use main's namespace on a Git workspace.

Drop this commit once dagger/go-sdk#79 is merged and the
dagger.io/sdk/go@main pin is bumped.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to eunomie/dagger that referenced this pull request Oct 22, 2026
Point the go-sdk module at github.com/eunomie/go-sdk@fix-same-repo-clients-beta20
(dagger/go-sdk#79) and regenerate the same-repo clients with it, so
that Cloud runs this PR with that change. With it, the go module's
caches use main's namespace on a Git workspace.

Drop this commit once dagger/go-sdk#79 is merged and the
dagger.io/sdk/go@main pin is bumped.

Signed-off-by: Yves Brissaud <[email protected]>
@eunomie
eunomie force-pushed the fix-same-repo-clients-beta20 branch from 3f8b1ac to a117894 Compare October 22, 2026 20:51
@eunomie eunomie changed the title fix(go): load same-repo clients as Git modules on Git workspaces fix(go): match same-repo clients in the explicit Git URL form Oct 22, 2026
@eunomie
eunomie merged commit 3c5ed35 into dagger:main Oct 23, 2026
9 checks passed
@eunomie
eunomie deleted the fix-same-repo-clients-beta20 branch October 23, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant