Repository navigation
Design app graph - #11681
Design app graph#11681nithyatsu wants to merge 2 commits into
Conversation
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. | ||
|
|
There was a problem hiding this comment.
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. | ||
|
|
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
@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. | ||
|
|
There was a problem hiding this comment.
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. | ||
|
|
There was a problem hiding this comment.
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. | ||
|
|
There was a problem hiding this comment.
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. | ||
|
|
There was a problem hiding this comment.
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) | ||
| ``` |
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
Should we add a task to document Phase 5 / authentication setup?
Description
Please explain the changes you've made.
Type of change
Fixes: #issue_number
Contributor checklist
Please verify that the PR meets the following requirements, where applicable: