You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: compare review diagrams against target baseline (#39)
* feat: auto-detect depth_level from committed baseline
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.
* fix: compare review diagrams against target baseline
Amp-Thread-ID: https://ampcode.com/threads/T-019ed0f0-d9f9-75da-a034-cbfda2dcd6d1
Co-authored-by: Amp <amp@ampcode.com>
* fix: recreate broken cached uv venv before install
Amp-Thread-ID: https://ampcode.com/threads/T-019ed0f0-d9f9-75da-a034-cbfda2dcd6d1
Co-authored-by: Amp <amp@ampcode.com>
* fix: stop caching uv virtualenv
Amp-Thread-ID: https://ampcode.com/threads/T-019ed0f0-d9f9-75da-a034-cbfda2dcd6d1
Co-authored-by: Amp <amp@ampcode.com>
* Small changes in wording so it is clearer.
* fix: move engine adapter imports to module scope
Amp-Thread-ID: https://ampcode.com/threads/T-019edb41-a138-74fd-8544-fb4699a065bf
Co-authored-by: Amp <amp@ampcode.com>
---------
Co-authored-by: Amp <amp@ampcode.com>
Copy file name to clipboardExpand all lines: README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
One action, two modes: architecture review on every pull request, and a versioned, always-current architecture baseline on your main branch.
4
4
5
-
-**`mode: review`** (the default) — CodeBoarding analyzes your architecture before and after a change, comments on the PR with an inline Mermaid diagram and hosted webview link, and uploads the PR-head `analysis.json` plus base-commit metadata as a GitHub Actions artifact. It never commits generated files to the PR branch. Runs on `pull_request` and `issue_comment`.
5
+
-**`mode: review`** (the default) — CodeBoarding analyzes your architecture on the target branch and PR branch, comments on the PR with an inline Mermaid diagram and hosted webview link, and uploads the PR-head `analysis.json` plus target-branch metadata as a GitHub Actions artifact. It never commits generated files to the PR branch. Runs on `pull_request` and `issue_comment`.
6
6
-**`mode: sync`** — CodeBoarding keeps your architecture analysis versioned and current on your branch: on every push it commits the `analysis.json` baseline, `static_analysis.pkl` cache pair, health report, and readable markdown (`.codeboarding/*.md`), so reviews diff against your current architecture and your architecture has real git history. Runs on `push`, `workflow_dispatch`, and `schedule`. See [sync mode](#keep-your-architecture-versioned-sync-mode).
7
7
8
8
Both modes run the [CodeBoarding](https://github.com/CodeBoarding/CodeBoarding) engine in CI: static analysis combined with LLM reasoning. They are designed to be used together — [sync mode keeps the baseline fresh that review mode diffs against](#how-the-two-modes-work-together) — but each works on its own.
@@ -20,10 +20,10 @@ Both modes run the [CodeBoarding](https://github.com/CodeBoarding/CodeBoarding)
20
20
21
21
## What review mode does
22
22
23
-
- Builds or reuses a baseline architecture analysis for the PR base.
23
+
- Builds or reuses a baseline architecture analysis for the target branch tip the PR is opened against.
24
24
- Runs incremental analysis on the PR head, then diffs components and relationships.
25
25
- Posts a sticky PR comment with an inline Mermaid map. Green is added, yellow is modified, red (dashed) is deleted, for both nodes and edges.
26
-
- Uploads the PR-head `analysis.json` plus base-commit metadata as a GitHub Actions artifact and links the hosted webview to that artifact instead of committing generated files to the PR branch.
26
+
- Uploads the PR-head `analysis.json` plus target-branch metadata as a GitHub Actions artifact and links the hosted webview to that artifact instead of committing generated files to the PR branch.
27
27
28
28
A PR comment looks like this:
29
29
@@ -234,7 +234,9 @@ Behavior worth knowing:
234
234
235
235
### How the two modes work together
236
236
237
-
Sync mode keeps the committed `.codeboarding/analysis.json` baseline fresh on main. Review mode reuses that committed baseline for the PR base, so PR reviews diff against your *current* main architecture and run incrementally instead of rebuilding a base from scratch — faster and cheaper per PR.
237
+
Sync mode keeps the committed `.codeboarding/analysis.json` baseline fresh on main. Review mode reuses that committed baseline from the target branch tip, so PR reviews diff against your *current* main architecture and run incrementally instead of rebuilding the target analysis from scratch — faster and cheaper per PR.
238
+
239
+
For fork PRs, review mode compares the PR branch against the fork's branch with the same name as the PR target branch. For example, a PR opened into `upstream/main` from `alice:feature` compares `alice:main` to `alice:feature` when `alice:main` exists. If the fork comparison branch has no committed `.codeboarding/analysis.json`, review mode uses an empty baseline and renders the PR architecture as newly added instead of silently comparing against upstream's baseline.
238
240
239
241
Leave `depth_level` empty unless you are choosing the depth for a first run or an intentional `force_full` rebuild. After a baseline exists, the committed `analysis.json` records the depth the engine should continue using, so review and sync mode do not need duplicate depth-selection logic.
240
242
@@ -272,7 +274,7 @@ Review mode does not need `contents: write`: PR-specific generated files are sto
272
274
|`comment_header`| review |`Architecture review`| Heading for the PR comment. |
273
275
|`trigger_command`| review |`/codeboarding`| Slash command for trusted on-demand runs. |
274
276
|`cta_base_url`| review | empty | Click-proxy base URL: deep-links the editor link into VS Code/Cursor and adds a "get the extension" link (tracks owner/repo/pr). Empty links to the extension listing instead (GitHub strips `vscode:`/`cursor:` from comments). |
275
-
|`webview_base_url`| review |`https://app.codeboarding.org`| Hosted webview base URL. The PR comment links to an artifact-backed head-vs-base architecture diff. Set empty to disable the browser link. |
277
+
|`webview_base_url`| review |`https://app.codeboarding.org`| Hosted webview base URL. The PR comment links to an artifact-backed head-vs-comparison-branch architecture diff. Set empty to disable the browser link. |
276
278
|`output_dir`| sync |`.codeboarding`| Directory the rendered docs and analysis metadata are committed to. Owned by the action: pre-existing top-level `.md` files in it are deleted on every run. |
277
279
|`output_format`| sync |`.md`| Output format. Only `.md` is supported. |
278
280
|`target_branch`| sync |`${{ github.ref_name }}`| Branch the generated docs are pushed to. |
@@ -287,7 +289,7 @@ Review mode does not need `contents: write`: PR-specific generated files are sto
287
289
|`diagram_md`| review | Path to the generated Mermaid markdown block on the runner. |
288
290
|`n_changed`| review | Number of changed components, counted recursively. |
289
291
|`truncated`| review |`true` when the graph was reduced to fit GitHub Mermaid limits. |
290
-
|`review_artifact_url`| review | GitHub Actions artifact URL containing the PR-head `analysis.json` and base-commit metadata. |
292
+
|`review_artifact_url`| review | GitHub Actions artifact URL containing the PR-head `analysis.json` and comparison-branch metadata. |
291
293
|`analysis_mode`| sync |`full` or `incremental`: whether the run rebuilt the analysis from scratch or reused the committed baseline. |
292
294
|`files_written`| sync | The generated files written for the docs commit. |
293
295
|`committed`| sync |`true` when a docs commit was pushed to `target_branch`; `false` when sync mode ran but had nothing to commit (or the push failed open). Empty only if sync mode did not run. |
0 commit comments