Skip to content

deprecate playground#2074

Open
jordanstephens wants to merge 2 commits into
mainfrom
jordan/deprecate-playground
Open

deprecate playground#2074
jordanstephens wants to merge 2 commits into
mainfrom
jordan/deprecate-playground

Conversation

@jordanstephens

@jordanstephens jordanstephens commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

remove playground from interactive provider selection and from provider flag options

Linked Issues

Checklist

  • I have performed a self-review of my code
  • I have added appropriate tests
  • I have updated the Defang CLI docs and/or README to reflect my changes, if necessary

Summary by CodeRabbit

Release Notes

  • Changes
    • Provider choices are now restricted to BYOC (Bring Your Own Cloud) providers across deployment flows when no specific provider is selected.
    • The “Defang Playground” provider option has been removed from the provider selection lists.
    • The CLI --provider/-P flag help text and shell completion now only suggest BYOC provider values.
    • The deployment wizard’s “Where do you want to deploy?” provider prompt has been updated to reflect the restricted provider set.

@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4f969e53-d9f6-4420-8732-dad1c8972e0b

📥 Commits

Reviewing files that changed from the base of the PR and between de47e6a and 6909bb8.

📒 Files selected for processing (4)
  • src/cmd/cli/command/commands.go
  • src/pkg/cli/client/provider_id.go
  • src/pkg/stacks/selector_test.go
  • src/pkg/stacks/wizard.go
💤 Files with no reviewable changes (1)
  • src/pkg/stacks/wizard.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/cmd/cli/command/commands.go
  • src/pkg/cli/client/provider_id.go
  • src/pkg/stacks/selector_test.go

📝 Walkthrough

Walkthrough

The PR narrows provider enumeration to BYOC providers in the shared accessor, updates CLI help/completion and wizard selection to use that subset, and adjusts selector tests to match the reduced provider list.

Changes

BYOC provider subset

Layer / File(s) Summary
Provider subset accessor
src/pkg/cli/client/provider_id.go
Adds ByocProviders() and changes the returned slice to exclude both auto and defang.
CLI and wizard provider enumeration
src/cmd/cli/command/commands.go, src/pkg/stacks/wizard.go
Switches provider help/completion and wizard enumeration from AllProviders() to ByocProviders().
Selector test expectations
src/pkg/stacks/selector_test.go
Updates mocked provider option lists to omit Defang Playground in the affected wizard tests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: lionello

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: removing the playground provider from user-facing selection and flag options.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jordan/deprecate-playground

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=warning msg="The linter 'gomodguard' is deprecated (since v2.12.0) due to: new major version. Replaced by gomodguard_v2."
level=warning msg="Suggested new configuration:\nlinters:\n enable:\n - gomodguard_v2\n"
level=warning msg="[linters_context] running gomodguard failed: unable to read module file go.mod: current working directory must have a go.mod file: if you are not using go modules it is suggested to disable this linter"
level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
src/pkg/cli/client/provider_id.go (1)

30-31: Avoid index-coupled filtering and returning a shared slice.

allProviders[2:] depends on ordering and exposes the backing array. Returning a filtered copy is safer and clearer.

Proposed refactor
 func ByocProviders() []ProviderID {
-	return allProviders[2:] // skip "auto" and "defang"
+	providers := make([]ProviderID, 0, len(allProviders))
+	for _, p := range allProviders {
+		if p == ProviderAuto || p == ProviderDefang {
+			continue
+		}
+		providers = append(providers, p)
+	}
+	return providers
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pkg/cli/client/provider_id.go` around lines 30 - 31, ByocProviders
currently returns allProviders[2:], which is index-dependent and exposes the
backing array; change ByocProviders to build and return a new slice by iterating
over allProviders and appending only providers whose IDs/names are not "auto" or
"defang" (or otherwise match the intended excluded values) so the result is a
copied, filtered list; use the ByocProviders function and the allProviders
variable to locate the code and ensure the returned slice is newly allocated
(not a sub-slice) and not dependent on ordering.
src/pkg/stacks/selector_test.go (1)

186-187: Optional: deduplicate repeated provider option literals in tests.

The same providerOptions slice is repeated across multiple tests; consider a shared test helper/fixture to reduce drift.

Also applies to: 262-263, 421-423, 458-460

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pkg/stacks/selector_test.go` around lines 186 - 187, Tests repeatedly
declare the same providerOptions slice and pass it into mockEC.On(...,
"provider", providerOptions); extract that literal into a shared test fixture
(e.g., a package-level var ProviderOptions []string or a helper function
ProviderOptions()) and update all occurrences that declare providerOptions and
call mockEC.On to use the shared symbol instead; ensure the helper/var is placed
in the same test package (selector_test) so existing tests (the places calling
mockEC.On with "provider") can import it without changing signatures.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/pkg/cli/client/provider_id.go`:
- Around line 30-31: ByocProviders currently returns allProviders[2:], which is
index-dependent and exposes the backing array; change ByocProviders to build and
return a new slice by iterating over allProviders and appending only providers
whose IDs/names are not "auto" or "defang" (or otherwise match the intended
excluded values) so the result is a copied, filtered list; use the ByocProviders
function and the allProviders variable to locate the code and ensure the
returned slice is newly allocated (not a sub-slice) and not dependent on
ordering.

In `@src/pkg/stacks/selector_test.go`:
- Around line 186-187: Tests repeatedly declare the same providerOptions slice
and pass it into mockEC.On(..., "provider", providerOptions); extract that
literal into a shared test fixture (e.g., a package-level var ProviderOptions
[]string or a helper function ProviderOptions()) and update all occurrences that
declare providerOptions and call mockEC.On to use the shared symbol instead;
ensure the helper/var is placed in the same test package (selector_test) so
existing tests (the places calling mockEC.On with "provider") can import it
without changing signatures.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d9fc520c-008b-4e40-98fd-9fc638cafe35

📥 Commits

Reviewing files that changed from the base of the PR and between f4039ae and de47e6a.

📒 Files selected for processing (4)
  • src/cmd/cli/command/commands.go
  • src/pkg/cli/client/provider_id.go
  • src/pkg/stacks/selector_test.go
  • src/pkg/stacks/wizard.go

@lionello lionello marked this pull request as draft April 24, 2026 21:01
@lionello lionello added the wip Work in progress; don't merge label Apr 25, 2026
@lionello lionello marked this pull request as ready for review July 7, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wip Work in progress; don't merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants