Repository navigation
engine: honor declared versions in module clients - #14881
Conversation
Signed-off-by: Yves Brissaud <[email protected]>
This is only for clients from inside of a module. Clients outside of modules are using the existing way. But because of SDK entrypoints, this is now different. In an entrypoint, we already set a specific env variable for the call (to deal with cache). pub call(
receiverType: String!,
receiverValue: JSON,
fnName: String!,
fnArgs: JSON!,
callDigest: String,
): JSON! {
let request = JSON.encode({{
receiverType: receiverType,
receiverValue: receiverValue,
fnName: fnName,
fnArgs: fnArgs,
}})
let result = container
.from("alpine:3.22")
.withFile("/usr/local/bin/dispatch", dispatch, permissions: 755)
.withMountedDirectory("/workspace", currentModule.contextDirectory)
.withWorkdir("/workspace/" + currentModule.sourceSubpath)
.withEnvVariable("DAGGER_MODULE_CALL_DIGEST", callDigest ?? "")
.withExec(
["/usr/local/bin/dispatch", "engine-call", "/dagger/result.json"],
stdin: request,
experimentalPrivilegedNesting: true,
)
.file("/dagger/result.json")
.contents
(result :: JSON!)
}The idea is simply to add an extra one .withEnvVariable("DAGGER_MODULE_CALL_DIGEST", callDigest ?? "")
.withEnvVariable("DAGGER_CLIENT_VERSION", "v1.0.0-beta.20")
.withExec(And so the |
Signed-off-by: Yves Brissaud <[email protected]>
Refusing modules whose view is past the engine's made prerelease engines refuse every module declaring bare v1.0.0: sdk-helpers tags, go-sdk main and this repo's toolchains. Load them instead, served the engine's own view: ModuleAPIViewVersion caps APIViewVersion at APIViewVersion(engine.Version). It backs every place a module's engineVersion becomes a view (default schema builders, module client sessions) and APIVersionAtLeast, so __schemaVersion reports the capped view. Clients outside a module are not capped. A module client that declared its version (DAGGER_CLIENT_VERSION or the client metadata header, #14881) was already capped at the engine's view by hand; it now goes through ModuleAPIViewVersion too, and its tests expect prerelease views. The max-version check goes back to comparing base versions (CheckMaxVersionCompatibility): a later base version, such as v2.0.1 on a v2.0.0 engine, is still refused, since it may need more than view-gated API. Every prerelease and build of the engine's own base version loads. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Refusing modules whose view is past the engine's made prerelease engines refuse every module declaring bare v1.0.0: sdk-helpers tags, go-sdk main and this repo's toolchains. Load them instead, served the engine's own view: ModuleAPIViewVersion caps APIViewVersion at APIViewVersion(engine.Version). It backs every place a module's engineVersion becomes a view (default schema builders, module client sessions) and APIVersionAtLeast, so __schemaVersion reports the capped view. Clients outside a module are not capped. A module client that declared its version (DAGGER_CLIENT_VERSION or the client metadata header, #14881) was already capped at the engine's view by hand; it now goes through ModuleAPIViewVersion too, and its tests expect prerelease views. The max-version check goes back to comparing base versions (CheckMaxVersionCompatibility): a later base version, such as v2.0.1 on a v2.0.0 engine, is still refused, since it may need more than view-gated API. Every prerelease and build of the engine's own base version loads. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Core enum arguments passed into a module function are spelled for the module's view, not the view a declared runtime client (#14881) is served: the engine converts them before the runtime connects. Record the gap. Signed-off-by: Alex Suraci <[email protected]>
Module clients currently lose their declared API version when the engine applies the module's view. Honor
DAGGER_CLIENT_VERSIONand nested clients' own announced versions, cap declared core views at the running engine version, and preserve module context and dependency-module versions.Validation:
engine/server,engine/engineutil,core,core/schema, andengine. Coverage includes runtime initialization, HTTP__schemaVersion, version gates, engine caps, legacy fallback, nested-client registration, metadata conflicts, and the schema allowlist.go vet -lostcancel=falsepassed. The vet flag matches the repository configuration; default vet reports four existinglostcancelfindings in untouched code.Full SDK/container smoke and the full lint suite were not run. Candidate engine paths were exercised in process. The shared engine was unchanged.
📄 Understanding this change