Skip to content

add workspace create --preview#11905

Open
nithyatsu wants to merge 3 commits into
radius-project:mainfrom
nithyatsu:radcorews
Open

add workspace create --preview#11905
nithyatsu wants to merge 3 commits into
radius-project:mainfrom
nithyatsu:radcorews

Conversation

@nithyatsu
Copy link
Copy Markdown
Contributor

@nithyatsu nithyatsu commented May 14, 2026

Description

support rad workspace create --preview

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).
  • This pull request adds or changes features of Radius and has an approved issue (issue link required).
  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).
  • This pull request is a design document and only includes files in the eng/design-notes directory.

Fixes: #11670

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • Not applicable
  • A design document is added or updated under eng/design-notes/ in this repository, if new APIs are being introduced.
    • Yes
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • Not applicable
  • A PR for resource-types-contrib is created, if resource types or recipes are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for dashboard is created, if the Radius Dashboard is affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 86.79245% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.72%. Comparing base (c7665ec) to head (f2f61b8).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cli/cmd/workspace/create/preview/create.go 86.48% 4 Missing and 1 partial ⚠️
pkg/cli/cmd/workspace/create/create.go 85.71% 1 Missing and 1 partial ⚠️
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.
📢 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.

@nithyatsu nithyatsu marked this pull request as ready for review May 19, 2026 17:52
@nithyatsu nithyatsu requested review from a team as code owners May 19, 2026 17:52
Copilot AI review requested due to automatic review settings May 19, 2026 17:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 create that validates Radius.Core/environments.
  • Refactors the legacy workspace create runner to support an injectable environment validation function.
  • Wires rad workspace create --preview through 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.

Comment on lines +110 to +112
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)
Comment thread cmd/rad/cmd/root.go
Comment on lines 388 to 391
workspaceCreateCmd, _ := workspace_create.NewCommand(framework)
previewWorkspaceCreateCmd, _ := workspace_create_preview.NewCommand(framework)
wirePreviewSubcommand(workspaceCreateCmd, previewWorkspaceCreateCmd)
workspaceCmd.AddCommand(workspaceCreateCmd)
@radius-functional-tests
Copy link
Copy Markdown

radius-functional-tests Bot commented May 19, 2026

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository nithyatsu/radius
Commit ref f2f61b8
Unique ID funcecd5ebffbe
Image tag pr-funcecd5ebffbe
  • gotestsum 1.13.0
  • KinD: v0.29.0
  • 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-funcecd5ebffbe
  • 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-funcecd5ebffbe
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcecd5ebffbe
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcecd5ebffbe
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcecd5ebffbe
  • 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...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@lakshmimsft
Copy link
Copy Markdown
Contributor

/LGTM once above flagged issues by Copilot are addressed for 404 error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to create workspaces with Radius.Core/environments

3 participants