Repository navigation
fix: render multi-parent groups once in the dependency tree - #78
7 commits merged into
Conversation
|
Warning Review limit reachedNext included review available in 51 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
_render_dag and _render_dag_markdown walked the DAG as a tree, so a group with several parents (and its whole subtree, and its '<-- this PR' marker) appeared once per parent. The merge node is now drawn in full under its last-listed parent with '(also depends on: ...)' and referenced as '(see below)' under the others.
282915e to
b701c9f
Compare
The '(see below)' stub was placed under every parent except depends_on[-1], but the DFS visits parents in group order, so the stub could appear after the full node. Render in full under the last parent actually visited and drop the unreachable 'rendered' guard.
A parent that is never visited (it depends on an unknown group) left its child stubbed forever with no full rendering. Compute the pending set from a root-first reachability walk.
Tracking 'done' parents was wrong in both directions (a mid-walk ancestor is neither done nor pending). Count visits instead: every reachable parent is drawn exactly once, so a child is stubbed until its final visit and drawn in full there.
|
Reworked after local review: the renderers now count distinct reachable parents per node and draw a multi-parent node in full on its last visit, stubbing it as |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015rnEEjXWDBdePRhKMmZr1w
Problem
Both DAG renderers (
_render_dagfor the terminal,_render_dag_markdownfor the PR body) recurse from each parent to its children, so a group with more than one parent is emitted once per parent — along with its entire subtree and, in the PR body, the<-- this PRmarker. For a diamondpr-1 → {pr-2, pr-3} → pr-4 → pr-5the "Merge in this order" block listedpr-4andpr-5twice and marked "this PR" twice, which reads as two different PRs.Fix
A merge node is drawn in full exactly once, under its last-listed parent, annotated
(also depends on: <other parents>); under every other parent it appears as a one-line<id>: <title> (see below)reference so the reader still sees the edge._render_dag(rich tree) gets the same treatment.Tests
Diamond with a node below the merge: marker appears once, full merge node once,
(see below)once, descendant once — for both renderers. 447 tests pass, ruff clean.