add workspace create --preview#11905
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11905 +/- ##
==========================================
+ Coverage 51.71% 51.72% +0.01%
==========================================
Files 724 725 +1
Lines 45522 45571 +49
==========================================
+ Hits 23540 23572 +32
- Misses 19762 19774 +12
- Partials 2220 2225 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds rad workspace create --preview support so a workspace can be bound to a Radius.Core/environments resource (v2025-08-01-preview) instead of the legacy Applications.Core/environments, addressing issue #11670.
Changes:
- Introduces a preview implementation of
workspace createthat validatesRadius.Core/environments. - Refactors the legacy
workspace createrunner to support an injectable environment validation function. - Wires
rad workspace create --previewthrough the root command and adds targeted unit tests for the preview path.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/cli/cmd/workspace/create/preview/create.go | Adds preview runner that validates Radius.Core/environments and returns the corresponding env resource ID. |
| pkg/cli/cmd/workspace/create/preview/create_test.go | Adds tests for preview env validation and basic run behavior. |
| pkg/cli/cmd/workspace/create/create.go | Refactors legacy create to use an EnvironmentValidator hook and centralizes legacy env ID construction. |
| cmd/rad/cmd/root.go | Wires --preview routing for workspace create using the existing wirePreviewSubcommand mechanism. |
| if _, err := r.RadiusCoreClientFactory.NewEnvironmentsClient().Get(ctx, envName, nil); err != nil { | ||
| return "", clierrors.Message("The environment %q does not exist. Run `rad env create --preview` and try again.", envID) | ||
| } |
| func ValidateApplicationsCoreEnvironment(ctx context.Context, ws *workspaces.Workspace, mgmtClient clients.ApplicationsManagementClient, envName string) (string, error) { | ||
| envID := ws.Scope + "/providers/" + datamodel.EnvironmentResourceType + "/" + envName | ||
| if _, err := mgmtClient.GetEnvironment(ctx, envName); err != nil { | ||
| return "", clierrors.Message("The environment %q does not exist. Run `rad env create` try again.", envID) |
| workspaceCreateCmd, _ := workspace_create.NewCommand(framework) | ||
| previewWorkspaceCreateCmd, _ := workspace_create_preview.NewCommand(framework) | ||
| wirePreviewSubcommand(workspaceCreateCmd, previewWorkspaceCreateCmd) | ||
| workspaceCmd.AddCommand(workspaceCreateCmd) |
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
|
/LGTM once above flagged issues by Copilot are addressed for 404 error |
Description
support rad workspace create --preview
Type of change
Fixes: #11670
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.