Skip to content

fix(setup): resolve SDK installs in every migrated workspace config - #13653

Merged
eunomie merged 1 commit into
dagger:mainfrom
eunomie:migrated-sdk-install-fix-adad0c20
Jul 16, 2026
Merged

eunomie merged 1 commit into
dagger:mainfrom
eunomie:migrated-sdk-install-fix-adad0c20

Conversation

@eunomie

@eunomie eunomie commented Jul 15, 2026

Copy link
Copy Markdown
Member

dagger setup migration records builtin-SDK installs by bare short name (e.g. source = "go"), and a CLI pass then resolves them to real refs via sdks.json (the same resolution as dagger sdk install go). That pass only ran against the top-level workspace config — so the SDK installs migration wrote into the other configs it creates (nested workspace plans, and locally-referenced modules discovered under them, from #13620) kept a non-functional bare source.

This scopes resolution to exactly the dagger.toml files the migration changeset wrote and resolves each, reusing the existing generic fixup logic. Pre-existing workspace configs (the migration's ownership boundaries) are never touched, and a declined migration resolves nothing.

  • internal/cmd/dagger/setup.go — scope SDK-install resolution to the changeset-written configs.
  • core/integration/workspace_migration_test.go — +3 regression tests.

Verified: real before/after repro via engine-dev (the nested-config bare source now resolves after the fix); full TestWorkspaceMigration suite (37 tests, incl. the 3 new) passes; core/workspace + internal/cmd/dagger unit tests pass; build / gofmt / vet clean.

@eunomie
eunomie marked this pull request as ready for review July 15, 2026 16:31
@eunomie
eunomie force-pushed the migrated-sdk-install-fix-adad0c20 branch from 0b576b0 to 63bb355 Compare July 15, 2026 16:38
Migration records builtin-SDK installs by their bare runtime short name
(e.g. `source = "go"`), which `dagger setup` then resolves to a real,
installable ref via sdks.json — the same result `dagger sdk install go`
produces. That resolution pass only ran against the top-level workspace
the setup command runs in, so SDK installs migration wrote into other
configs it creates — nested workspace plans and locally-referenced
modules discovered under them — kept their non-functional bare source.

Scope the resolution to exactly the dagger.toml files the migration
changeset wrote (from its added/modified paths) and resolve each,
reusing the existing generic fixup logic. The top-level config keeps
going through the workspace API; the rest are rewritten on disk. Because
the set is the migration's own output, pre-existing workspace configs the
migration treats as ownership boundaries are never touched, and a
declined migration resolves nothing.

Signed-off-by: Yves Brissaud <[email protected]>
@eunomie
eunomie force-pushed the migrated-sdk-install-fix-adad0c20 branch from 63bb355 to 943278c Compare July 16, 2026 05:36
@eunomie eunomie added this to the v1.0.0 milestone Jul 16, 2026
for _, fix := range fixes {
fmt.Fprintf(out, " Resolved SDK %q to %s\n", fix.SDKName, fix.Ref)
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Optional: since the migration is already exported to disk in this session, the top-level config could also go through resolveMigratedSDKsInConfigFile(out, filepath.Join(root, workspace.ConfigFileName)), which would let you drop this WithConfigValue/Export block and the filepath.Clean(rel) == workspace.ConfigFileName skip — unifying both paths on one code path. Defensible to keep the top-level on the workspace API though; just flagging the trade-off.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not really possible to unify both. The config have to be written on the disk, but at the same time the we still need the workspace API because of recommend/install step later in the same session.
I'll merge that way for now, and if it can be improved later that will be good thing.

@eunomie
eunomie merged commit 3046ffe into dagger:main Jul 16, 2026
87 checks passed
@eunomie
eunomie deleted the migrated-sdk-install-fix-adad0c20 branch July 16, 2026 12:55
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.

2 participants