Skip to content

fix(go): bind same-repo clients by path in git workspaces - #73

Merged
eunomie merged 1 commit into
dagger:mainfrom
eunomie:fix-same-repo-client-ref
Oct 16, 2026
Merged

eunomie merged 1 commit into
dagger:mainfrom
eunomie:fix-same-repo-client-ref

Conversation

@eunomie

@eunomie eunomie commented Oct 16, 2026

Copy link
Copy Markdown
Member

What

When a workspace is opened from Git (dagger -W <repo>.git@<sha>), the
engine reports a client's target in the same repository as a Git source.
The generated client then embedded the repository URL and commit, so it
never matched the committed output and the stale check failed on every
commit.

go-sdk.dang now passes the workspace address and commit for Git targets.
The codegen binds a target as a local module by path when it is in the same
repository, at the workspace commit, with the same selector. Source links
become repo-relative, as local generation writes them.

How verified

  • On v1.0.0-beta.18 with a local Git server: before, the Git-mode changeset
    rewrote the client; now it is empty at @<sha> and with no selector, and
    local generate has no changes.
  • Unit tests for the match rules and source links.

Not covered

  • No selector, and a client pinned to another branch at the same commit.
  • Version-query workspaces keep the Git binding.

Walkthrough: https://gistpreview.github.io/?8361e294035c40f0ca23b265500ce55c

A Git workspace resolved them as Git sources, so their clients embedded the
workspace URL and commit, and regeneration never matched the commit.

Signed-off-by: Yves Brissaud <[email protected]>
@eunomie
eunomie merged commit d12c77c into dagger:main Oct 16, 2026
9 checks passed
@eunomie
eunomie deleted the fix-same-repo-client-ref branch October 16, 2026 19:55
eunomie added a commit that referenced this pull request Oct 20, 2026
A GitHub workspace address has no scheme while the clone URL of its
modules has https://, so the prefix check of #73 never matched on
github.com and those clients still embedded the workspace URL and commit.

Signed-off-by: Yves Brissaud <[email protected]>
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