feat: rebucket "Number of developers" onboarding options (#24573)

This commit is contained in:
david-fraley
2026-04-21 15:11:50 -05:00
committed by GitHub
parent 79a9f437d7
commit f77827e84a
4 changed files with 80 additions and 6 deletions
+14 -2
View File
@@ -599,10 +599,22 @@ func promptTrialInfo(inv *serpent.Invocation, fieldName string) (string, error)
return value, nil
}
// developerBuckets are the options offered for the "Number of developers"
// prompt during first-user setup. Keep in sync with
// site/src/pages/SetupPage/SetupPageView.tsx (numberOfDevelopersOptions).
var developerBuckets = []string{
"1 - 50",
"51 - 100",
"101 - 200",
"201 - 500",
"501 - 1000",
"1001 - 2500",
"2500+",
}
func promptDevelopers(inv *serpent.Invocation) (string, error) {
options := []string{"1-100", "101-500", "501-1000", "1001-2500", "2500+"}
selection, err := cliui.Select(inv, cliui.SelectOptions{
Options: options,
Options: developerBuckets,
HideSearch: false,
Message: "Select the number of developers:",
})
+25
View File
@@ -0,0 +1,25 @@
package cli
import (
"testing"
"github.com/stretchr/testify/require"
)
// TestDeveloperBuckets pins the set of options offered for the
// "Number of developers" prompt. If this test fails, also update the
// matching list in site/src/pages/SetupPage/SetupPageView.tsx
// (numberOfDevelopersOptions) and coordinate with the licensor service owner,
// since the same string is forwarded to v2-licensor.coder.com/trial.
func TestDeveloperBuckets(t *testing.T) {
t.Parallel()
require.Equal(t, []string{
"1 - 50",
"51 - 100",
"101 - 200",
"201 - 500",
"501 - 1000",
"1001 - 2500",
"2500+",
}, developerBuckets)
}