Make module discovery cwd-aware and resolve dagger-module.toml#8
Merged
Conversation
24 tasks
TomChv
force-pushed
the
feat/make-module-discovery-cwd-aware
branch
from
July 22, 2026 12:14
a01a0b0 to
fb14696
Compare
This comment was marked as outdated.
This comment was marked as outdated.
TomChv
force-pushed
the
feat/make-module-discovery-cwd-aware
branch
from
July 22, 2026 13:13
fb14696 to
e279505
Compare
kpenfound
approved these changes
Jul 23, 2026
TomChv
force-pushed
the
feat/make-module-discovery-cwd-aware
branch
from
July 24, 2026 16:16
a163476 to
c3f0b0a
Compare
Port the cwd-aware discovery change from the Go, Python and TypeScript SDKs (dagger/dagger#13688): modules are discovered relative to the client's current directory rather than the whole workspace, and both the CLI 1.0 dagger-module.toml and the legacy dagger.json mark a module root. - Mod.path becomes rootPath (workspace-root-relative, the module's stable identity); a new cwd-relative Mod.path renders listings the way a shell user sees them. - JavaSdk.modules(ws) discovers managed modules through the polyfill's cwd-aware findConfigDirs, intersected with the workspace's SDK-managed list read via ws.sdk(name: currentModule.name) on the passed workspace (so it never depends on an ambient current workspace). generateAll goes through it, so running from a subdirectory acts on the project you're in and the projects beneath it. - Point the polyfill dependency in dagger-module.toml (the effective module config) at github.com/dagger/polyfill@main, which provides findConfigDirs. - Wire the workspace dagger.toml for e2e (register java-sdk as the "java" SDK with fixtures) and add modulesCheck / modulesCwdCheck covering both config formats and cwd scoping. The e2e fixtures carry the skip-generate marker so generateAll lists but never builds them. - Make packager:generate byte-reproducible by stripping Maven's install-time timestamps from the committed prebuilt repo, which otherwise churn on every run and make the generate-check report perpetual drift. Signed-off-by: Tom Chauveau <tom@dagger.io>
TomChv
force-pushed
the
feat/make-module-discovery-cwd-aware
branch
from
July 24, 2026 16:18
c3f0b0a to
ef352c5
Compare
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.
What
Ports the cwd-aware module discovery change to the Java SDK, matching the sibling SDK PRs:
Tracking issue: dagger/dagger#13688.
Changes
Mod.path→Mod.rootPath— the workspace-root-relative path is the module's stable identity. A new computedMod.pathis a cwd-relative view (".","sub/mod","..") so listings read the way a shell user sees them.JavaSdk.modules(ws)— new cwd-aware discovery. It goes through the polyfill'sfindConfigDirs(anchored at the client's cwd, not the workspace root) and intersects the result with the engine-ownedcurrentModule.asSDK.moduleslist.generateAllnow goes through it, so running from a subdirectory acts on the project you're in and the projects beneath it.dagger-module.tomlresolution — module roots are discovered by either the CLI 1.0dagger-module.tomlor the legacydagger.json(moduleConfigFilenames).dagger-module.toml(the effective module config, which still pointed at the oldsdk-sdk/polyfill) atgithub.com/dagger/polyfill@main, which providesfindConfigDirs.dagger.toml(it still referenced a Go-based runtime that has since moved to Dang) to register the e2e module and thejavaSDK with its fixtures.Tests
Adds
modulesCheckandmodulesCwdCheckto the e2e module, covering discovery of both config formats, cwd walk-down/find-up scoping, and exclusion of modules this SDK doesn't manage.Verified against a
v1.0.0-beta.7engine:Signed-off-by: Tom Chauveau tom@dagger.io