Show the Orbit trial on the group Orbit settings page

What does this MR do and why?

Owners can now start a free Orbit trial from the group Settings > Orbit page. The page asks CustomersDot if the group can start a trial, and shows the right state.

  • Show a free trial banner, and start the trial from the Turn on Orbit toggle after a confirm (orbitStartTrial).
  • Read the page state from the new Group.orbitAccess field (state, reason, why turn on is denied), so the backend decides it once. The turn-on rule is shared with ToggleNamespaceService.
  • Show the trial state on the page: running, ended, or credits used up.
  • Gate the trial with the orbit_trial flag and CustomersDot eligibility.
  • Show the sales-led page when the trial is closed.

Because the backend now decides the state, three cases show a different alert than before:

  • Promo gate on and no access: "not available for this group" instead of the Free plan alert.
  • Promo gate on, no trial flow, and no access: an alert instead of a plain toggle. The toggle shows only while Orbit is on.
  • Orbit not set up on the instance: "not available for this group".

Closes gitlab-org/orbit/knowledge-graph#1339

Part of gitlab-org/orbit#19.

How the trial is gated

Gate Closed Open
The orbit_trial flag (per top-level group, GitLab.com only) Sales-led page: the toggle when the group has Orbit, Contact sales when it has none The page asks CustomersDot for the trial state
Trial criteria (CustomersDot eligibility) Not eligible: Contact sales Eligible: Start free trial
Self-managed and Dedicated Always sales-led —

Screenshots or screen recordings

State Screenshot
Eligible (Start free trial)
Confirm
Trial started, indexing
Ready
Trial running, Orbit off
GitLab Duo not available
Beta or paid group
Trial ended
Credits used up
Not eligible
Free plan
Free plan: Contact sales, then Compare plans
CustomersDot does not answer
Start fails
Flag off, licensed
Flag off, no license
Old empty state (Turn on)
Old Configure menu
Member (404)
Duo readiness row

How to set up and validate locally

  1. Simulate SaaS (GITLAB_SIMULATE_SAAS=1) and point GDK at a local CustomersDot.
  2. In the Rails console, turn on the trial flag for one top-level group: Feature.enable(:orbit_trial, Group.find_by_full_path('my-group')).
  3. As an Owner, go to the group Settings > Orbit page, select Start free trial, and confirm.
  4. Turn the flag off and reload: the page shows the toggle (with Orbit) or Contact sales (without).
Design decisions
  • The trial starts from a button that opens a confirm, because a toggle takes effect at once and has no confirm (Pajamas).
  • An active trial shows a "Free trial" badge, not days or credits (design feedback).
  • Contact sales uses the existing sales form as a placeholder.
  • Trial ended and credits used up are told apart by the trial end date, because CustomersDot sets the balance to 0 when a trial expires.

Database

The MR adds two indexed queries on the Orbit enrollment table. Every plan uses an index, and none takes more than 2 ms warm on postgres.ai (gitlab-production-main).

Query plans
Query Plan Warm total
Orbit enrollment, one group (new) #166787 1.5 ms
Orbit enrollment, 101 groups (new preload for the group lists) #166789 0.8 ms
Enabled namespace, one group (enabledAt reuses it) #166795 0.5 ms
Enabled namespace, 101 groups #166797 0.8 ms

The old Your work > Orbit Configure menu already runs two queries per group on master (subscription and member access level). This MR adds one constant query to it, the preload above. We do not fix that N+1: the redesign removes this menu (gitlab-org/orbit/knowledge-graph#1368).

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jean-Gabriel Doyon

Merge request reports

Loading
Loading