Skip to content

Commit 94548db

Browse files
committed
chore: pick up nearest-config polyfill fix
Polyfill previously selected the first config filename found while walking up, so mixed dagger.json and dagger-module.toml layouts could resolve to the farther module based on filename order. Pin the merged dagger/polyfill#4 revision for shared module discovery. The explicit mod lookup continues to perform its own nearest-config validation; the shared modules path now has the same behavior without another workaround. Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
1 parent 4d51d5d commit 94548db

7 files changed

Lines changed: 25 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
engineVersion = "v1.0.0-0"
2+
3+
[runtime]
4+
source = "python"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "mixed-discovery-app",
3+
"engineVersion": "v1.0.0-0",
4+
"sdk": {
5+
"source": "python"
6+
}
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.dagger/modules/e2e/main.dang

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type E2e {
1414
let configModulePath: String! = fixtureRoot + "/config/app"
1515
let configuredModulePath: String! = fixtureRoot + "/config/configured"
1616
let tomlModulePath: String! = fixtureRoot + "/toml/app"
17+
let mixedDiscoveryModulePath: String! = fixtureRoot + "/mixed-discovery/ancestor/work/app"
18+
let mixedDiscoveryNestedPath: String! = mixedDiscoveryModulePath + "/nested/deeper"
1719

1820
let generatedMarkerPath: String! = "sdk/src/dagger/client/gen.py"
1921
let generatedMarkerContents: String! = "Code generated by dagger."
@@ -106,6 +108,12 @@ type E2e {
106108
assert(scoped.length == 1, "nested cwd should see only its nearest managed module")
107109
assert(contains(scopedRoots, lookupModulePath), "nested cwd resolved the wrong managed module")
108110
assert(contains(scopedPaths, ".."), "module path should be relative to the nested cwd")
111+
112+
let mixedWs = ws.directory("/").asWorkspace(cwd: mixedDiscoveryNestedPath)
113+
let mixed = pythonSdk.modules(mixedWs).{{rootPath, path}}
114+
assert(mixed.length == 1, "mixed-config cwd should see only its nearest managed module")
115+
assert(contains(mixed.map { mod => mod.rootPath }, mixedDiscoveryModulePath), "mixed-config discovery chose the farther dagger-module.toml")
116+
assert(contains(mixed.map { mod => mod.path }, "../.."), "mixed-config module path should be relative to the nested cwd")
109117
null
110118
}
111119

dagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "polyfill",
1010
"source": "github.com/dagger/polyfill@main",
11-
"pin": "b30eb839000fe179e5d0544a9b667b21817b8120"
11+
"pin": "e90bbfc4843258a877a3a95b8db1571e7981e65f"
1212
}
1313
]
1414
}

dagger.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ path = ".dagger/modules/e2e/fixtures/skip/app"
3030

3131
[[modules.python-sdk.as-sdk.modules]]
3232
path = ".dagger/modules/e2e/fixtures/toml/app"
33+
34+
[[modules.python-sdk.as-sdk.modules]]
35+
path = ".dagger/modules/e2e/fixtures/mixed-discovery/ancestor/work/app"

0 commit comments

Comments
 (0)