Skip to content

Add app-graph skill#11901

Open
nicolejms wants to merge 2 commits into
radius-project:mainfrom
nicolejms:nicolejms/app-graph-skill-draft
Open

Add app-graph skill#11901
nicolejms wants to merge 2 commits into
radius-project:mainfrom
nicolejms:nicolejms/app-graph-skill-draft

Conversation

@nicolejms
Copy link
Copy Markdown
Contributor

Adds .github/skills/app-graph/ which renders a Radius application graph from app.bicep. Mirrors the renderer in radius-project/github-extension (Cytoscape v3 + cytoscape-dagre, Primer palette, popup with source links) and produces a self-contained HTML file plus an inline mermaid preview. Depends on 'rad graph build' (features/radius-graph branch).

Description

Please explain the changes you've made.

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).
  • This pull request adds or changes features of Radius and has an approved issue (issue link required).
  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).
  • This pull request is a design document and only includes files in the eng/design-notes directory.

Fixes: #issue_number

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • Not applicable
  • A design document is added or updated under eng/design-notes/ in this repository, if new APIs are being introduced.
    • Yes
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • Not applicable
  • A PR for resource-types-contrib is created, if resource types or recipes are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for dashboard is created, if the Radius Dashboard is affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable

Adds .github/skills/app-graph/ which renders a Radius application graph from app.bicep. Mirrors the renderer in radius-project/github-extension (Cytoscape v3 + cytoscape-dagre, Primer palette, popup with source links) and produces a self-contained HTML file plus an inline mermaid preview. Depends on 'rad graph build' (features/radius-graph branch).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 17:07
@nicolejms nicolejms requested review from a team as code owners May 14, 2026 17:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Copilot “skill” under .github/skills/app-graph/ to generate a Radius application graph from app.bicep, producing (1) an interactive HTML viewer and (2) an inline Mermaid preview based on the rad graph build artifact.

Changes:

  • Introduces the app-graph skill definition (SKILL.md) including an explicit output contract and internal workflow.
  • Adds a Cytoscape-based HTML template (template/app-graph.html.tmpl) that renders nodes/edges and provides a clickable popup with source links.
  • Documents the expected artifact schema and rendering/mermaid conventions under references/.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
.github/skills/app-graph/template/app-graph.html.tmpl New HTML template that loads Cytoscape/Dagre, embeds the graph artifact, and renders an interactive graph + popup UI.
.github/skills/app-graph/SKILL.md Skill definition and end-to-end workflow for compiling/building/rendering the graph and emitting Mermaid.
.github/skills/app-graph/references/schema.md Documents the JSON schema consumed by the viewer.
.github/skills/app-graph/references/rendering.md Documents the renderer conventions/options and CDN dependencies.
.github/skills/app-graph/references/mermaid.md Specifies rules for generating the inline Mermaid preview.
.github/skills/app-graph/references/artifact-path.md Documents how to invoke rad graph build and where the artifact is written.

Comment on lines +148 to +150
<script>
// === Embedded artifact (substituted by the skill) =========================
const GRAPH_ARTIFACT = __GRAPH_DATA__;
Comment on lines +144 to +146
<script src="https://unpkg.com/cytoscape@3/dist/cytoscape.min.js"></script>
<script src="https://unpkg.com/dagre@0.8.5/dist/dagre.min.js"></script>
<script src="https://unpkg.com/cytoscape-dagre@2/cytoscape-dagre.js"></script>
Comment on lines +144 to +146
<script src="https://unpkg.com/cytoscape@3/dist/cytoscape.min.js"></script>
<script src="https://unpkg.com/dagre@0.8.5/dist/dagre.min.js"></script>
<script src="https://unpkg.com/cytoscape-dagre@2/cytoscape-dagre.js"></script>
Comment on lines +225 to +238
for (const r of resources) {
for (const conn of (r.connections || [])) {
if (conn.direction === 'Outbound') {
const targetExists = resources.some(x => x.id === conn.id);
if (targetExists) {
elements.push({
group: 'edges',
data: {
id: `${r.id}-->${conn.id}`,
source: r.id,
target: conn.id,
},
});
}
Comment on lines +339 to +342
function fileHref(path, line) {
if (!path) return null;
const lineSuffix = line ? `#L${line}` : '';
return `${path}${lineSuffix}`;
Comment on lines +8 to +19
a self-contained HTML viewer (Cytoscape + dagre) that mirrors the
radius-project/github-extension graph renderer, opens it in the default
browser, and emits an inline mermaid preview in chat.
---

# Radius Application Graph

Use this skill to render an interactive application graph from a Radius
`app.bicep` file. The skill compiles the Bicep, invokes `rad graph build`,
and produces a single self-contained `app-graph.html` whose renderer is
ported verbatim from `radius-project/github-extension`
(`src/content/graph-renderer.ts` + `src/content/graph-navigation.ts`).
Comment on lines +61 to +63
b. Replace the literal token `__GRAPH_DATA__` with the file
contents of `app.json` (substitute as a JSON literal — do NOT
wrap in quotes).
Comment on lines +13 to +20
append `_2`, `_3`, ...
4. Node label = `<name><br/><shortType>` where
`shortType = resource.type.split('/').pop()`.
5. Use rectangle shape: `id["label"]`.
6. Edge rule (mirrors the HTML renderer): for every resource, iterate
`connections` and emit `source --> target` for each connection where
`direction === 'Outbound'` AND the target `id` is present in
`application.resources`. Use the same sanitized ids.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.70%. Comparing base (210a9ec) to head (a4832d2).
⚠️ Report is 39 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11901      +/-   ##
==========================================
+ Coverage   51.38%   51.70%   +0.32%     
==========================================
  Files         698      726      +28     
  Lines       44037    45605    +1568     
==========================================
+ Hits        22627    23582     +955     
- Misses      19252    19796     +544     
- Partials     2158     2227      +69     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Each node in the rendered graph now carries a Unicode icon and a
per-resource-type Primer color pair (fill + border) so the resource
types in a Radius application are visible at a glance. The legend
is now built from the resource types actually present in the graph
and shows the icon-bearing swatch + a human-readable label. The
diff-mode palette is still in the template — when a future diff mode
lands, the diff status fill/border continue to win over the type
colors so the diff signal stays dominant.

- Add TYPE_STYLES map + styleForType() with explicit entries for
  Applications.Core/applications, Radius.Compute/{containers,
  containerImages, gateways}, Radius.Data/{mySqlDatabases,
  postgreSqlDatabases, mongoDatabases, redisCaches}, and
  Radius.Security/secrets, plus provider-prefix fallbacks and a
  generic 'other' bucket.
- Prefix the node label and popup title with the type icon, widen
  the node to 160x60 to accommodate it.
- Replace the static diff legend in single-graph mode with a
  dynamic resource-type legend computed from the rendered nodes.
- Document the palette in references/visual-style.md and link it
  from SKILL.md + rendering.md. Update the relevant guardrail so
  it allows additive theming while still freezing the renderer
  layout, popup, and edge rules.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@radius-functional-tests
Copy link
Copy Markdown

radius-functional-tests Bot commented May 14, 2026

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository nicolejms/radius
Commit ref a4832d2
Unique ID funcb76adc5808
Image tag pr-funcb76adc5808
  • gotestsum 1.13.0
  • KinD: v0.29.0
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcb76adc5808
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcb76adc5808
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcb76adc5808
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcb76adc5808
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcb76adc5808
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
❌ corerp-cloud functional test failed. Please check the logs for more details
❌ corerp-cloud functional test failed. Please check the logs for more details

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.

2 participants