Skip to content

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

Merged
david-fraley merged 1 commit intomainfrom
feat/onboarding-developer-buckets
Apr 21, 2026
Merged

feat: rebucket "Number of developers" onboarding options#24573
david-fraley merged 1 commit intomainfrom
feat/onboarding-developer-buckets

Conversation

@david-fraley
Copy link
Copy Markdown
Collaborator

@david-fraley david-fraley commented Apr 21, 2026

What

Split the "Number of developers" buckets on the first-user setup page into seven narrower ranges, with a space on each side of the hyphen.

Before After
1-100 1 - 50
101-500 51 - 100
501-1000 101 - 200
1001-2500 201 - 500
2500+ 501 - 1000
1001 - 2500
2500+

The bucket list is duplicated in two source-of-truth files (frontend form and CLI prompt); both now match, each with a keep-in-sync comment pointing at the other.

Why

Finer segmentation of trial signups, particularly around the old 1-100 and 101-500 boundaries.

Downstream / licensor (BigQuery)

The selected bucket is JSON-serialized and POSTed to https://v2-licensor.coder.com/trial by enterprise/trialer/trialer.go. That licensor service is out of this repo. If it ingests trial signups into BigQuery (or any exact-string bucket), the schema, allowlists, dashboards, and historical rollups need coordinated updates:

  • New exact values will start arriving: 1 - 50, 51 - 100, 101 - 200, 201 - 500, 501 - 1000, 1001 - 2500. Note 501 - 1000 and 1001 - 2500 are also new strings (whitespace change).
  • Bucket splits at 50 (inside the old 1-100) and 200 (inside the old 101-500). Any rollup that joins old and new values by exact string will undercount both sides of those two boundaries.
  • 2500+ is unchanged.

Licensor-repo owner needs to (a) extend any enum or allowlist, (b) update dashboards grouped by developers, (c) decide a reconciliation rule for historical values.

Out of scope (verified, no changes needed)

  • API schema: codersdk.CreateFirstUserTrialInfo.Developers is already a free-form string; coderd/apidoc/docs.go and docs/reference/api/{users,schemas}.md already document it as string. No enum, no validation.
  • Backend: coderd/users.go passes the value straight through; no database column, audit table, or converter involved.
  • Fixture coderdtest.TrialUserParams.Developers = "10-50": free-form sentinel not in the UI list, never asserted against the enum. Left unchanged.

Tests

  • cli/login_internal_test.go (new): TestDeveloperBuckets pins the exact 7-string slice.
  • site/src/pages/SetupPage/SetupPageView.stories.tsx: new TrialOpen story whose play function ticks the trial checkbox, opens the Select, and asserts getAllByRole("option") returns the 7 labels in order.

Local runs:

  • go test ./cli/ -run '^(TestDeveloperBuckets|TestLogin)$' passes.
  • pnpm exec vitest run --project=storybook src/pages/SetupPage/SetupPageView.stories.tsx passes (6 tests including TrialOpen).
  • make pre-commit via the installed hook passed in 84s.
Implementation plan (decision log)
  • Extracted developerBuckets in cli/login.go so the list is directly assertable. Alternative was a ptytest-driven prompt test, rejected as more fragile.
  • New test colocated in cli/login_internal_test.go (package cli) so it can access the unexported slice; matches existing *_internal_test.go convention in cli/.
  • Did not introduce a shared codersdk constant for the bucket list. Frontend cannot import Go constants and threading through typesGenerated.ts is a bigger change than warranted. Mitigated with keep-in-sync comments at each site.

This PR was authored by a Coder Agent on behalf of @david-fraley.

Split the setup-page developer-count buckets into seven narrower ranges
with a space on each side of the hyphen:

  1-100     -\u003e 1 - 50, 51 - 100
  101-500   -\u003e 101 - 200, 201 - 500
  501-1000  -\u003e 501 - 1000
  1001-2500 -\u003e 1001 - 2500
  2500+     -\u003e 2500+

Applied in both places the bucket list lives:
- site/src/pages/SetupPage/SetupPageView.tsx (numberOfDevelopersOptions)
- cli/login.go (extracted to package-level developerBuckets to make the
  set directly testable)

Downstream note: the selected bucket is JSON-serialized and POSTed to
v2-licensor.coder.com/trial by enterprise/trialer/trialer.go. That
service is out of this repo; if it ingests trial signups into BigQuery
or any exact-string bucket, its schema, allowlists, dashboards, and
historical rollups will need to be updated to handle the new values.

This PR was authored by a Coder Agent on behalf of @david-fraley.
@david-fraley david-fraley marked this pull request as ready for review April 21, 2026 14:43
Copy link
Copy Markdown
Contributor

@jeremyruppel jeremyruppel left a comment

Choose a reason for hiding this comment

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

@david-fraley I checked the licensor service and I don't see any schema change necessary. dashboards for existing queries must live elsewhere, so the caveats around updating dashboards and potential undercounting for existing queries still apply. code change looks good to me!

@david-fraley david-fraley merged commit f77827e into main Apr 21, 2026
40 checks passed
@david-fraley david-fraley deleted the feat/onboarding-developer-buckets branch April 21, 2026 20:11
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants