Skip to content

Add --max-label flag to diff_to_mermaid#3

Open
brovatten wants to merge 6 commits into
mainfrom
test/new-pr-smoke
Open

Add --max-label flag to diff_to_mermaid#3
brovatten wants to merge 6 commits into
mainfrom
test/new-pr-smoke

Conversation

@brovatten
Copy link
Copy Markdown
Member

Small standalone PR to verify the architecture-diff action fires on a fresh PR. Exposes --max-label to control edge-label truncation length (default 48). The action should post an architecture-diff comment below.

brovatten added 6 commits June 3, 2026 15:24
…t-in)

Replaces the webview/Playwright PNG approach with an inline Mermaid diagram
that GitHub renders natively in the PR comment — no image, no orphan branch,
no contents:write, and fork-friendly.

How it works:
- Resolve a base ("before") analysis: use the committed
  .codeboarding/analysis.json at the PR base if present, else generate one via
  a full engine run on the base commit.
- Analyze the PR head incrementally, seeded from the base (stable component
  ids), falling back to a full run on cache miss.
- scripts/diff_to_mermaid.py diffs the two analyses (name-based matching;
  relation label change => modified) and emits a graph LR with nodes colored
  via classDef/class and arrows via positional linkStyle: green added, yellow
  modified, red dashed deleted. Escaping, deleted-namespace keying, and a size
  guard (GitHub's ~500-edge / 50k-char cap -> changed-only or text fallback).

Rendering:
- Level 1 (flat, top-level) is the default — readable inline, never trips the
  size cap.
- nested: true draws depth>1 sub-components as subgraphs (leaf nodes filled,
  parent containers outlined). Optional --font-size/--node-padding/spacing emit
  an %%{init}%% directive to enlarge nodes.

scripts/run_local.sh mirrors the action for local iteration (fast diff-only or
full pipeline) and writes a browser HTML preview rendered with mermaid.js.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Architecture review · 7 components changed

graph LR
    n_Action_Orchestrator["Action Orchestrator"]
    n_Structural_Analysis_Engine["Structural Analysis Engine"]
    n_Mermaid_Syntax_Renderer["Mermaid Syntax Renderer"]
    n_Data_Sanitization_Identity_Provider["Data Sanitization & Identity Provider"]
    del_Environment_Context_Resolver["Environment & Context Resolver"]
    del_Remote_Job_Orchestrator["Remote Job Orchestrator"]
    del_Artifact_Result_Processor["Artifact & Result Processor"]
    n_Action_Orchestrator -- "Initiates the comparison" --> n_Structural_Analysis_Engine
    n_Action_Orchestrator -- "Passes the structural delta" --> n_Mermaid_Syntax_Renderer
    n_Structural_Analysis_Engine -- "Uses identity services" --> n_Data_Sanitization_Identity_Provider
    n_Mermaid_Syntax_Renderer -- "Utilizes sanitization logic" --> n_Data_Sanitization_Identity_Provider
    n_Action_Orchestrator -- "calls" --> n_Data_Sanitization_Identity_Provider
    del_Environment_Context_Resolver -- "passes resolved repository URL and branch to in…" --> del_Remote_Job_Orchestrator
    del_Remote_Job_Orchestrator -- "hands off JSON response containing full job res…" --> del_Artifact_Result_Processor
    del_Artifact_Result_Processor -- "writes extracted documentation data to runner f…" --> del_Artifact_Result_Processor
    del_Remote_Job_Orchestrator -- "manages job configuration and polls for status…" --> del_Remote_Job_Orchestrator
    classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
    classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
    classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
    class n_Action_Orchestrator,n_Structural_Analysis_Engine,n_Mermaid_Syntax_Renderer,n_Data_Sanitization_Identity_Provider added;
    class del_Environment_Context_Resolver,del_Remote_Job_Orchestrator,del_Artifact_Result_Processor deleted;
    linkStyle 0,1,2,3,4 stroke:#0b5d23,stroke-width:2px;
    linkStyle 5,6,7,8 stroke:#82071e,stroke-width:2px,stroke-dasharray:5 3;
Loading

Colours indicate components that have been 🟩 added · 🟨 modified · 🟥 removed — versus main.


🔍 This is the flattened map. Explore this diff live in your browser →

💡 Prefer your editor? Get the CodeBoarding VS Code extension →

codeboarding-action · run 26894341048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant