Repository navigation
Drop the polyfill for the engine's findRoots - #42
Merged
Merged
Conversation
grouville
force-pushed
the
polyfill-removal
branch
from
August 11, 2026 23:44
a138060 to
3765b13
Compare
The engine now ships Workspace.findRoots (dagger/dagger#13854): the same cwd-aware project discovery this module got from github.com/dagger/polyfill as findConfigDirs — same semantics, ported from the polyfill's own design and test matrix. Swap the call, drop the dependency, and require the engine release that ships it. The engineVersion bump and the dependency removal have to land together: the version gate is what keeps the engine's new changeset behavior scoped to migrated modules. Signed-off-by: Guillaume de Rouville <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
The e2e module still declared engineVersion v0.20.6, which pins it to Dang
v1 semantics where `.{ }` is a GraphQL selection. Dang v2 spells that
`.{{ }}`; go.dang was migrated in 538bb62 but the harness that exercises it
was left behind, so it kept testing the module through an older language
and schema view than the one it ships against.
Declare the release the module now requires and convert the selections.
This also brings withWorkdir and the rest of the v1.0.0 Workspace surface
into reach for checks.
The dagger.json alongside dagger-module.toml is dead: the TOML wins when
both are present, so its stale v1.0.0-beta.9 engineVersion only reads as a
version pin that isn't one. Drop it.
Signed-off-by: Yves Brissaud <[email protected]>
findRoots answers relative to the workspace cwd: "." for the cwd itself,
".." for an enclosing project. Every other path this module handles is
workspace-root-relative, so a module root discovered from a subdirectory
named a directory that does not exist.
The result was that any command driving discovery failed outside the
workspace root. From fixtures/go-module-with-nested-module:
$ dagger -m ../.. call test-all
stat _root_.inc: no such file or directory
Discovery has been cwd-relative since 4533f42 adopted the polyfill's
findConfigDirs, whose comment already called for this resolution; the
engine's findRoots keeps the same contract, so resolve the results here.
Signed-off-by: Yves Brissaud <[email protected]>
eunomie
force-pushed
the
polyfill-removal
branch
from
August 21, 2026 09:06
3765b13 to
4606f32
Compare
Every generate fixture here starts without its generated file, so the suite only ever exercised a first run. A changeset built against an empty baseline looks identical to a correct one in that case: both report the generated file as added. The two diverge only on the second run, which nothing covered. Add a fixture whose generated output is committed and current, and assert that regenerating it reports no changes at all — not added, modified, or removed. The check fails in both directions: it reports "re-added" when the baseline stops seeing files that exist, and "rewrote" when generation is not idempotent. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
marked this pull request as ready for review
August 24, 2026 14:22
TomChv
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Go module used
dagger/polyfillfor one job: choosing which Go projects are in scope when a command runs. From a repository root it should find projects below; from inside a project it should select the nearest enclosinggo.mod.Workspace.findRootsin dagger/dagger#13854 is the native form of that behavior, shipped inv1.0.0-beta.10. Replacing the wrapper withfindRoots(markers: ["go.mod"])keeps the module's user-facing selection rules in one engine call.Four patches:
1. Drop the polyfill for the engine's findRoots. The call swap, the
engineVersionbump, and the dependency removal, together.2. Move the e2e module to Dang v2 and the engine under test. The harness still declared
engineVersion = "v0.20.6", which pins it to Dang v1 semantics where.{ }is a GraphQL selection; Dang v2 spells that.{{ }}.go.dangwas migrated in 538bb62 but the module that tests it was left behind, so it was exercising the module through an older language and schema view than the one it ships against. Under v2 a stray.{ x }resolvesxin the enclosing scope instead of on the element, which is how the wrong pin turns into confusing "not found" errors rather than an honest failure.This also deletes
.dagger/modules/e2e/dagger.json. When both files are present the TOML wins, so that file'sengineVersion: v1.0.0-beta.9read as a version pin without being one.3. Resolve discovered module roots from the workspace cwd.
findRootsanswers relative to the workspace cwd —"."for the cwd itself,".."for an enclosing project — while every other path this module handles is workspace-root-relative. Discovery has been cwd-relative since 4533f42 adopted the polyfill'sfindConfigDirs, whose comment already called for this resolution but never did it, so any command driving discovery failed outside the workspace root:This predates the migration and reproduces identically on
main; it is fixed here because the native call inherits the same contract, and because the comment this PR removes was the only record of it.4. Cover regenerating a module whose output already exists. Every generate fixture here started without its generated file, so the suite only ever exercised a first run — and a changeset built against an empty baseline is indistinguishable from a correct one in that case, since both report the generated file as added. They diverge only on the second run. This adds a fixture whose generated output is committed and current, and asserts that regenerating it reports nothing at all.
Test
dagger checkBare
dagger checkwith no pattern, whichdagger check -lconfirms is the full set. All checks pass, including the two new ones.discovery-from-subdir-checkruns discovery from a module root and from a directory inside a module, then mounts and tests the module it found; it fails without patch 3 (discovery from a module root missed that module).regenerate-checkfails in both directions —re-addedif the changeset baseline stops seeing files that exist on disk,rewroteif generation is not idempotent. Each patch in the stack was verified green on its own.