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
{{ message }}
Repository navigation
Commit 7faec55
Browse filesBrowse the repository at this point in the historyBrowse files
Add filesystem-state branch findings to app graph design
- Link orphan branch pattern to GitHub Actions Workspace design
- Document gitstate package reuse opportunity
- Detail run-time graph persistence via rad shutdown
- Expand alternatives table with cache/artifacts options
- Update open question on rad shutdown integration
Copy file name to clipboardExpand all lines: eng/design-notes/resources/2026-04-app-graph.md
+22-4Lines changed: 22 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Radius should provide a way to access all three kinds of graph.
60
60
| Deployment Graph | An application graph constructed by querying the Radius control plane for the live resources of a deployed application. |
61
61
| Simulated Deployment Graph | An application graph that represents what would be deployed if an application definition were applied to a specific environment. |
62
62
| Graph Artifact | The serialized JSON file (`app.json`) containing a `StaticGraphArtifact` stored on the orphan branch. |
63
-
| Orphan Branch | A Git branch with no common history to `main`, used to store graph artifacts (default: `radius-graph`). |
63
+
| Orphan Branch | A Git branch with no common history to `main`, used to store graph artifacts (default: `radius-graph`). The same pattern is used by the [GitHub Actions Workspace](../2026-03-github-workspace-design.md) feature for state persistence (`radius-state` orphan branch). |
64
64
| DiffHash | A stable BLAKE2b hash of a resource's review-relevant properties, used to detect modifications between branches. |
65
65
| rootScope | The current UCP scope (e.g., `/planes/radius/local/resourceGroups/default`). |
66
66
| codeReference | An optional resource property providing a repo-relative file path to the source code implementing the resource. |
@@ -515,13 +515,29 @@ The graph is constructed in-memory but must be persisted so it remains accessibl
515
515
| Graph type | Persisted where | Written when |
516
516
|---|---|---|
517
517
| Static graph |`{branch}/app.json` on `radius-graph` orphan branch | CI runs `rad graph build` on push/PR |
518
-
| Run-time graph |`graphs/{app}.json` on `radius-state` orphan branch |`rad shutdown` serializes after deploy (future) |
518
+
| Run-time graph |`graphs/{app}.json` on `radius-state` orphan branch |`rad shutdown` serializes after deploy |
519
519
520
520
**Why orphan branches?**
521
521
- No interference with application code history.
522
522
- GitHub Contents API provides easy access without local checkout.
- PR diff visualization naturally flows from comparing base vs head artifacts.
525
+
- Zero additional infrastructure — git is already available with `actions/checkout` credentials.
526
+
- Atomic commit+push semantics for consistent state.
527
+
528
+
**Relationship to the GitHub Actions Workspace feature:**
529
+
530
+
The orphan branch persistence pattern is shared with the [GitHub Actions Workspace](../2026-03-github-workspace-design.md) feature (`filesystem-state` branch). That feature uses a `radius-state` orphan branch to persist PostgreSQL database backups across ephemeral CI runs. The app graph feature uses a separate `radius-graph` orphan branch for graph artifacts. Both use the same underlying technique:
531
+
532
+
-`git worktree add` in `/tmp/` for isolated operations
533
+
- Sentinel files for lifecycle state (the workspace feature uses `.lock`, `.backup-ok`, `.deploy-lock`)
534
+
- Atomic commit+push with the `GITHUB_TOKEN` from `actions/checkout`
535
+
536
+
The `gitstate` package from the workspace feature (`pkg/cli/gitstate/`) provides reusable primitives for orphan branch management (create, checkout, commit, push) that the graph builder's orphan branch logic could adopt to avoid duplicating git plumbing code.
537
+
538
+
**Run-time graph persistence via `rad shutdown`:**
539
+
540
+
The `rad shutdown` command (from the `filesystem-state` branch) backs up PostgreSQL state and tears down the k3d cluster. A natural extension is to call `getGraph` for each deployed application during shutdown and write the graph JSON to the `radius-state` orphan branch alongside the SQL dumps. This would make run-time graphs available for visualization even after the cluster is destroyed — enabling the browser extension to show deployed infrastructure topology from the last known state.
525
541
526
542
---
527
543
@@ -678,7 +694,7 @@ The browser extension is tested manually:
678
694
679
695
4.**`codeReference` adoption:** Who sets the `codeReference` property — the developer manually, or should tooling (e.g., Copilot skills) populate it automatically?
680
696
681
-
5.**Run-time graph persistence:** The design mentions storing run-time graphs on a `radius-state` orphan branch via `rad shutdown`. Should this be implemented in this iteration or deferred?
697
+
5.**Run-time graph persistence:** The `filesystem-state` branch implements `rad shutdown` with PostgreSQL backup to a `radius-state` orphan branch. Adding a `getGraph` call during shutdown to persist the run-time graph JSON alongside the SQL dumps would enable deployed graph visualization after cluster teardown. Should this be integrated in this iteration or deferred?
682
698
683
699
6.**Cloud provider navigation:** For deployed graphs, clicking a resource should navigate to the cloud provider console (AWS, Azure). How should provider-specific URLs be constructed?
684
700
@@ -703,8 +719,10 @@ The browser extension is tested manually:
703
719
| File in repo (e.g., `.radius/graph.json`) | Simple, visible in PRs | Clutters commit history, merge conflicts |
704
720
| Orphan branch | Clean separation, no history interference | Requires git operations, less discoverable |
**Chosen approach:** Orphan branch. Clean separation from application code, natural per-branch organization, accessible via GitHub API.
725
+
**Chosen approach:** Orphan branch. Clean separation from application code, natural per-branch organization, accessible via GitHub API. This is consistent with the `filesystem-state` branch's choice of orphan branches for PostgreSQL state persistence, validated by the same analysis (see [GitHub Actions Workspace](../2026-03-github-workspace-design.md) alternatives considered).
708
726
709
727
### Browser extension vs GitHub App/Action with Markdown
0 commit comments