Skip to content

go: read discovery JSON with File.asJson - #108

Merged
kpenfound merged 2 commits into
mainfrom
fix/asjson-casing
Nov 22, 2026
Merged

kpenfound merged 2 commits into
mainfrom
fix/asjson-casing

Conversation

@kpenfound

Copy link
Copy Markdown
Contributor

Engine v1.0.0-beta.26 renamed File.asJSON to asJson. The old name is served only to views before beta.26. A test-split rerun type-checked the go module in a newer view and failed:

field "asJSON" not found in Dagger.File
discoveryScan(ws).file("_discovery_modules_/" + `${ordinal}` + ".json").asJSON

Changes

  • go.dang: change the three asJSON calls to asJson (discoveryIndex, the custom-base toolchain probe, moduleDiscovery).
  • dagger-module.toml: move the root module's engineVersion from beta.22 to beta.26, where asJson exists. gomod, which go depends on, already requires beta.26, so the minimum engine stays the same. asJSON was the only name renamed in beta.26 that go.dang used.
  • AGENTS.md: remove the minimum engine version line. Each module's dagger-module.toml already records it.

The pinned beta.22 view should have kept asJSON, so the engine or Dang SDK may not apply a Dang module's engineVersion view in some path. That needs its own fix upstream.

Testing

Ran these checks with a v1.0.0-beta.28 CLI. All passed:

dagger check -m .dagger/modules/go-dev base-check catalogue-index-check discovery-check toolchain-switch-check selected-tests-check tests-collection-check

I didn't run the full suite.

🤖 Generated with Claude Code

kpenfound and others added 2 commits November 22, 2026 00:48
Engine v1.0.0-beta.26 renamed File.asJSON to asJson. The old name is
served only to views before beta.26, so a run that typechecks the go
module in a newer view fails with:

  field "asJSON" not found in Dagger.File

Spell it asJson and move the module's engineVersion to beta.26, where
that spelling exists. gomod, which go depends on, already requires
beta.26, so this does not raise the minimum engine.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each module's dagger-module.toml already records it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kpenfound
kpenfound requested a review from sipsma November 22, 2026 18:47
@kpenfound
kpenfound merged commit 03e7347 into main Nov 22, 2026
107 checks passed
eunomie pushed a commit to eunomie/go-sdk that referenced this pull request Nov 25, 2026
Move daggerGo from dagger/go 79a92be to its release v0.5.0
(262b66d), the merge of dagger/go#110. Its gobuild is on otel-go and
OpenTelemetry v1.47.0, out of the range of GHSA-q7gw-24fr-5p69, where
79a92be's required otel/sdk v1.43.0 and otel/trace v1.46.0, and pinned
otel/sdk/log to v0.16.0. The engine image ships that gobuild for the
built-in Go SDK, which moves to the same commit, since the image's build
requires the two to match.

v0.5.0 also quotes linker string values (dagger/go#107) and reads
discovery JSON with File.asJson (dagger/go#108), which needs
v1.0.0-beta.26, go-sdk's daggerGoFloor. The calls generated entrypoints
make are unchanged.

Signed-off-by: Erik Sipsma <[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.

2 participants