Repository navigation
python-sdk: read a scope's targetVersion from the engine - #83
Merged
Merged
Conversation
eunomie
force-pushed
the
scope-settings-target-version
branch
from
November 6, 2026 10:35
1c7916f to
f08ce5b
Compare
The SDK's parse missed upper-case tables and scope keys above the root. dagger-module.toml declares v1.0.0-beta.26, the first with scopeSetting; its casing cut needs clientSchemaIntrospectionJson and PythonSDK. Signed-off-by: Yves Brissaud <yves@dagger.io>
Signed-off-by: Yves Brissaud <yves@dagger.io>
eunomie
force-pushed
the
scope-settings-target-version
branch
from
November 17, 2026 09:07
f08ce5b to
81f33ee
Compare
CI now loads the workspace from Git, where same-repo clients bind by path, and a nested CLI there receives none of the engine's spans. Signed-off-by: Yves Brissaud <yves@dagger.io>
Its engines, built at v1.0.0-beta.17, beta.18 and beta.24, lack WorkspaceSDK.scopeSetting, so none of them can load this SDK. Signed-off-by: Yves Brissaud <yves@dagger.io>
The SDK itself now needs v1.0.0-beta.26, so v1.0.0-beta.18 is no longer its floor, only the oldest release a pin may name. Signed-off-by: Yves Brissaud <yves@dagger.io>
It compared only on v1.0.0-beta.18, which can no longer load the SDK, so it reported success without comparing anything. Signed-off-by: Yves Brissaud <yves@dagger.io>
eunomie
force-pushed
the
scope-settings-target-version
branch
from
November 17, 2026 13:05
81f33ee to
81fb9d0
Compare
eunomie
marked this pull request as ready for review
November 17, 2026 13:17
Signed-off-by: Yves Brissaud <yves@dagger.io>
Signed-off-by: Yves Brissaud <yves@dagger.io>
Delta checks call the collection's functions directly. A batch generator replacing its item's, and repeated selectors on a collection function, cannot be kept: the checks cover per-item generators and subset instead. Signed-off-by: Yves Brissaud <yves@dagger.io>
beta.27 serves module code its caller's workspace as currentWorkspace, against the engine's own contract; the check notes that read. Signed-off-by: Yves Brissaud <yves@dagger.io>
eunomie
force-pushed
the
scope-settings-target-version
branch
from
November 17, 2026 16:08
81fb9d0 to
2030a32
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.
A Python module generated directly, as
dagger call python-sdk mod --path X generatedoes, now reads its scope'stargetVersionthrough the engine'sWorkspaceSDK.scopeSetting. The SDK no longer parsesdagger.tomlitself.The SDK's engine floor is
v1.0.0-beta.26, and its default targeted release isv1.0.0-beta.27.WorkspaceSDK.scopeSettingcomes from dagger/dagger#15084, first released inv1.0.0-beta.26; nothing the SDK uses needsv1.0.0-beta.27.Based on
mainat3d84461d.What changes
python-sdk: read a scope's targetVersion from the enginemodcallsws.sdk(name: currentModule.name).scopeSetting(path: "/" + modPath, key: "targetVersion").targetVersion.--target-version, as before.dagger generaterefuses it.recordedTargetVersion,scopeSettings,sdkModuleNameandscopeKeyPathare deleted. Their copy of the engine's config rules had drifted from it: it missed upper-case tables and scope keys above the workspace root.dagger-module.tomldeclaresv1.0.0-beta.26, the first release withWorkspaceSDK.scopeSetting.engine.IdentifierCasingVersion).scope.dangreadsModuleSource.clientSchemaIntrospectionJsonin place ofclientSchemaIntrospectionJSON, and the e2e module names this SDK's typePythonSDKin place ofPythonSdk.e2e: probe a numeric scope pin under upper-case tablesAdds
scopeSettingProbe, a function, not a check. It recordstargetVersion = 18under[SDKS.python.SCOPES."<path>".SETTINGS]and asserts thatmodrefuses"18"as no engine release:e2e: run the e2e checks on the engine that runs themdagger.tomlinstalls thee2emodule in place ofengine-e2e.dagger checkwithout a pattern, which CI runs, now runs the e2e checks on the engine that runs it.engine-e2e's on-disk playground and nested CLI:client-target-manifest-checkloses its Git-workspace branch. Sinceaceb533e, a same-repo client in a Git workspace binds by path, so generation refuses an unmigrated target there too, with the samedagger module migrateadvice.root-init-ignores-checkruns its CLI withdaggerInDaggerNewSession. A nested CLI receives only its own spans, socheck_uploads.pysaw nouploading /repospan. A CLI in a session of its own receives the engine's spans, the uploads among them.engine-e2e: remove the module CI no longer runsengine-e2eran the e2e checks on engines built from thev1.0.0-beta.17,v1.0.0-beta.18andv1.0.0-beta.24commits. None of them servesWorkspaceSDK.scopeSetting, so none can load this SDK once it declaresv1.0.0-beta.26.engine-e2emodule, with its pinned engine builds andfloor-coverage-check, and e2e'sassertFloorEngine..dagger/modules/engine-e2e/workspace.tomlstays: the e2e playground uses it as itsdagger.toml.engine-e2eregistered since runtime: compile the standard library bytecode #87, fix: stage the entrypoint manifest on the builtin Dang runtime #88 and python-sdk: make ruff skip generated members #95, such asgenerated-ruff-skip-check, already exist as e2e checks, so CI keeps running them.python-sdk: name v1.0.0-beta.18 as the pin boundv1.0.0-beta.18is no longer the SDK's floor, only the oldest release atargetVersionpin may name. The refusal of a lower pin now says so.e2e: drop the bindings check every engine skipsDeletes
sdk-bindings-check. It comparedsdk/src/dagger/client/gen.pyonly on av1.0.0-beta.18engine, which can no longer load the SDK, so it passed without comparing anything.The command that regenerates the file stays:
dagger call -m .dagger/modules/e2e sdk-bindings export --path sdk/src/dagger/client/gen.pypython-sdk: correct stale engine versions in the docsdocs/collections.mdand the docstring ofremoteEntrypointReplacedChecknamedv1.0.0-beta.18as what generation needs. They now namev1.0.0-beta.26for generation, andv1.0.0-beta.18for what a generated entrypoint runs on.AGENTS.mdno longer tiesdagger callexiting 0 on a failing check tov1.0.0-beta.18.python-sdk: target v1.0.0-beta.27v1.0.0-beta.27by default:engineTarget, the vendored library'sCLI_VERSION, the README and the golden entrypoints move to it.entrypoint-client-call-checkcallsModuleSource.withSdk, the name fromv1.0.0-beta.26on: the caller module now runs in thev1.0.0-beta.27view.dang.tomlparagraph now says that core: version entrypoint modules via dang.toml dagger#14902 shipped inv1.0.0-beta.26, where it read "not merged". Engines up tov1.0.0-beta.25ignore the file, and an entrypoint whosedang.tomldeclares no Dagger version getsv1.0.0-beta.25.e2e: check collections without batch, gone in v1.0.0-beta.22batchoperation inv1.0.0-beta.22. A collection now keeps its own functions besidekeys,list,getandsubset, so the delta checks callselected,removed,changeandfreshdirectly.collection-kinds-checknow asserts. A repeated selector no longer selects a subset for a collection function:collections-checkcallssubsetby name.docs/collections.mdno longer describesbatch, says that Apply artifact filters to collection views dagger#14802 removed it inv1.0.0-beta.22, and describes thedagger checkselector example as a check on the item type, run once per selected item.e2e: hold the reach probe to what the SDK holdsv1.0.0-beta.27, module code under an entrypoint reads the caller's workspace through a rawcurrentWorkspacequery. A nested client inherits its parent's workspace binding, and the resolver has no guard for module code. The engine's own tests (TestCurrentWorkspaceError) state that module SDKs do not getcurrentWorkspace; codegen only hides the field. This reproduces onmainat3d84461dwithv1.0.0-beta.27, and passed onv1.0.0-beta.18.currentWorkspaceapart from reads through IDs the SDK holds. A read through that workspace's ID counts as the engine's only when the SDK does not hold the same ID itself. The check still fails on any read through an SDK-held ID, and notes the engine's read.Compatibility
v1.0.0-beta.26or later.WorkspaceSDK.scopeSetting, the SDK fails while it loads, before it writes anything: Dang type-checks the whole module first. The design accepted this in place of the SDK's own version refusal.modneeds this SDK registered under[sdks]indagger.toml: an entry whosemoduleis this SDK's installed module, such as[sdks.python]withmodule = "python-sdk". This now applies with--find-up=falsetoo.targetVersionpin now targetsv1.0.0-beta.27. A pin may still name any release fromv1.0.0-beta.18tov1.0.0-beta.27, and the generated entrypoint still needs an enginev1.0.0-beta.18or later to run.Testing
Ran on an engine
v1.0.0-beta.26, the floor. The releasedregistry.dagger.io/engine:v1.0.0-beta.26image no longer starts: one root of the cache bundle it ships, the Go SDK'sgo-includesfile, expired on 2026-11-17 at 04:46 UTC, seven days after the image was built, and the engine refuses to start on an expired root. The engine used is that image with/usr/local/share/dagger/entriesremoved, which starts it with an empty cache.cd sdk && uv run --frozen pytest -q -m "not slow": 568 passed.dagger check -m .dagger/modules/e2e generate-scope-init-check generate-scope-clients-check generate-scope-existing-check generated-ruff-skip-check runtime-call-check: all five pass.dagger check -m .dagger/modules/e2e collections-check collection-kinds-check collections-client-check client-target-manifest-check entrypoint-client-call-check root-init-ignores-check, the checks that failed CI on81f33eee: all six pass.dagger call -m .dagger/modules/e2e scope-setting-probe:WorkspaceSDK.scopeSettingreturns the numeric pin, andmodrefuses it as no engine release.On
v1.0.0-beta.27, CI passed on81fb9d0a, where the SDK declaredv1.0.0-beta.27.client-target-manifest-checkchanges for; that path is checked againstscope.dang, not run.sdk/src/dagger/client/gen.pywith what the generator writes, so its freshness is not checked. This PR does not changegen.py.Before merge
dagger checkpasses onv1.0.0-beta.27.