Repository navigation
checks and cli: finish #14802's follow-ups, never lose a check's final state, discover filter flags in the command's session - #15037
Merged
Merged
Conversation
A scale-out check reports its span from the remote engine. When the request to that engine fails, the check never runs there, and no failed check appeared in the report. Report it locally in that case. Signed-off-by: Erik Sipsma <[email protected]>
Each parallel.Jobs builder method copies the whole job list, and the loop called three of them per artifact, so preparing a large selection copied quadratically. Configure each job from empty defaults and append it once to a preallocated list. Signed-off-by: Erik Sipsma <[email protected]>
Under a result scope, preselect scoped the selector's inputs and then scoped every argument again after the dynamic input hook, loading each object argument twice. Skip arguments the hook left as scoped. Signed-off-by: Erik Sipsma <[email protected]>
Grouping searched the batch's key list for every selected item, which is quadratic for large collections of older modules. Signed-off-by: Erik Sipsma <[email protected]>
A fresh check run rolls its exec output up into the check. A cached failure has no exec spans in this trace, so the check showed only the error. Replay the output its error retained. Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
The dynamic input hook can replace an argument in place in the shared argument list. Recording the scoped arguments after it ran treated a replacement as already scoped. Record them before the hook. Signed-off-by: Erik Sipsma <[email protected]>
Reading pass and then error on a never-cached check ran it twice, and the two reads could disagree. Keep the function's cache inputs on the check projection, as before, so each request still gets a fresh check, and let every read of one check share its run. Artifacts.asChecks is no longer cached, so each selection gets its own checks. Signed-off-by: Erik Sipsma <[email protected]>
A workspace can install a module under another name, as dagger/dagger installs dagger/go as golang. Check that an item check taking its enclosing collection is still listed and runs. Signed-off-by: Erik Sipsma <[email protected]>
dagger/go#84 has merged. Pin its merge commit instead of the PR's head, so CI's Go checks run the runner as released on dagger/go main. CI's check discovery now lists the runner's Go test check, which takes the selected collection, so the tests run again. Signed-off-by: Erik Sipsma <[email protected]>
When a run ends, the frontend marks spans still running as canceled. The CHECKS and GENERATORS sections showed such a span as passed, so a failed check whose final state had not reached the CLI read as OK and counted as passed. Show it as not reported, counted apart. Signed-off-by: Erik Sipsma <[email protected]>
When the trace ends, the frontend marks spans still running as canceled. A span whose final export arrived after that kept the flags, so a check that passed late showed as not reported. Clear them when the final export arrives; its attributes restore an explicit cancellation. Signed-off-by: Erik Sipsma <[email protected]>
`dagger check` could report failed checks as OK, a different set each run, while its error list and exit code were right. The engine ended every check span as failed, but some final states never reached the report. The CLI forwards every span the engine streams to it into the frontend through telemetry.Init's LiveTraceExporters, which wraps the frontend in an OTel batch span processor with the default 2048-slot queue. That queue drops spans when it is full. A big run streams tens of thousands of span snapshots, so a burst, such as hundreds of checks ending at once, could overflow it. A check whose final snapshot was dropped stayed running in the frontend, and the report showed it as OK. Give the frontend its own large-queue live span processor that waits for queue space instead of dropping, as the frontend's logs already do. Forwarded engine spans then wait in the engine's store until the CLI reads them. The Cloud and OTEL_* hops stay best-effort. Signed-off-by: Erik Sipsma <[email protected]>
dagger check, generate and list opened one session to discover the workspace's filter flags, closed it, then opened a second for the command, which loaded the workspace's modules again. When such a command will run, open its frontend, telemetry and session before Cobra parses the command line, discover the flags as the session's first request, then run Cobra in that session. The command's engine call takes the open session, or connects a new one under the same frontend when it asks for different params. start, shell and agent keep two sessions: they change the frontend's options or read stdin before connecting. Signed-off-by: Erik Sipsma <[email protected]>
Since filter discovery opens the command's frontend before Cobra runs, what Cobra writes outside the command's engine call went into that frontend's span logs: an available-update notice was lost once the command set another primary span, and signing in again after a malformed credentials file hid its instructions. Check the Cloud token before the frontend starts, buffer Cobra's writes outside the engine call and print them once the frontend is done, and let a command line that still doesn't parse after discovery fail in Cobra after the frontend, as before. Test that a filtered check and a typed listing each connect once. Signed-off-by: Erik Sipsma <[email protected]>
A command line Cobra rejects after discovery is reported once the discovery's frontend ends, which --no-exit holds open until the user quits. Keep --no-exit on its own discovery session, as before. Signed-off-by: Erik Sipsma <[email protected]>
The report progress colors its marks, and a separate discovery session shows one connect too, inside its own step. Strip the colors and check the one connect comes before discovery. Signed-off-by: Erik Sipsma <[email protected]>
preselect grew past golangci-lint's complexity limit when it learned to skip selector inputs the dynamic input hook left scoped. Move that loop into scopeDynamicInputs, unchanged. Signed-off-by: Erik Sipsma <[email protected]>
prepareArtifactCommands grew past golangci-lint's complexity limit when it learned to run discovery in the command's own session. Move the choice and the command's params into sessionDiscovery, unchanged. Signed-off-by: Erik Sipsma <[email protected]>
…ty changes Signed-off-by: Erik Sipsma <[email protected]>
grouville
self-requested a review
November 2, 2026 21:43
grouville
approved these changes
Nov 2, 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.
This collects three changes to checks and the CLI, plus the changelog entries for #15035. Each kept its own commits. They touch some of the same files, so they're reviewed and merged together.
1. Follow-ups to #14802 (artifact filters on collection views)
Fixes found while reviewing #14802 after it merged:
passand thenerroron such a check ran it twice, and the two reads could disagree. Each request still gets a fresh check, as before.Artifacts.asChecksis no longer cached, so each selection gets its own checks.asGenerators;golang.dagger.tomlpinned go: run selected tests once per module go#84's branch head. Remove build dependency on cue cli #84 has merged, so the pin moves to its merge commit,552271d5. CI's check discovery lists that runner's Go test check, as main's CI already does with the old pin, so CI runs the Go tests on the merged runner.2. Never drop engine spans on the way to the frontend
dagger checkcould report failed checks as OK, a different set each run, while its error list and exit code were right. The engine ended every check span as failed, but some final states never reached the report.The CLI passed every span the engine streams to it into the frontend through a queue of 2048 that silently drops spans when it's full. A big run streams tens of thousands of span snapshots, so a burst such as hundreds of checks ending at once overflowed it. A check whose final snapshot was dropped stayed "running", and the report showed it as OK.
The frontend now gets its own span processor, which waits for queue space instead of dropping, as the frontend's logs already do. The engine's spans wait in the engine until the CLI reads them. The Cloud and
OTEL_*exporters stay best-effort.Measured with a reproduction of 400 failing checks, 12 runs on each side, on one machine:
TestEngineSpanBurstReachesFrontendforwards a burst of 32,769 finished spans the way the CLI does. Without the fix, only 2,560 reach the frontend.One known limit: while the CLI's output isn't being read, Ctrl-C can't stop it, because the queue waits for space.
3. Discover filter flags in the command's own session
Filter flags such as
--gocome from the workspace's modules, so the CLI can't parse them until it has asked the engine which flags exist.dagger check,dagger generateanddagger list <type>did that in a separate session, closed it, and then opened a second session for the command. The second session loaded the workspace's modules again, because the engine identifies the host workspace per session.Now, when one of these commands is about to run (not
--help, not shell completion), the CLI first opens the command's own progress output, telemetry and session. It discovers the flags as that session's first request, then lets Cobra parse and run the command inside it. The command's engine call takes the open session, with the modules already loaded.dagger check --go --check test -l --allgot 0.18–0.19 s faster on a warm engine and 0.38 s faster on a fresh one.check --scale-out, gets a new session under the same progress output.start,shellandagent, which set the progress output's root filter, read piped stdin, or prompt before connecting;--no-exit.Changelog for #15035
#15035 (faster module evaluation and collection listings) merged without its changelog entries. They're here as one commit, written for #15035's changes:
+cache="never"ancestor no longer fails when the ancestor returns different keys on another run.Lint
Two functions grew past golangci-lint's complexity limit,
preselectin dagql andprepareArtifactCommandsin the CLI. Each now has one step extracted into its own function, unchanged.Validation
On this branch, with the dev engine:
All pass. Counts are from each run's live summary:
./internal/cmd/daggerwith-race./corewith-race./core/schemawith-race./dagqlwith-race./dagql/daguiwith-race./dagql/idtuiwith-raceTestArtifactsTestCollectionsTestChecksTestGeneratorsBefore the rebase, with the dev CLI and engine,
dagger check -l "golang/**"lists the Gotestcheck on the new pin.dagger check "golang/**/test" --golang-module=hack/sdl-diff --golang-package=hack/sdl-diffpasses its 17 checks.