Repository navigation
Fix application graph layout and edges for Radius.Compute types - #404
Conversation
Match container and gateway type suffixes across namespaces. Add tests-first unit, model integration, and browser coverage for #373. Signed-off-by: nicolejms <nicolej@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: nicolejms <nicolej@microsoft.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Playwright screenshots for #373. All 13 tests passed: 5 app graph tests and 8 component tests. These images use mocked API data, not a live Radius deployment. The images show the Radius.Core application graph, a close-up of the Radius.Core/containers label, and the legacy graph for comparison. |
Replace the /containers and /gateways suffix checks with explicit lists of built-in types. Containers are Applications.Core/containers and Radius.Compute/containers. Gateways are Applications.Core/gateways and Radius.Compute/routes, which replaces gateways for ingress. Radius.Core defines no containers or gateways types. User-defined types with the same names no longer get the layout or edge-direction handling. Type matching ignores letter case. Update unit, graph-model, and E2E tests to use the real Radius.Compute and Radius.Data types, and add negative tests for user-defined types. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: nicolejms <nicolej@microsoft.com>
Updated screenshots: real Radius.Compute typesThese screenshots replace the earlier ones, which showed Radius.Core application graphThe route Route and container close-upsLegacy Applications.Core graph (no change) |
nithyatsu
left a comment
There was a problem hiding this comment.
Fix looks correct and the coverage across both type sets is good. One doc fix needed before merge, plus a nit.
Replace Radius.Core/gateways and Radius.Core/containers in the negative AppGraph tests with Radius.Networking types. Radius.Core does not define those types. Remove the #373 row from the known-defects table because the issue is fixed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: nicolejms <nicolej@microsoft.com>







Summary
Match explicit lists of built-in resource types in
AppGraph:Applications.Core/containersandRadius.Compute/containers.Applications.Core/gatewaysandRadius.Compute/routes.Radius.Compute/routesreplaces gateways for ingress.Type matching ignores letter case. User-defined types with the same names (for example
Contoso.Net/gateways) get no special handling. This PR keeps support for the legacy types. It does not remove legacy resources or migrate the saved graph records.Reason for change
AppGraphcompared resource types with the literal stringsApplications.Core/containersandApplications.Core/gateways. Resources of the new built-in types thus used the wrong initial layout row, and route edges did not get the direction correction.Issue #373 names
Radius.Core/containersandRadius.Core/gateways. The Radius manifestdeploy/manifest/built-in-providers/self-hosted/radius_core.yamldefines no such types.Radius.Coredefines onlyenvironments,applications,recipePacks,terraformSettings, andbicepSettings. The real new types areRadius.Compute/containers(containers.yaml) andRadius.Compute/routes(routes.yaml). The graph API reports a route-to-container link as anOutbounddependency edge on the route and anInboundcopy on the container (pkg/graph/edges/edges.go). This is the same shape as legacy gateway edges, so the same direction correction applies.Fixes #373
How to test
Use Node.js 24 and the Yarn version set in
package.json. Runcorepack yarn install --immutable. If the browser is not installed, runcorepack yarn playwright install chromium. For browser commands below, setPLAYWRIGHT_BROWSER_CHANNEL=chromium(PowerShell:$env:PLAYWRIGHT_BROWSER_CHANNEL='chromium'). The app and Storybook test commands start and stop their own servers; no Radius cluster is needed.corepack yarn test --watchAll=false --runInBand --coverage=false packages/rad-components/src. Both type sets must place containers without inbound connections in the leading row. Gateway and route edges must point to the container before and after layout. User-defined*/gateways,*/routes, and*/containerstypes (for exampleContoso.Net/gatewaysandRadius.Networking/gateways) must not get the special handling.corepack yarn test:e2e packages/app/e2e-tests/radiusGraph.test.ts --workers=1. Open each application from the list. TheRadius.Coreapplication's graph mock returnsRadius.Compute/containers,Radius.Compute/routes, andRadius.Data/redisCachesresources. Both graphs must show the gateway or route edge tofrontend, not the reverse edge.corepack yarn test:e2e:components --workers=1. The real renderer must retain its nodes, edges, controls, and layout behavior.Validation results (commit 2):
corepack yarn test ... AppGraph.test.tsx graphInvariants.test.tsbefore the fixcorepack yarn test --watchAll=false --runInBand --coverage=false packages/rad-components/srcafter the fixgraphRecords.test.ts(saved records unchanged).corepack yarn test:e2e packages/app/e2e-tests/radiusGraph.test.ts --workers=1after the fixendsWithcodeRadius.Computegraph.corepack yarn test:e2e:components --workers=1corepack yarn tsccorepack yarn lint:allcorepack yarn prettier --writeon the changed filesshellcheck .devcontainer/postcreate.shgit diff --checkFile change summary
packages/rad-components/src/components/appgraph/AppGraph.tsxpackages/rad-components/src/components/appgraph/__test__/AppGraph.test.tsxContoso.NetandRadius.Networking, and a letter-case case.packages/rad-components/src/__test__/graphInvariants.test.tspackages/app/e2e-tests/radiusGraph.test.tsRadius.ComputeandRadius.Datatypes for theRadius.Coreapplication, and check the exact visible edge direction.docs/design/2026-09-dashboard-plugin-test-plan.md