Skip to content

Design app graph - #11681

Closed
nithyatsu wants to merge 2 commits into
radius-project:mainfrom
nithyatsu:design-update-app-graph
Closed

nithyatsu wants to merge 2 commits into
radius-project:mainfrom
nithyatsu:design-update-app-graph

Conversation

@nithyatsu

Copy link
Copy Markdown
Contributor

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).

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 PR is created in the design-notes 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 the samples repository is created, if existing samples are 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
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.
    • Yes
    • Not applicable

Synthesized from:
- github-demo branch implementation (rad graph build, browser extension, CI workflow)
- willtsai/radius feature spec (user scenarios, personas, UX flows)
- Design template structure (eng/design-notes/templates/design-template.md)

Added sections: user experience, architecture diagram, detailed design for all
4 components, error handling, test plan, security, compatibility, monitoring,
development plan, open questions, alternatives considered.
- 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
* A **browser extension** that injects interactive graph visualizations into GitHub repository pages and pull requests.
* A **CI/CD pipeline** that automatically builds graph artifacts on every push and PR.
* A **diff visualization** that highlights added, removed, and modified resources when reviewing pull requests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Of these, the browser extension will not be committed to main, since it was used for demo only.

#### Scenario 3: Interactive navigation from graph to code

A developer clicks on a node in the graph (e.g., "cache") and sees a popup with links to: (1) the source code file referenced by the `codeReference` property, and (2) the `app.bicep` line where the resource is declared.

@nithyatsu nithyatsu Apr 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This corresponds to what we have today in the github-demo branch. Should we enhance this user story to support deep link into application code? If so, we have to capture it in a user story. Also, we have to make sure the implementation is robust for complex app definitions.

A developer clicks on a node in the graph (e.g., "cache") and sees a popup with links to: (1) the source code file referenced by the `codeReference` property, and (2) the `app.bicep` line where the resource is declared.

## User Experience

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@willtsai to confirm if the UX details look OK.

2. Computes the diff using `computeGraphDiff()`.
3. Renders a color-coded graph below the PR description with a legend.
4. Shows a "waiting for CI" message if the head artifact hasn't been built yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We will not be committing any of the browser extension code to main repo.

```

The diffHash enables the browser extension to classify resources as modified vs unchanged without comparing all properties.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We will retain the diffHash to be consumed by the UI which would replace browser extension.

4. **Compute diffHash:** For each resource, extract "authorable" properties (excluding `application`, `environment`, internal IDs), canonicalize as JSON, and hash with BLAKE2b including `dependsOn`.
5. **Add inbound connections:** For each outbound connection A→B, add a corresponding inbound connection B←A.
6. **Sort:** Sort resources by ID for deterministic output.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mapping source lines might need a new approach if we are deep linking. Should we merge what we have for now, and add an item to backlog for researching deep-link ability?

No server-side changes are required for the static graph feature. The existing `getGraph` API on `Applications.Core/applications` continues to serve the run-time graph.

Future work may add the `diffHash`, `appDefinitionLine`, and `codeReference` fields to the server-side `ApplicationGraphResponse` TypeSpec definition to enable a unified schema.

@nithyatsu nithyatsu Apr 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we take care of this now, as part of merge to main efforts and add these properties as optional to graph schema?

--bicep string Path to the Bicep application definition file (default "app.bicep")
--orphan-branch string Orphan branch name for storing graph artifacts (default "radius-graph")
--source-branch string Branch name to use as the artifact directory (default: current branch)
```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should the --source-branch be optional and default to current branch?

| **Phase 3: Browser extension — repo tab** | "Application graph" tab on repo root, Cytoscape rendering | P0 |
| **Phase 4: Browser extension — PR diff** | Diff computation, color-coded PR graph, navigation popups | P0 |
| **Phase 5: Authentication** | GitHub App device flow, PAT support | P0 |
| **Phase 6: Deployed graph visualization** | Browser extension page showing live deployment state | P1 |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we add a task to document Phase 5 / authentication setup?

@nithyatsu nithyatsu closed this Apr 21, 2026
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.

1 participant