Fill in the sections below to describe what the CI/CD workflow should do. Then ask Copilot: "Implement a GitHub Actions workflow based on workflow-spec.md"
The workflow should run every 2 hours. I should also be able to run it manually.
Fill in the sections below to describe what the CI/CD workflow should do. Then ask Copilot: "Implement a GitHub Actions workflow based on workflow-spec.md"
- Schedule: Every 2 hours (
cron: '0 */2 * * *') - Manual:
workflow_dispatch
Create an ephemeral Kubernetes cluster using Kind.
Install Radius into the Kind cluster using custom images:
rad install kubernetes \
--set rp.image=ghcr.io/nithyatsu/applications-rp,rp.tag=latest \
--set dynamicrp.image=ghcr.io/nithyatsu/dynamic-rp,dynamicrp.tag=latest \
--set controller.image=ghcr.io/nithyatsu/controller,controller.tag=latest \
--set ucp.image=ghcr.io/nithyatsu/ucpd,ucp.tag=latest \
--set bicep.image=ghcr.io/nithyatsu/bicep,bicep.tag=latestRun rad group create test and confirm it succeeds. This validates that all Radius pods are healthy and the control plane is operational.
Run rad app graph <fully-qualified-path-to-app.bicep>.
- The command requires an absolute file path (e.g.,
${{ github.workspace }}/app.bicep). - The command outputs a structured representation of the application's resources and their connections.
- The command gets updated all the time. Try it out, update the workflow to work with the latest behavior.
Parse the output from step 4 and construct a renderable graph (e.g., using Graphviz or Mermaid). Extract:
- Nodes — each resource (name, type, source file, line number)
- Edges — connections between resources
Generate a Mermaid diagram and embed it directly in the README.md Architecture section as a fenced mermaid code block. GitHub renders Mermaid natively, so the diagram is interactive right in the README — no separate image files or HTML pages needed.
Use a Mermaid graph LR with:
%%{ init }%%directive for theme configurationclassDeffor node stylingclickdirectives for making each node a hyperlink with tooltip
| Property | Value |
|---|---|
| Theme | base (light) |
| Background | White (#ffffff) |
| Font color | Dark (#1f2328) |
| Node shape | Rounded-corner rectangles (rx:6, ry:6) |
| Container border | Green (#2da44e) |
| Datastore border | Amber (#d4a72c) |
| Node fill | White (#ffffff) |
| Edge color | Green (#2da44e) |
| Font | -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif |
| Feature | Behavior |
|---|---|
| Tooltip | Hovering a node shows: "<name> — app.bicep line <N>" |
| Click | Clicking a node opens https://github.com/<owner>/<repo>/blob/<branch>/app.bicep#L<N> with the line highlighted |
Replace the Architecture section's Mermaid code block with the newly generated one. The diagram should be the only content between the ## Architecture heading and the next ## heading.
Auto-commit changes to docs/ and README.md only if the graph has changed.
Goal: Show a visual diff of the app graph in PR comments so reviewers can see architectural impact without deploying.
Depends on: User Stories 1–3 being stable.
The GitHub Action reads committed .radius/app-graph.json files from git history — it does not generate graphs on-demand. No Bicep/Radius tooling is needed, keeping the Action lightweight and fast.
| Event | Behavior |
|---|---|
pull_request (every push) |
Posts or updates a diff comment on the PR |
push to main |
Updates the baseline for historical comparison |
The comment is posted on every push to the PR, not just the first one. If no Bicep/graph changes exist, the comment says "No app graph changes detected."
Auto-detect all **/.radius/app-graph.json files. Each graph is diffed independently with separate comment sections per application.
The comment includes:
- Side-by-side Mermaid graphs —
maingraph on the left, PR graph on the right, for visual comparison. - Diff graph — a single Mermaid graph using color-coded nodes:
- 🟢 Green border — added resources
- 🟡 Amber border — modified resources
- 🔴 Red border — removed resources
- Gray border — unchanged resources
- Clickable nodes — clicking a node opens the PR's diff page (
/files) with the resource's Bicep section in focus (anchored to the diff line). - Resources & connections table — lists added/removed/modified resources and connections.
- Footer — "Powered by Radius"
- PR includes changes to
.radius/app-graph.json→ Action posts a comment with side-by-side graphs + diff graph. - PR has no Bicep or graph changes → Comment says "No app graph changes detected."
- PR adds a new connection → Diff graph shows the new edge; new resource node is green.
- PR removes a resource → Diff graph shows the removed node in red (dashed border).
- PR modifies a resource → Diff graph shows the modified node in amber.
- PR comment already exists from a previous push → Existing comment is updated, not duplicated.
- Clicking a node in the diff graph opens the PR diff page with the resource's section in focus.
- Bicep files changed but
.radius/app-graph.jsonwas not updated → CI validation fails with instructions. - Monorepo with multiple apps → Unified comment with separate sections per application.
- Comment footer says "Powered by Radius".