Add --preview flag for 'rad app graph' and 'rad app status' #11983
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Adds --preview support for rad app graph and rad app status so these commands can operate against Radius.Core/applications@2025-08-01-preview (v20250801preview) resources, completing the rad app preview command set.
Changes:
- Add preview implementations for
rad app graphandrad app statusand wire them via--previewrouting in the CLI root. - Export shared formatting and hyperlink/provider helpers so preview subpackages can reuse existing logic.
- Extend the Radius.Core CLI test client factory and add unit tests for preview command behavior and
--previewrouting.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/test_client_factory/radius_core.go | Adds fake GetGraph behavior for preview Applications server to support new preview command tests. |
| pkg/cli/cmd/app/status/status.go | Switches to exported formatter helpers (StatusFormat, GatewayFormat). |
| pkg/cli/cmd/app/status/status_test.go | Updates tests to use exported formatter helpers. |
| pkg/cli/cmd/app/status/preview/status.go | New preview rad app status implementation using Radius.Core v20250801preview APIs and ownership filtering. |
| pkg/cli/cmd/app/status/preview/status_test.go | New unit tests covering preview status output, errors, and JSON/table behavior. |
| pkg/cli/cmd/app/status/objectformats.go | Exports formatter helpers for reuse by preview package. |
| pkg/cli/cmd/app/status/objectformats_test.go | Updates formatter tests to use exported helpers. |
| pkg/cli/cmd/app/graph/preview/graph.go | New preview rad app graph implementation calling v20250801preview GetGraph and rendering table/JSON. |
| pkg/cli/cmd/app/graph/preview/graph_test.go | New unit tests for preview graph behavior, including 404 handling and JSON output. |
| pkg/cli/cmd/app/graph/display.go | Exports MakeResourceHyperlink and refactors hyperlink creation to use it. |
| pkg/cli/cmd/app/graph/compute.go | Exports ProviderFromID for reuse by preview graph rendering. |
| pkg/cli/cmd/app/graph/compute_test.go | Updates tests for exported ProviderFromID. |
| cmd/rad/cmd/root.go | Wires preview subcommands for app status and app graph behind --preview. |
| cmd/rad/cmd/root_test.go | Adds unit tests validating wirePreviewSubcommand routing behavior. |
Unit Tests 2 files ± 0 435 suites +4 7m 28s ⏱️ +3s Results for commit 262cedc. ± Comparison against base commit 7c8dc6d. This pull request removes 3 and adds 30 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #11983 +/- ##
==========================================
+ Coverage 51.85% 51.89% +0.04%
==========================================
Files 730 732 +2
Lines 46069 46272 +203
==========================================
+ Hits 23889 24014 +125
- Misses 19904 19958 +54
- Partials 2276 2300 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
38acd8a to
7c5c820
Compare
7c5c820 to
8e91fcf
Compare
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
8e91fcf to
262cedc
Compare
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
This pr adds --preview flag support to rad app graph and rad app status commands. When --preview is passed, these commands operate againstRadius.Core/applications resources via the v20250801preview API surface, instead of the default Applications.Core/applications.
This completes the rad app preview command set, following the prior PR that added rad app show/list/delete --preview.
Notes:
Type of change
rad appcommands don't work for applications created by Radius.Core/applications type #11675).Fixes: #11675
Contributor checklist
Please verify that the PR meets the following requirements, where applicable:
eng/design-notes/in this repository, if new APIs are being introduced.