Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 4a0e4bb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## codex/common-render-pipeline-2-dagre #7808 +/- ##
=======================================================================
- Coverage 2.94% 2.93% -0.01%
=======================================================================
Files 655 655
Lines 69675 69837 +162
Branches 978 978
=======================================================================
+ Hits 2052 2053 +1
- Misses 67623 67784 +161
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
…agre' into codex/common-render-pipeline-3-dagre-phases
…-render-pipeline-3-dagre-phases
…/common-render-pipeline-4-dagre-layoutdata
…odex/common-render-pipeline-5-dagre-shared-paint
… codex/common-render-pipeline-6-dagre-shared-nodes
… codex/common-render-pipeline-6-dagre-shared-nodes
… codex/common-render-pipeline-6-dagre-shared-nodes
…agre-shared-nodes' into codex/common-render-pipeline-6-dagre-shared-nodes
…/common-render-pipeline-4-dagre-layoutdata
…odex/common-render-pipeline-5-dagre-shared-paint
… codex/common-render-pipeline-6-dagre-shared-nodes
… codex/common-render-pipeline-6-dagre-shared-nodes
knsv-bot
left a comment
There was a problem hiding this comment.
[sisyphus-bot]
Review of Common Render pipeline 3: DAGRE phase 3 (stacked on codex/common-render-pipeline-2-dagre).
Verdict: APPROVE — no blocking or important findings, nits and suggestions only. (Posted as a comment because GitHub does not allow the authoring account to formally approve its own PR.)
What's working well
- 🎉 [praise] The contract test in
dagre/index.spec.jsis exactly right for this refactor — assertingnode('A').xisundefinedaftermeasureDagreLayoutand a number only afterrunDagreLayoutCoreproves the phase boundary instead of just exercising it. The companion test for the fail-fast error closes the loop. - 🎉 [praise] Converting
recursiveRender's six positional args into a named-options object (renderDagreSubgraph) is a real readability win, and the explicit throw inrunDagreLayoutCorewith a clear message beats the silent misbehavior we'd otherwise get from running layout on an unmeasured graph. - 🎉 [praise] Full CI green including all five e2e shards and an approved Argos build — for a
rendering-util/change that's the signal that matters. Verified separately that nothing outsidedagre/index.jsimports the renamed/re-contracted exports, and recursion correctly stays local to DAGRE as described.
Security
XSS sub-agent review: no XSS or injection issues identified. The dagre change is a pure restructure (no new string-to-DOM paths; all DOM insertion still flows through the existing insertNode/insertEdge* helpers behind the unchanged sanitization boundary). The new usesLegacyFontAwesomeSyntax regex is linear-time (no ReDoS) and its output only gates a hardcoded CDN URL.
Things to address (all non-blocking)
- 💡 [suggestion]
measureDagreLayoutpasses its result to the core phase by mutatingprepared.measuredLayout(dagre/index.js:656) — a hidden side channel that exists only becauserunLayoutCorereceivesCommonLayoutRenderContext, which has nomeasurefield, even though the common renderer computesmeasureimmediately before calling it (common/index.ts:124-125). For a follow-up phase PR, consider extending the core-phase context with the measure result so the dependency is explicit in the contract and the runtime throw becomes structurally unnecessary. Fine as-is for this PR since changing the shared contract deserves its own change. - 🟢 [nit]
paintDagreLayout'scoreResult ?? measurefallback (dagre/index.js:672):runDagreLayoutCorealways returns the measured layout or throws, so the fallback is unreachable through the renderer — and if paint ever did run without the core phase, painting an un-laid-out graph (nox/y) should fail loudly rather than proceed. Worth dropping the?? measure. - 🟢 [nit] In
measureDagreLayout(dagre/index.js:645-657), ifpreparedLayoutis absent the measure is stashed on a locally createdpreparedthat nothing can reach, sorunDagreLayoutCorewould throw even though measurement ran. Unreachable today (prepareLayoutis always registered), but a short comment noting the assumption would help the next reader. - 🟢 [nit]
cypress/platform/viewer.js:19— the legacy FontAwesome pattern covers every syntax variant currently in the suite (fa:/fab:prefixes and::icon(fa fa-book)), which I verified by grepping the specs. One gap:::icon(fab fa-x)would not match (fa\bdoesn't match insidefab, and the first alternative requires a colon), so a future test using that form would silently render without the FA font. Consider widening to::icon\(\s*fa[bklrs]?\b. Also, an explicittypeof code === 'string'guard would make the recursion robust to arbitrary?graph=JSON shapes. - 💡 [suggestion] The two cypress changes (conditional FA CDN loading, 15s
renderedtimeout) are test-infra hardening unrelated to the DAGRE phase split. Totally reasonable to keep the stack's CI stable, but a sentence in the PR description explaining why they ride along would help future archaeology.
The missing changeset is correct here — internal refactor with no user-facing behavior change, so the changeset-bot warning can be ignored.
Nice, clean step in the pipeline series — happy to see this one land. 🚀
Address review feedback on the LayoutData normalization: - Document that applyDagreLayoutResult only normalizes the top-level graph: recursive cluster children and intra-cluster edges live in the nested cluster graph and are owned by the recursive paint path, and unmerged self-loop segments replace the original self-edge. - Pin the recursive-cluster behavior with a unit test so the next pipeline phase does not build on assumptions the data does not satisfy. - Note on DAGRE_NODE_LAYOUT_PROPERTIES that the allowlist must stay a fixed literal list (graph keys are user-controlled) and why the intersect function references are copied. - Rename the now-used _data4Layout parameter in runDagreLayoutCore.
…odex/common-render-pipeline-5-dagre-shared-paint
… codex/common-render-pipeline-6-dagre-shared-nodes
…cleanups - Add changeset documenting the class.defaultRenderer switch to the unified (dagre-wrapper) renderer - Drop the shared EMPTY_CLUSTER_DB singleton in favor of a fresh Map per paint call to avoid a mutable module-level default - Document why class.padding is intentionally left undefined in defaultConfig - Add hand-drawn self-referential class diagram e2e snapshot test
…-6-dagre-shared-nodes Common Render pipeline 6: DAGRE shared node measurement
…-5-dagre-shared-paint Common Render pipeline 5: DAGRE shared paint
…-4-dagre-layoutdata Common Render pipeline 4: DAGRE LayoutData normalization
…agre' into pr-7808-fix # Conflicts: # docs/config/setup/defaultConfig/variables/configKeys.md # docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md # docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md # docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md # docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md # docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md
a0449a4
into
codex/common-render-pipeline-2-dagre
Summary
Validation