Skip to content

Workspace refactor feature spec#11775

Draft
zachcasper wants to merge 6 commits into
radius-project:mainfrom
zachcasper:workspace-refactor
Draft

Workspace refactor feature spec#11775
zachcasper wants to merge 6 commits into
radius-project:mainfrom
zachcasper:workspace-refactor

Conversation

@zachcasper
Copy link
Copy Markdown
Contributor

Description

This is a feature spec for refactoring the rad CLI workspace to be easier to use and understand.

Type of change

  • 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).

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 PR is created in the design-notes 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 the samples repository is created, if existing samples are 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
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.
    • Yes
    • Not applicable

Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Copilot AI review requested due to automatic review settings April 28, 2026 18:30
@zachcasper zachcasper requested review from a team as code owners April 28, 2026 18:30
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

Adds a CLI feature specification design note proposing to replace the user-facing “workspace” concept with per–kube-context defaults managed via rad configure --defaults, while keeping legacy workspaces: data as read-only compatibility for --workspace.

Changes:

  • Introduces a new feature spec describing UX rationale and command surface (rad configure --defaults, --list-defaults).
  • Defines config schema changes (defaults: keyed by kube context) and a per-key precedence/resolution order with legacy fallback.
  • Documents user stories, edge cases, and functional requirements (including concurrency/atomic-write expectations).

Comment thread eng/design-notes/cli/2026-04-workspace-refactor.md Outdated
Comment thread eng/design-notes/cli/2026-04-28-workspace-refactor.md Outdated
Comment thread eng/design-notes/cli/2026-04-workspace-refactor.md Outdated
Comment thread eng/design-notes/cli/2026-04-workspace-refactor.md
zachcasper and others added 4 commits May 6, 2026 11:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
@brooke-hamilton brooke-hamilton self-assigned this May 11, 2026
@brooke-hamilton brooke-hamilton removed their assignment May 12, 2026
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
@DariuszPorowski DariuszPorowski marked this pull request as draft May 18, 2026 18:37
Copy link
Copy Markdown
Member

@brooke-hamilton brooke-hamilton left a comment

Choose a reason for hiding this comment

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

🤖

### Top level goals

- Eliminate "workspace" as a user-visible concept in Radius CLI help, docs, and error messages for new users.
- Replace `rad workspace switch` / `rad group switch` / `rad env switch` with a single, discoverable `rad configure --defaults` surface.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are the commands listed here all consistent with their use of --group and --environment flags? If not, lets include modifying them to be consistent.

- Eliminate "workspace" as a user-visible concept in Radius CLI help, docs, and error messages for new users.
- Replace `rad workspace switch` / `rad group switch` / `rad env switch` with a single, discoverable `rad configure --defaults` surface.
- Make per-cluster defaults automatic by keying them on the active Kubernetes context, so `kubectl config use-context` is sufficient to switch Radius targets.
- Preserve backward compatibility for existing `~/.rad/config.yaml` files and for scripts that pass `--workspace <name>`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👀 ugh


### Non-goals (out of scope)

- Multiple named "profiles" per kube context. Users wanting multiple environments on the same cluster use `--group`/`--environment` flags or maintain separate kube contexts.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be worthwhile to repurpose the yaml config file to remember the defaults per kube config? So that when they configure a default in one kubectl context, the defaults are remembered for the next time they switch back to that context.

Edit: It looks like that is called out in scenario 3.


### Scenario 6: JSON-friendly defaults for scripting and CI

`rad configure --list-defaults --output json` returns a stable, scriptable schema. `rad configure --defaults …` runs non-interactively in CI, exiting non-zero with a stable error code on validation failure.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to enable rad configure to accept the same json format as in input argument?


> After this is implemented, I can install Radius, run `rad init`, and immediately deploy an application without ever typing or seeing the word "workspace". When I want different defaults, I run one command — `rad configure --defaults group=<name> environment=<name>` — modeled on the `az configure --defaults` pattern I already know. When I switch Kubernetes clusters with `kubectl config use-context`, my Radius defaults follow automatically because they are keyed on the active context. When I need to override defaults for a single command, I pass `-g`, `-e`, or `-w` and the precedence is consistent and predictable. As a result, my mental model is two concepts (resource group, environment) instead of three, my cluster-switching is one command instead of two, and my onboarding doc is shorter.

### Detailed user experience
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.

Are we saying Radius automatically resolves all the commands to default group and default environment when there are no non-defaults set ?

This eliminates all the switch commands and kube config serves as the operating cluster.

Copy link
Copy Markdown
Contributor

@willtsai willtsai left a comment

Choose a reason for hiding this comment

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

One of the things I find useful with Workspaces is the ability to deploy to a given kubecontext without needing to first point at that context. For example:

  • I'm currently in my local-dev kubecontext
  • I have an aks-prod kubecontext set up as well, and that is associated with my aks-prod Workspace
  • I can issue commands like rad deploy app.bicep -w aks-prod to target a separate kubecontext while remaining in another kubecontext

I'm wondering if there will be a replacement or workaround for this use case in this proposal, or is the idea that this is not reflective of how someone would actually use Radius?

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.

5 participants