Nest child group spans under their dependent group's span (#172)#346
Draft
rubberduck203 wants to merge 1 commit into
Draft
Nest child group spans under their dependent group's span (#172)#346rubberduck203 wants to merge 1 commit into
rubberduck203 wants to merge 1 commit into
Conversation
`RunGroups::execute` parented every group's tracing span directly to `doctor run`, regardless of `requires`, so a group's dependencies showed up as siblings after it instead of nested inside its span. Replace the flat traversal with a `RunGraph` (a DAG reconstructed from the planned run order and each group's `requires`) and walk it recursively, opening a dependent's span before its dependencies so it temporally encloses them. Roots parent to `doctor run`; a dependency shared by more than one group still runs once, nested under whichever dependent reaches it first. Also closes two gaps a review of this change surfaced: a `requires` cycle (unvalidated anywhere today) previously left every member unreachable from any root and silently dropped from the run, and a group missing from `group_actions` would have orphaned its entire dependency subtree instead of just itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
RunGroups::executeparented every group's tracing span directly todoctor runregardless ofrequires, so dependencies showed up as siblings after their dependent instead of nested inside its span (Telemetry: Child group spans aren't properly nested #172). Replaced the flat traversal with aRunGraph— a DAG reconstructed from the planned run order and each group'srequires— and walk it recursively, opening a dependent's span before its dependencies so it temporally encloses them.doctor run; a dependency shared by more than one group still runs exactly once, nested under whichever dependent reaches it first.requirescycle (unvalidated anywhere today) previously left every member of the cycle unreachable from any root and silently dropped it from the run while still reporting success; a group missing fromgroup_actionswould have orphaned its entire dependency subtree instead of just itself.Test plan
cargo test— 205/205 passing, including 12 new tests (RunGraphunit tests, diamond/multi-root/fail-fast/cycle/missing-container behavior tests, and two span-nesting tests using a purpose-builttracingcapture layer)cargo clippy -- -D warningsandcargo fmt --all -- --checkcleangroup mvceis the parent ofgroup child-groupand temporally encloses it (217484–217595 vs. 217504–217544)🤖 Generated with Claude Code