fix: compare review diagrams against target baseline#39
Conversation
When depth_level input is empty (new default), the action reads metadata.depth_level from the committed .codeboarding/analysis.json: - sync mode: from the working-tree checkout - review mode: from the PR base SHA via git show Falls back to 2 when no baseline exists or the field is missing. An explicit depth_level input always overrides auto-detection.
Architecture review · 14 components changedgraph LR
n_Analysis_Orchestrator["Analysis Orchestrator"]
n_Structural_Diffing_Engine["Structural Diffing Engine"]
n_Mermaid_Visualization_Engine["Mermaid Visualization Engine"]
n_UX_Integration_Layer["UX #38; Integration Layer"]
n_Analysis_Orchestrator -- "triggers health checks and status reporting" --> n_UX_Integration_Layer
n_Structural_Diffing_Engine -- "provides structural change data for rendering" --> n_Mermaid_Visualization_Engine
n_Structural_Diffing_Engine -- "supplies change detection flags and diff summar…" --> n_UX_Integration_Layer
n_Mermaid_Visualization_Engine -- "queries specific file changes for component map…" --> n_Structural_Diffing_Engine
n_UX_Integration_Layer -- "filters visual noise for final presentation" --> n_Mermaid_Visualization_Engine
n_Mermaid_Visualization_Engine -- "provides component change counts for summary re…" --> n_UX_Integration_Layer
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_Structural_Diffing_Engine,n_Mermaid_Visualization_Engine modified;
linkStyle 1,2,3,4 stroke:#7d4e00,stroke-width:2px;
linkStyle 5 stroke:#82071e,stroke-width:2px,stroke-dasharray:5 3;
Colors indicate component changes compared to Download the PR analysis artifacts from this workflow artifact. Structural Diffing Engine : 1 file changed
Mermaid Visualization Engine : 1 file changed
Explore this PR’s architecture in your browser or VS Code. codeboarding-action · run 27653739150 |
Amp-Thread-ID: https://ampcode.com/threads/T-019ed0f0-d9f9-75da-a034-cbfda2dcd6d1 Co-authored-by: Amp <amp@ampcode.com>
84d24a3 to
b3fecba
Compare
Amp-Thread-ID: https://ampcode.com/threads/T-019ed0f0-d9f9-75da-a034-cbfda2dcd6d1 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ed0f0-d9f9-75da-a034-cbfda2dcd6d1 Co-authored-by: Amp <amp@ampcode.com>
# Conflicts: # action.yml
| "&": "#38;", | ||
| '"': "#34;", | ||
| "<": "#60;", | ||
| ">": "#62;", |
There was a problem hiding this comment.
These were causing friction and were the reason why we wound't render properly the diff.
| HEAD_REPO="$PULL_HEAD_REPO" | ||
| EMPTY_BASE="false" | ||
| FORK_COMPARE="false" | ||
| if [ "$HEAD_REPO" != "$BASE_REPO" ]; then |
There was a problem hiding this comment.
This for some really odd reason was comparing with the main of the real repo and not the main of the fork.
Hopefully this is resolved now.
This action.yml is getting to be quite big. I would flag it for refactor, slim-down, weight loss program.
There was a problem hiding this comment.
I'm wondering, how did you even verify this is working? I suppose you saw that the high level components between the action and the webview are the same?
I'm looking at 14 components changed, then opening the webview, where I see 2 high level component changed and 7 lower lvl components modified.
The webview is still quite off with the actual modifications, I'm wondering if you've seen these and if you have an assumption where these are coming from?
Amp-Thread-ID: https://ampcode.com/threads/T-019edb41-a138-74fd-8544-fb4699a065bf Co-authored-by: Amp <amp@ampcode.com>
ivanmilevtues
left a comment
There was a problem hiding this comment.
I am merging this so I can continue with the investigation and will do a new PR for that.
Ivan's comment:
There was an issue with the mermaid renders, that is fixed. I stumbled across another issue which was related to forks, we used to check with the real repo instead of our fork (fixed).
Example PR:
ivanmilevtues/optimizerDuck#1
Summary
.codeboarding/analysis.jsonfrom the PR target/base commit, not PR-head history#amp;/#quot;forms to GitHub-compatible numeric refs (#38;,#34;, etc.)Root cause
The deployed action searched backwards through the PR head branch for
.codeboarding/analysis.json. If the target branch had a synced baseline that was not present in the PR branch history, review mode missed it and regenerated a fresh base analysis. That made the diagram compare fresh-base output against fresh-head output instead of comparing against the versioned target-branch baseline.For CodeBoarding/MORT PR #2, the workflow log showed exactly that fallback and produced
n_changed: 0, even though comparingmain:.codeboarding/analysis.jsonagainst the generated PR artifact produced changes.Validation
Local:
GitHub checks on this PR:
Tests / unittest✅Tests / lint✅CodeBoarding review / review✅MORT integration test:
CodeBoarding/CodeBoarding-action@fix/review-target-baselineThat run later stopped because the hosted/free-tier quota returned
402 Resource exhausted, so it did not complete a final MORT diagram, but it did verify the critical corrected path: the action now reads the target/base branch baseline.