Skip to content

Add --preview support to rad resource list for Radius.Core environments and applications types - #12728

Merged
lakshmimsft merged 2 commits into
mainfrom
lakshmimsft/preview-resource-list
Aug 20, 2026
Merged

lakshmimsft merged 2 commits into
mainfrom
lakshmimsft/preview-resource-list

Conversation

@lakshmimsft

@lakshmimsft lakshmimsft commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds --preview support to rad resource list so environment- and application-scoped listing works with the Radius.Core/environments and Radius.Core/applications resource types.

rad resource list is now wired through wirePreviewSubcommand, matching the pattern used by the rad env and rad app commands. In preview mode, the runner resolves fully-qualified Radius.Core resource IDs instead of bare names, and validates applications against the Radius.Core applications client.

Reason for change

#12481 made the [resourceType] argument optional so rad resource list could list all resources in an environment or application. That path only worked for legacy resources.

cli.RequireEnvironmentName reduces the workspace environment to its name, and ListResourcesInEnvironment re-qualifies a bare name as Applications.Core/environments. Filtering is exact, case-insensitive ID equality, so resources referencing Radius.Core/environments were silently excluded and the command returned an empty list. -a had the same problem, since it qualified names as Applications.Core/applications and validated existence through the legacy GetApplication.

Legacy and preview environments/applications may share a name, so the client deliberately does not match both ID forms at once — that would merge results from two distinct resources. Instead, the caller supplies the exact ID it wants filtered.

Fixes: #12609

How to test

Requires a preview environment (rad env create <env> --preview) and a deployed preview application.

# All resources in the default (Radius.Core) environment
rad resource list --preview

# All resources in a specific preview environment
rad resource list -e my-env --preview

# Typed listing scoped to a preview environment
rad resource list Radius.Compute/containers -e my-env --preview

# All resources in a preview application
rad resource list -a my-app --preview

# Full Radius.Core resource IDs are accepted
rad resource list -a /planes/radius/local/resourceGroups/my-rg/providers/Radius.Core/applications/my-app --preview

# RADIUS_PREVIEW=true activates preview mode
RADIUS_PREVIEW=true rad resource list

Verify that legacy behavior is unchanged when --preview is omitted, and that a legacy Applications.Core ID passed to -e/-a under --preview is rejected with a clear message.

File change summary

File Summary of change
cmd/rad/cmd/root.go Wires rad resource list through wirePreviewSubcommand so --preview and RADIUS_PREVIEW=true route to the preview runner.
cmd/rad/cmd/root_test.go Adds Test_ResourceList_ExposesPreviewFlag, asserting the assembled command tree exposes --preview on rad resource list.
pkg/cli/cmd/resource/list/list.go Adds NewPreviewCommand and a Preview field on the runner, sharing one implementation. In preview mode, resolves Radius.Core environment/application IDs (preserving full IDs, qualifying bare names, rejecting non-Radius.Core IDs), validates applications via the Radius.Core applications client, and passes full IDs to the list methods. Renames EnvironmentName to EnvironmentNameOrID to reflect that it may hold a full ID.
pkg/cli/cmd/resource/list/list_test.go Adds Test_ValidatePreview for environment/application ID resolution and legacy-ID rejection, plus Test_Run preview subtests covering typed/untyped environment and application listing and the missing-application error. Updates existing tests for the renamed field.
pkg/cli/clients/clients.go Documents on the interface that bare names target Applications.Core and that a full resource ID is needed for other types.
pkg/cli/clients/management.go Adds the same clarification to the four list method implementations. No behavior change.
pkg/cli/clients/management_test.go Adds a fullyQualifyID case asserting a full Radius.Core ID is preserved verbatim — the property the preview command depends on.

Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@lakshmimsft lakshmimsft added the pr:standard Ongoing maintenance, minor improvements, documentation updates, and routine development work label Aug 20, 2026
@lakshmimsft lakshmimsft changed the title upd to rad resource list for new types Add --preview support to rad resource list for Radius.Core environments and applications types Aug 20, 2026
@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Unit Tests

    2 files  ± 0    457 suites  ±0   6m 47s ⏱️ -52s
6 310 tests +17  6 308 ✅ +17  2 💤 ±0  0 ❌ ±0 
7 567 runs  +32  7 565 ✅ +32  2 💤 ±0  0 ❌ ±0 

Results for commit 1b7902c. ± Comparison against base commit 9aeaffd.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.50704% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.38%. Comparing base (9aeaffd) to head (1b7902c).

Files with missing lines Patch % Lines
pkg/cli/cmd/resource/list/list.go 84.05% 7 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12728      +/-   ##
==========================================
+ Coverage   54.36%   54.38%   +0.02%     
==========================================
  Files         770      770              
  Lines       51299    51363      +64     
==========================================
+ Hits        27887    27934      +47     
- Misses      20796    20806      +10     
- Partials     2616     2623       +7     

☔ View full report in Codecov by Harness.
📢 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.

@lakshmimsft
lakshmimsft marked this pull request as ready for review August 20, 2026 00:32
@lakshmimsft
lakshmimsft requested review from a team as code owners August 20, 2026 00:32
@lakshmimsft
lakshmimsft requested review from nithyatsu and a lite review from Copilot August 20, 2026 00:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds preview-mode support to rad resource list so listing scoped by environment/application works correctly for Radius.Core/environments and Radius.Core/applications, while preserving legacy behavior when preview is off.

Changes:

  • Wires rad resource list through the shared preview routing mechanism (--preview / RADIUS_PREVIEW=true) and adds a preview runner path.
  • In preview mode, resolves environment/application inputs to fully-qualified Radius.Core resource IDs and validates applications using the Radius.Core applications client.
  • Expands unit tests to cover preview ID resolution, legacy-ID rejection, and preview-mode run behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmd/rad/cmd/root.go Routes rad resource list through preview wiring to enable --preview behavior.
cmd/rad/cmd/root_test.go Asserts rad resource list exposes the --preview flag on the assembled command tree.
pkg/cli/cmd/resource/list/list.go Adds preview-aware command construction and runner logic for resolving/validating Radius.Core environment/app identifiers.
pkg/cli/cmd/resource/list/list_test.go Adds preview-focused validation/run tests and updates existing tests for renamed fields.
pkg/cli/clients/clients.go Documents that bare names target Applications.Core, and other types require full IDs.
pkg/cli/clients/management.go Adds matching clarifying comments to list methods (no behavior change).
pkg/cli/clients/management_test.go Adds a test ensuring fullyQualifyID preserves a full Radius.Core ID verbatim.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/cli/cmd/resource/list/list.go
Comment thread pkg/cli/cmd/resource/list/list.go
Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
@radius-functional-tests

radius-functional-tests Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository radius-project/radius
Commit ref 1b7902c
Unique ID func1cb4c94f43
Image tag pr-func1cb4c94f43
  • 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-func1cb4c94f43
  • 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-func1cb4c94f43
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func1cb4c94f43
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func1cb4c94f43
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func1cb4c94f43
  • 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 ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
❌ corerp-cloud functional test failed. Please check the logs for more details
⌛ Starting corerp-cloud functional tests...
✅ corerp-cloud functional tests succeeded

@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Functional Tests - corerp-cloud

32 tests  ±0   31 ✅ ±0   20m 27s ⏱️ +35s
 2 suites ±0    1 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 1b7902c. ± Comparison against base commit 9aeaffd.

♻️ This comment has been updated with latest results.

@nithyatsu
nithyatsu added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@lakshmimsft
lakshmimsft added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@lakshmimsft
lakshmimsft added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@lakshmimsft
lakshmimsft added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit ca7b5a3 Aug 20, 2026
88 of 89 checks passed
@lakshmimsft
lakshmimsft deleted the lakshmimsft/preview-resource-list branch August 20, 2026 17:41
pull Bot pushed a commit to TheTechOddBug/radius that referenced this pull request Aug 26, 2026
… environment (radius-project#12822)

## Summary
`rad env delete --preview` now deletes everything that lives in the
environment instead of
only the environment resource itself, matching the behavior of
`Applications.Core/environments`.

When deleting a `Radius.Core` environment, the CLI now:

1. Looks up the environment, and treats a missing environment as a
successful no-op so the
   command is idempotent.
2. Enumerates the applications whose `properties.environment` references
the environment,
plus the resources reported both by the environment and by each of those
applications.
3. Shows a confirmation prompt that states how many applications and
resources will be
deleted, instead of the previous hardcoded "environment is empty"
message.
4. Deletes the resources concurrently, then the applications, then the
environment.

A `--force` flag is also added to the preview command so resources stuck
in a non-terminal
state can be deleted, mirroring `rad app delete --force`.

The cascade logic is shared with `rad app delete --preview`. That
command previously carried
its own private copy of the resource-enumeration logic; it now uses the
same helpers, which
removes the duplication.

## Reason for change

The `Radius.Core/environments` env when used in `rad env delete
--preview` deleted only the environment resource and silently orphaned
every application and resource deployed into it. The confirmation prompt
made this worse by always
claiming the environment was empty, so users consented to a deletion
that did not describe what actually happened.

The work is unblocked by radius-project#12728, which made `fullyQualifyID` pass fully
qualified resource IDs
through unchanged. Fully qualified `Radius.Core` IDs can now be handed
to
`ListResourcesInApplication` and `ListResourcesInEnvironment` and reach
their filters intact,
so the preview commands no longer need their own enumeration code.

Fixes radius-project#12486

## How to test
Manual, against a cluster with Radius installed:

1. Create a preview environment and deploy an application into it.

2. Confirm the cascade prompt reports the real contents, rather than
claiming the environment
   is empty:

   ```bash
   rad env delete my-env --preview
   ```

3. Confirm the applications and their resources are gone, not just the
environment:

   ```bash
   rad app list --preview
   rad resource list --preview
   ```

4. Confirm the command is idempotent — a second delete reports that the
environment was not
   found and exits successfully:

   ```bash
   rad env delete my-env --preview
   ```

5. Confirm the flag wiring:

   ```bash
rad env delete --help # lists both --preview and --force
rad env delete my-env --force # rejected: "--force requires preview
mode"
   rad env delete my-env --preview --force
   ```

6. Confirm the legacy path is unchanged:

   ```bash
   rad env delete my-env
   ```

## File change summary
| File | Summary of change |
| ---- | ----------------- |
| `pkg/cli/cmd/previewdelete.go` | New. Shared preview delete helpers:
`PreviewResourceID`/`PreviewApplicationID`/`PreviewEnvironmentID` ID
builders, `ListPreviewApplicationsInEnvironment`, `MergeResourcesByID`,
and `DeleteResourcesInParallel`. |
| `pkg/cli/cmd/previewdelete_test.go` | New. Unit tests for the ID
builders, merge/dedupe behavior, and parallel deletion including 404
tolerance, skipping of malformed entries, error surfacing, and `force`
passthrough. |
| `pkg/cli/cmd/env/delete/preview/delete.go` | Cascade implementation:
enumerate applications and resources, delete resources then applications
then the environment, accurate three-way confirmation prompt, no-op on a
missing environment, new `--force` flag, and updated help text. |
| `pkg/cli/cmd/env/delete/preview/cascade_test.go` | New. Behavioral
coverage of the cascade: missing environment, empty environment, full
cascade with deletion ordering, cross-environment isolation,
deduplication, all three prompt messages, declining the prompt,
`--force`, and resource, application, and enumeration failures. |
| `pkg/cli/cmd/env/delete/preview/delete_test.go` | Removed the
`Test_Run` case superseded by `cascade_test.go`, along with its
now-unused imports. |
| `pkg/cli/cmd/app/delete/preview/delete.go` | Replaced the private
`listResourcesOwnedByApplication`/`isResourceOwnedByApplication`
duplicates with `ListResourcesInApplication` plus the shared
`DeleteResourcesInParallel`. |
| `pkg/cli/cmd/app/delete/preview/delete_test.go` | Retargeted mocks
from `ListAllResourceTypesNames`/`ListResourcesOfType` onto
`ListResourcesInApplication`, and asserted the fully qualified
application ID contract. |
| `cmd/rad/cmd/root.go` | Wired env delete through
`wirePreviewSubcommandPreviewBase` so the preview command is the
executed base. This is what makes `--force` visible at parse time in
preview mode and rejected outside of it. |
| `cmd/rad/cmd/root_test.go` | Regression guards on the assembled
command tree covering `--preview`/`--force` exposure and the rejection
of `--force` without preview. |
| `pkg/cli/clients/management_test.go` | Added table-driven tests for
`isResourceInApplication` and `isResourceInEnvironment`, including
case-insensitive matching, preserving the coverage previously provided
by the removed helpers in `app/delete/preview`. |

---------

Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
DariuszPorowski added a commit that referenced this pull request Aug 26, 2026
….1 (#12831)

Patch release `v0.60.1` for channel `0.60`.

## Backported PRs

Listed in cherry-pick (topological) order. **Gap filler** = not
requested for the patch, but included because it touched the same region
of a shared file between `release/0.60` and a requested commit. Without
it the cherry-pick has no common merge base and conflicts.

| # | Commit | PR | Role |
| --- | --- | --- | --- |
| 1 | `6882b5fdf` | #12640 | Requested |
| 2 | `af0443809` | #12721 | Requested |
| 3 | `7c6de043d` | #12733 | **Gap filler** —
`.github/workflows/codeql.yml` |
| 4 | `ca7b5a3e7` | #12728 | Requested |
| 5 | `2eac7c1f1` | #12702 | Requested |
| 6 | `b4ebe2f28` | #12751 | Requested |
| 7 | `e30a2594d` | #12727 | Requested |
| 8 | `3c7dfecd6` | #12769 | **Gap filler** —
`.github/workflows/codeql.yml` |
| 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` |
| 10 | `f84184955` | #12775 | Requested |
| 11 | `415d5b9c2` | #12779 | Requested |
| 12 | `a1d976013` | #12782 | Requested |
| 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` |
| 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` |
| 15 | `073ca3cfa` | #12758 | Requested |
| 16 | `5e1f94c13` | #12785 | **Gap filler** —
`pkg/cli/cmd/install/kubernetes/kubernetes.go` |
| 17 | `1fd650af5` | #12742 | Requested |
| 18 | `19376c3f3` | #12829 | Requested |

Five of the six gap fillers are CI/test-only. #12785 is not: it adds a
Helm `control-plane-readiness` Job, a `pre-upgrade
wait-for-control-plane` command, UCP readiness probes, and a
NetworkPolicy change. It is required for #12829 to apply.

## Validation

Full chain dry-run cherry-picked onto `release/0.60` with zero
conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`,
`cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and
`test/validation` all pass.

---------

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
DariuszPorowski pushed a commit that referenced this pull request Aug 26, 2026
…ts and applications types (#12728)

## Summary

Adds `--preview` support to `rad resource list` so environment- and
application-scoped listing works with the `Radius.Core/environments` and
`Radius.Core/applications` resource types.

`rad resource list` is now wired through `wirePreviewSubcommand`,
matching the pattern used by the `rad env` and `rad app` commands. In
preview mode, the runner resolves fully-qualified `Radius.Core` resource
IDs instead of bare names, and validates applications against the
`Radius.Core` applications client.

## Reason for change

[#12481](#12481) made the
`[resourceType]` argument optional so `rad resource list` could list all
resources in an environment or application. That path only worked for
legacy resources.

`cli.RequireEnvironmentName` reduces the workspace environment to its
name, and `ListResourcesInEnvironment` re-qualifies a bare name as
`Applications.Core/environments`. Filtering is exact, case-insensitive
ID equality, so resources referencing `Radius.Core/environments` were
silently excluded and the command returned an empty list. `-a` had the
same problem, since it qualified names as
`Applications.Core/applications` and validated existence through the
legacy `GetApplication`.

Legacy and preview environments/applications may share a name, so the
client deliberately does not match both ID forms at once — that would
merge results from two distinct resources. Instead, the caller supplies
the exact ID it wants filtered.

Fixes: #12609

## How to test

Requires a preview environment (`rad env create <env> --preview`) and a
deployed preview application.

```bash
# All resources in the default (Radius.Core) environment
rad resource list --preview

# All resources in a specific preview environment
rad resource list -e my-env --preview

# Typed listing scoped to a preview environment
rad resource list Radius.Compute/containers -e my-env --preview

# All resources in a preview application
rad resource list -a my-app --preview

# Full Radius.Core resource IDs are accepted
rad resource list -a /planes/radius/local/resourceGroups/my-rg/providers/Radius.Core/applications/my-app --preview

# RADIUS_PREVIEW=true activates preview mode
RADIUS_PREVIEW=true rad resource list
```

Verify that legacy behavior is unchanged when `--preview` is omitted,
and that a legacy `Applications.Core` ID passed to `-e`/`-a` under
`--preview` is rejected with a clear message.

## File change summary

| File | Summary of change |
| ---- | ----------------- |
| `cmd/rad/cmd/root.go` | Wires `rad resource list` through
`wirePreviewSubcommand` so `--preview` and `RADIUS_PREVIEW=true` route
to the preview runner. |
| `cmd/rad/cmd/root_test.go` | Adds
`Test_ResourceList_ExposesPreviewFlag`, asserting the assembled command
tree exposes `--preview` on `rad resource list`. |
| `pkg/cli/cmd/resource/list/list.go` | Adds `NewPreviewCommand` and a
`Preview` field on the runner, sharing one implementation. In preview
mode, resolves `Radius.Core` environment/application IDs (preserving
full IDs, qualifying bare names, rejecting non-`Radius.Core` IDs),
validates applications via the `Radius.Core` applications client, and
passes full IDs to the list methods. Renames `EnvironmentName` to
`EnvironmentNameOrID` to reflect that it may hold a full ID. |
| `pkg/cli/cmd/resource/list/list_test.go` | Adds `Test_ValidatePreview`
for environment/application ID resolution and legacy-ID rejection, plus
`Test_Run` preview subtests covering typed/untyped environment and
application listing and the missing-application error. Updates existing
tests for the renamed field. |
| `pkg/cli/clients/clients.go` | Documents on the interface that bare
names target `Applications.Core` and that a full resource ID is needed
for other types. |
| `pkg/cli/clients/management.go` | Adds the same clarification to the
four list method implementations. No behavior change. |
| `pkg/cli/clients/management_test.go` | Adds a `fullyQualifyID` case
asserting a full `Radius.Core` ID is preserved verbatim — the property
the preview command depends on. |

---------

Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
(cherry picked from commit ca7b5a3)
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
DariuszPorowski added a commit that referenced this pull request Aug 26, 2026
….1 (#12831)

Patch release `v0.60.1` for channel `0.60`.

## Backported PRs

Listed in cherry-pick (topological) order. **Gap filler** = not
requested for the patch, but included because it touched the same region
of a shared file between `release/0.60` and a requested commit. Without
it the cherry-pick has no common merge base and conflicts.

| # | Commit | PR | Role |
| --- | --- | --- | --- |
| 1 | `6882b5fdf` | #12640 | Requested |
| 2 | `af0443809` | #12721 | Requested |
| 3 | `7c6de043d` | #12733 | **Gap filler** —
`.github/workflows/codeql.yml` |
| 4 | `ca7b5a3e7` | #12728 | Requested |
| 5 | `2eac7c1f1` | #12702 | Requested |
| 6 | `b4ebe2f28` | #12751 | Requested |
| 7 | `e30a2594d` | #12727 | Requested |
| 8 | `3c7dfecd6` | #12769 | **Gap filler** —
`.github/workflows/codeql.yml` |
| 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` |
| 10 | `f84184955` | #12775 | Requested |
| 11 | `415d5b9c2` | #12779 | Requested |
| 12 | `a1d976013` | #12782 | Requested |
| 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` |
| 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` |
| 15 | `073ca3cfa` | #12758 | Requested |
| 16 | `5e1f94c13` | #12785 | **Gap filler** —
`pkg/cli/cmd/install/kubernetes/kubernetes.go` |
| 17 | `1fd650af5` | #12742 | Requested |
| 18 | `19376c3f3` | #12829 | Requested |

Five of the six gap fillers are CI/test-only. #12785 is not: it adds a
Helm `control-plane-readiness` Job, a `pre-upgrade
wait-for-control-plane` command, UCP readiness probes, and a
NetworkPolicy change. It is required for #12829 to apply.

## Validation

Full chain dry-run cherry-picked onto `release/0.60` with zero
conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`,
`cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and
`test/validation` all pass.

---------

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
(cherry picked from commit e5938bf)
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
DariuszPorowski pushed a commit that referenced this pull request Aug 26, 2026
…ts and applications types (#12728)

## Summary

Adds `--preview` support to `rad resource list` so environment- and
application-scoped listing works with the `Radius.Core/environments` and
`Radius.Core/applications` resource types.

`rad resource list` is now wired through `wirePreviewSubcommand`,
matching the pattern used by the `rad env` and `rad app` commands. In
preview mode, the runner resolves fully-qualified `Radius.Core` resource
IDs instead of bare names, and validates applications against the
`Radius.Core` applications client.

## Reason for change

[#12481](#12481) made the
`[resourceType]` argument optional so `rad resource list` could list all
resources in an environment or application. That path only worked for
legacy resources.

`cli.RequireEnvironmentName` reduces the workspace environment to its
name, and `ListResourcesInEnvironment` re-qualifies a bare name as
`Applications.Core/environments`. Filtering is exact, case-insensitive
ID equality, so resources referencing `Radius.Core/environments` were
silently excluded and the command returned an empty list. `-a` had the
same problem, since it qualified names as
`Applications.Core/applications` and validated existence through the
legacy `GetApplication`.

Legacy and preview environments/applications may share a name, so the
client deliberately does not match both ID forms at once — that would
merge results from two distinct resources. Instead, the caller supplies
the exact ID it wants filtered.

Fixes: #12609

## How to test

Requires a preview environment (`rad env create <env> --preview`) and a
deployed preview application.

```bash
# All resources in the default (Radius.Core) environment
rad resource list --preview

# All resources in a specific preview environment
rad resource list -e my-env --preview

# Typed listing scoped to a preview environment
rad resource list Radius.Compute/containers -e my-env --preview

# All resources in a preview application
rad resource list -a my-app --preview

# Full Radius.Core resource IDs are accepted
rad resource list -a /planes/radius/local/resourceGroups/my-rg/providers/Radius.Core/applications/my-app --preview

# RADIUS_PREVIEW=true activates preview mode
RADIUS_PREVIEW=true rad resource list
```

Verify that legacy behavior is unchanged when `--preview` is omitted,
and that a legacy `Applications.Core` ID passed to `-e`/`-a` under
`--preview` is rejected with a clear message.

## File change summary

| File | Summary of change |
| ---- | ----------------- |
| `cmd/rad/cmd/root.go` | Wires `rad resource list` through
`wirePreviewSubcommand` so `--preview` and `RADIUS_PREVIEW=true` route
to the preview runner. |
| `cmd/rad/cmd/root_test.go` | Adds
`Test_ResourceList_ExposesPreviewFlag`, asserting the assembled command
tree exposes `--preview` on `rad resource list`. |
| `pkg/cli/cmd/resource/list/list.go` | Adds `NewPreviewCommand` and a
`Preview` field on the runner, sharing one implementation. In preview
mode, resolves `Radius.Core` environment/application IDs (preserving
full IDs, qualifying bare names, rejecting non-`Radius.Core` IDs),
validates applications via the `Radius.Core` applications client, and
passes full IDs to the list methods. Renames `EnvironmentName` to
`EnvironmentNameOrID` to reflect that it may hold a full ID. |
| `pkg/cli/cmd/resource/list/list_test.go` | Adds `Test_ValidatePreview`
for environment/application ID resolution and legacy-ID rejection, plus
`Test_Run` preview subtests covering typed/untyped environment and
application listing and the missing-application error. Updates existing
tests for the renamed field. |
| `pkg/cli/clients/clients.go` | Documents on the interface that bare
names target `Applications.Core` and that a full resource ID is needed
for other types. |
| `pkg/cli/clients/management.go` | Adds the same clarification to the
four list method implementations. No behavior change. |
| `pkg/cli/clients/management_test.go` | Adds a `fullyQualifyID` case
asserting a full `Radius.Core` ID is preserved verbatim — the property
the preview command depends on. |

---------

Signed-off-by: lakshmimsft <ljavadekar@microsoft.com>
(cherry picked from commit ca7b5a3)
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
DariuszPorowski added a commit that referenced this pull request Aug 26, 2026
….1 (#12831)

Patch release `v0.60.1` for channel `0.60`.

## Backported PRs

Listed in cherry-pick (topological) order. **Gap filler** = not
requested for the patch, but included because it touched the same region
of a shared file between `release/0.60` and a requested commit. Without
it the cherry-pick has no common merge base and conflicts.

| # | Commit | PR | Role |
| --- | --- | --- | --- |
| 1 | `6882b5fdf` | #12640 | Requested |
| 2 | `af0443809` | #12721 | Requested |
| 3 | `7c6de043d` | #12733 | **Gap filler** —
`.github/workflows/codeql.yml` |
| 4 | `ca7b5a3e7` | #12728 | Requested |
| 5 | `2eac7c1f1` | #12702 | Requested |
| 6 | `b4ebe2f28` | #12751 | Requested |
| 7 | `e30a2594d` | #12727 | Requested |
| 8 | `3c7dfecd6` | #12769 | **Gap filler** —
`.github/workflows/codeql.yml` |
| 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` |
| 10 | `f84184955` | #12775 | Requested |
| 11 | `415d5b9c2` | #12779 | Requested |
| 12 | `a1d976013` | #12782 | Requested |
| 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` |
| 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` |
| 15 | `073ca3cfa` | #12758 | Requested |
| 16 | `5e1f94c13` | #12785 | **Gap filler** —
`pkg/cli/cmd/install/kubernetes/kubernetes.go` |
| 17 | `1fd650af5` | #12742 | Requested |
| 18 | `19376c3f3` | #12829 | Requested |

Five of the six gap fillers are CI/test-only. #12785 is not: it adds a
Helm `control-plane-readiness` Job, a `pre-upgrade
wait-for-control-plane` command, UCP readiness probes, and a
NetworkPolicy change. It is required for #12829 to apply.

## Validation

Full chain dry-run cherry-picked onto `release/0.60` with zero
conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`,
`cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and
`test/validation` all pass.

---------

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
(cherry picked from commit e5938bf)
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:standard Ongoing maintenance, minor improvements, documentation updates, and routine development work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update rad resource list -- no resourcetype specified -- for new env type

3 participants