Repository navigation
feat(generate): do not fail on non-loadable modules - #13575
Conversation
f39a96d to
323fa97
Compare
323fa97 to
bf212db
Compare
dagger generate on module load failuresbf212db to
eb6e1b0
Compare
4267d9b to
aacea18
Compare
|
There's an big panic in I think it could be related to the changes done in that PR since I've never seen an error like that happening before. |
e44023e to
c0601e7
Compare
|
Design doc for this change (kept out of the tree, in a secret gist): https://gist.github.com/eunomie/55af44e2a7b7c1121a3f777e1579237e |
c0601e7 to
984598b
Compare
Signed-off-by: Yves Brissaud <[email protected]>
Builds on main's best-effort workspace module load for generators (44dd632): an unscoped 'dagger generate' already skips a module that cannot load with a warning instead of aborting. This adds an opt-out and surfaces the collected failures on the API. - engine: ensureModulesLoadedMode / EnsureWorkspaceModules now return the best-effort skipped-module messages ([]string) alongside the error; the strict path returns (nil, err) unchanged. - resolver: the generators resolver captures those messages and sets them on GeneratorGroup.LoadFailures. Loading stays always best-effort (as on main); checks/up stay strict and ignore the slice. - api: GeneratorGroup.loadFailures ([String!]!), gated AfterVersion(v1.0.0-0) and kept out of base_schema.json; carried through Clone and persistence. - cli: --require-load turns tolerated load failures fatal (enforced CLI-side, before running or applying). The per-module skip warning is emitted engine side (console + slog.Warn), so the CLI does not double-warn. Signed-off-by: Yves Brissaud <[email protected]>
Run 'dagger --x-release=v1.0.0-beta.5 generate -y' to refresh the committed generated artifacts (SDK clients for go/python/typescript/elixir/php/rust, the GraphQL schema doc, and the CLI reference) for the new GeneratorGroup.loadFailures field and the generate --require-load flag. Signed-off-by: Yves Brissaud <[email protected]>
Best-effort `dagger generate` skips a workspace module that fails to load and generates the rest. Report each skip the way the TUI reports a check that did not pass: reportSkippedModule opens a short span named by the module, marked failed and revealed, so it renders as a concise red row with the load error nested — lifted into the zoomed generators view — instead of the verbose console/log line it replaces. The CLI keeps reading loadFailures only to enforce --require-load, whose error is now a terse count since the per-module detail is in the spans. Signed-off-by: Yves Brissaud <[email protected]>
A successful `dagger generate` (best-effort skips don't fail it) collapses its completed telemetry when the pretty TUI exits, so the live skip rows vanish after the Apply prompt. Mirror the checks machinery with a dedicated generate report: tag each skipped-module span with GenerateSkippedAttr, gate the final render on DB.HasGenerateReport(), and render a persisted "SKIPPED MODULES" section listing each skipped module with its load error -- so the user still sees what was left out on exit 0. Signed-off-by: Yves Brissaud <[email protected]>
984598b to
32d30ff
Compare
|
For the record, past discord discussion: https://discord.com/channels/707636530424053791/1003718839739105300/1522248699328200835 |
Signed-off-by: Yves Brissaud <[email protected]>
| } | ||
| } | ||
| rows := strings.Split(strings.TrimSuffix(buf.String(), "\n"), "\n") | ||
| return append([]string{reportHeadingLine(out, "SKIPPED MODULES")}, rows...) |
There was a problem hiding this comment.
The CHECKS header carries a ✘ N failed tally (checksHeaderLine); consider giving this one ✘ N skipped for parity, since every row here is a failure.
TomChv
left a comment
There was a problem hiding this comment.
Nice — the checks-report analogue for skipped modules is a clean fit and the engine plumbing is tidy.
Pretty-TUI coverage: the SKIPPED MODULES final render is only covered by a unit test with a hand-built non-zoomed DB; the integration tests use --progress=plain and skip FinalRender. Since generateReport returns nil when zoomed, did you confirm end-to-end that a plain (pretty) dagger generate exit-0 run actually shows the section? (I expect yes — checksReport uses the same guard and works — just want to be sure.)




Builds on the best-effort workspace module load for generators that landed on main (44dd632):
dagger generateskips a workspace module that can't load and generates the rest, instead of aborting — so it can regenerate the very files a module needs to load.check/upstay strict.This PR layers on top of that:
GeneratorGroup.loadFailures: [String!]!— the collected per-module load errors for the modules that were skipped (empty when all loaded). New public workspace API, gatedView(AfterVersion("v1.0.0-0"))and kept out ofbase_schema.json.dagger generate --require-load— opt back into strict: fail if any workspace module could not be loaded, instead of skipping it. Default stays best-effort.Generator-execution failures (a module loads but its generator fails) remain fatal in both modes.
Design doc:
hack/designs/done/generate-resilient-module-loading.md