Skip to content

deprecate playground#2074

Draft
jordanstephens wants to merge 1 commit intomainfrom
jordan/deprecate-playground
Draft

deprecate playground#2074
jordanstephens wants to merge 1 commit intomainfrom
jordan/deprecate-playground

Conversation

@jordanstephens
Copy link
Copy Markdown
Member

@jordanstephens jordanstephens commented Apr 24, 2026

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 selection is now limited exclusively to BYOC (Bring Your Own Cloud) providers for all deployments
    • "Defang Playground" provider option has been removed from available deployment selections
    • CLI provider flag help text and shell completion candidates have been updated to show only BYOC providers
    • Deployment wizard provider selection interface has been updated to reflect the new restricted provider list

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

📝 Walkthrough

Walkthrough

The PR restricts available provider options to BYOC providers only by introducing a new ByocProviders() function that excludes both "auto" and "defang" providers, and updates the CLI commands and wizard to use this subset instead of all providers.

Changes

Cohort / File(s) Summary
Provider Function Update
src/pkg/cli/client/provider_id.go
Replaces AllProviders() with new ByocProviders() function that returns provider list excluding both "auto" and "defang" entries.
CLI & Wizard Integration
src/cmd/cli/command/commands.go, src/pkg/stacks/wizard.go
Updates references from AllProviders() to ByocProviders() for provider flag help text, shell completion, and wizard provider selection.
Test Updates
src/pkg/stacks/selector_test.go
Updates selector wizard test mocks to expect the reduced provider list without "Defang Playground".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • lionello

Poem

🐰 A hop, a skip, we filter the way,
BYOC shines brighter today!
Auto and Defang step aside with grace,
While providers dance through a narrower space. ✨

🚥 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 'deprecate playground' directly describes the main change: removing the playground provider from interactive 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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.11.4)

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"


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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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
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