Repository navigation
fix: don't abort dagger generate when the entrypoint module can't load - #13774
Merged
Merged
Conversation
grouville
force-pushed
the
fix-v1-entrypoint-generate
branch
from
July 30, 2026 03:18
290b5f7 to
79f8b81
Compare
Member
Author
|
The first commit (restoring |
grouville
force-pushed
the
fix-v1-entrypoint-generate
branch
4 times, most recently
from
July 30, 2026 20:26
056e125 to
5d35122
Compare
A workspace whose entrypoint module cannot load (issue 13742: a migrated v1 module whose local dependencies are missing their generated files) aborts every dagger generate mode, even though generate is the repair for that state and already skips the module best-effort while listing. Also cover the pre-migration shape from the issue: a legacy dagger.json entrypoint project with local dependencies must keep call and generate working. Signed-off-by: Guillaume de Rouville <[email protected]>
The SDKs root every post-Sync handle at node(id:), so dagger generate's follow-up queries (changeset id, diff stat, export) all peek as an unrecognized root field. The unknown-field fallback then selected the pending entrypoint module for a strict load — and since the generators listing had already tried that module best-effort and recorded its failure, the strict path replayed the recorded error, failing every generate mode on a workspace whose entrypoint cannot load (e.g. a migrated v1 module whose local dependencies are missing their generated files). dagger#13742 The fallback is only a guess that the unrecognized field might be an entrypoint function; a module already recorded as unloadable can't serve anything, so guessing at it can only replay its load error. Thread the client's failed-module record into the root-field demand filter and leave such modules pending: requests that deliberately proceeded without the broken module keep working against the served schema, and GraphQL validation reports unresolved fields and types. A root field that names a failed module directly still selects it, so explicit use still surfaces the real load error. Fixes dagger#13742 Signed-off-by: Guillaume de Rouville <[email protected]>
grouville
force-pushed
the
fix-v1-entrypoint-generate
branch
from
July 30, 2026 22:07
5d35122 to
849d5b3
Compare
tiborvass
approved these changes
Jul 31, 2026
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.
What was broken
A module that can't load is fixed by running
dagger generate— that's what creates its missing generated files. But when the broken module was the workspace entrypoint, generate itself failed:Generate tells you to run generate. You're stuck. Every migrated v1 project with local dependencies lands in this state, because migration converts modules to the new format before their generated files exist (#13742).
Why it happened
Generate already expects broken modules: it loads them best-effort and skips the ones that fail.
The failure came from a later step. Before answering any query, the engine reads the query's first field to decide which modules it must load. Known core fields (
container,currentWorkspace, ...) need none. An unknown field is assumed to be a function of the entrypoint module, so the engine force-loads it — and force-loading a broken module fails the query.node— the field the SDK uses to fetch generate's results (changeset id, diff preview, export) — is a core field, but was missing from the known list. So right after generate skipped the broken entrypoint, its own follow-up queries force-loaded it and died. This is also why only entrypoint modules were affected: a broken non-entrypoint module leaves nothing to force-load.The fix
Add
nodeto the known core fields: it loads an existing object by ID and needs no module. Generate now skips the broken entrypoint (still warned, still fatal with--require-load) and generates everything else.Repro
Testing
First commit adds the red test: a workspace with a broken entrypoint module, where
generate -l/-y/--no-applyall failed.Also green:
TestGenerators,TestWorkspaceCompat,TestModuleLoadingandTestWorkspace(559 tests total), plus the greetings-api repro above on a dev engine. (greetings-api additionally needs the Go SDK generator work tracked in #13743 beforedagger callworks; this PR removes the hard failure in front of it.)A separate commit restores the
materializeModuleFileshelper: two independently merged commits leftcore/integrationuncompilable on main.Fixes #13742