Skip to content

fix(checks): run contract checks on the configured CLI release - #20

Merged
TomChv merged 1 commit into
mainfrom
fix-contract-checks-cli-version
Aug 20, 2026
Merged

TomChv merged 1 commit into
mainfrom
fix-contract-checks-cli-version

Conversation

@TomChv

@TomChv TomChv commented Aug 20, 2026

Copy link
Copy Markdown
Member

Fixes #19.

What was wrong

contract:* built its ModTestTarget straight from the mod-test dependency, which fell back to its own daggerCliVersion default. Every other group threads SdkSdk.daggerCliVersion through SdkHarness, so overriding the setting fixed install / init / generation / module / chain and left the four contract checks running an unrelated CLI. For an SDK whose committed artifacts target a newer engine, the scaffolded module failed to load and all four failed.

Changes

  • checks-contract.dang builds its target with modTest(daggerCliVersion: harness.daggerCliVersion), so one knob now controls every group. SdkHarness.daggerCliVersion is pub for that; the target itself stays a private let because a pub function may not return a dependency module's type.

  • mod-test assertions append the call's exit code and stderr when the command itself failed, instead of raising only the caller's assertion message. initModule should seed at least one SDK file now reads:

    Error: initModule should seed at least one SDK file
    dagger call failed: ["init-module","--name","sdk-contract-init",...]
    exit code: 1
    stderr:
    ! unknown command "init-module" for "dagger api call"
    
  • Default CLI release bumped to 1.0.0-beta.10 in sdk-sdk and mod-test.

  • Both READMEs named the setting dagger-cli-version; the key the engine matches against the constructor arg is daggerCliVersion. Corrected, with the dagger.toml snippet spelled out.

Configuring it

The version is already a workspace setting — this PR makes it apply everywhere:

[modules.sdk-sdk]
source = "github.com/dagger/sdk-sdk"

[modules.sdk-sdk.settings]
daggerCliVersion = "1.0.0-beta.10"

Not pinned in this repo's own dagger.toml: it would duplicate the default and silently go stale on the next bump.

Verification

dagger --x-release=v1.0.0-beta.10 check — 22 checks pass, and only dagger_v1.0.0-beta.10 archives are fetched.

With daggerCliVersion = "1.0.0-beta.9" temporarily set in dagger.toml, dagger check sdk-sdk:contract:seeds-files fetches the beta.9 archive (proving the setting reaches the contract group) and fails with the stderr excerpt above rather than the bare assertion message.

The contract group built its ModTestTarget from mod-test's own default
version, so `daggerCliVersion` — the setting every other group honours —
was ignored there. An SDK whose committed artifacts target a newer engine
failed all four contract checks while the rest of the suite passed.

Thread the harness version into mod-test, and report a failed call with
its exit code and stderr instead of the caller's assertion message, which
read as "initModule should seed at least one SDK file" when the module had
in fact failed to load.

Default CLI release moves to 1.0.0-beta.10, and both READMEs now name the
setting correctly (`daggerCliVersion`, not `dagger-cli-version`).

Fixes #19

Signed-off-by: Tom Chauveau <[email protected]>
@TomChv
TomChv requested a review from kpenfound August 20, 2026 13:03
@eunomie

eunomie commented Aug 20, 2026

Copy link
Copy Markdown
Member

@TomChv I'm already fixing it in the polyfill removal as we have to merge this PR and it can't work right now

@eunomie

eunomie commented Aug 20, 2026

Copy link
Copy Markdown
Member

@TomChv let's do this one, and I'll rebase the polyfill one on top so we can merge it
You're good to merge

@TomChv
TomChv merged commit e223a31 into main Aug 20, 2026
26 checks passed
eunomie added a commit to dagger/java-sdk that referenced this pull request Aug 20, 2026
Picks up dagger/sdk-sdk#20, which threads daggerCliVersion into mod-test so the
contract checks run on the configured CLI release rather than mod-test's own
default, and moves that default to 1.0.0-beta.10 — new enough to build a flag
for a Workspace argument. All four contract checks failed here without it: the
harness silently skipped initModule, which takes a Workspace, and reported the
caller's assertion message rather than the underlying failure.

Also picks up the harness's own polyfill removal.

Signed-off-by: Yves Brissaud <[email protected]>
eunomie added a commit to grouville/python-sdk that referenced this pull request Aug 21, 2026
sdk-sdk reached dagger/polyfill through the module-source type its harness
returned, and its checks drove a CLI release older than the engine this module
now requires. Either one takes seven of this repository's checks down.
dagger/sdk-sdk#14 replaced the module-source type and dagger/sdk-sdk#20 taught
every check group to honor daggerCliVersion; this records that version.

The workspace floats sdk-sdk to its default branch, so the lock file is a record
rather than a constraint. It moves to format 2 as a side effect of being
rewritten by the current CLI, and loses the polyfill entry along with the
dependency.

Signed-off-by: Yves Brissaud <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Aug 25, 2026
dagger/sdk-sdk#20 threads the configured CLI release through to the contract
checks, which previously ran mod-test's own pinned default and so paired this
SDK's beta.10 bundle with a beta.9 engine. All 22 contract-suite checks pass
again.

The workspace pin stays: sdk-sdk's default matches ours today, but this SDK
ships a library built for one engine release, so the version the harness runs
is load-bearing. Pinning states that, rather than inheriting whatever sdk-sdk
moves to next.

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Aug 28, 2026
dagger/sdk-sdk#20 threaded the configured CLI release through to the contract
checks, which had been running mod-test's own pinned default and so pairing this
SDK's beta.10 bundle with a beta.9 engine. That fix reached us through the
sdk-sdk resolution already recorded in dagger.lock, not through anything in this
commit — only the comment changes here, and the subject should not suggest
otherwise.

What the comment now says: the pin stays because this SDK ships a library built
for one engine release, so the version the harness runs is load-bearing.
sdk-sdk's default happens to match ours today; stating the requirement here
means its default moving ahead of ours shows up as a failing check rather than a
library quietly paired with a newer engine.

All 22 contract-suite checks pass.

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Aug 28, 2026
dagger/sdk-sdk#20 threaded the configured CLI release through to the contract
checks, which had been running mod-test's own pinned default and so pairing this
SDK's beta.10 bundle with a beta.9 engine. That fix reached us through the
sdk-sdk resolution already recorded in dagger.lock, not through anything in this
commit — only the comment changes here, and the subject should not suggest
otherwise.

What the comment now says: the pin stays because this SDK ships a library built
for one engine release, so the version the harness runs is load-bearing.
sdk-sdk's default happens to match ours today; stating the requirement here
means its default moving ahead of ours shows up as a failing check rather than a
library quietly paired with a newer engine.

All 22 contract-suite checks pass.

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Aug 28, 2026
dagger/sdk-sdk#20 threaded the configured CLI release through to the contract
checks, which had been running mod-test's own pinned default and so pairing this
SDK's beta.10 bundle with a beta.9 engine. That fix reached us through the
sdk-sdk resolution already recorded in dagger.lock, not through anything in this
commit — only the comment changes here, and the subject should not suggest
otherwise.

What the comment now says: the pin stays because this SDK ships a library built
for one engine release, so the version the harness runs is load-bearing.
sdk-sdk's default happens to match ours today; stating the requirement here
means its default moving ahead of ours shows up as a failing check rather than a
library quietly paired with a newer engine.

All 22 contract-suite checks pass.

Signed-off-by: Tom Chauveau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

contract checks ignore daggerCliVersion: mod-test pins its own release

2 participants