feat: opt-in sign-up trial (ADR 0036) #94

Sammanfogat
supernaut sammanfogade 3 incheckningar från feat/signup-trial in i main 2026-07-28 16:08:32 +00:00
Ägare

What

Adds an opt-in trial to sign-up: a new user can tick a box to start a time-boxed trial that
grants the same capabilities as a paid account, ending at the end of August 2026, after which the
account becomes a participant account. The checkbox is a temporary stand-in for the future
"subscribe" option (ADR 0036).

Implements bitborg-web#92 and bitborg-web#93 (epic bitborg-docs#51).

Changes

  • Trial checkbox (signup-form.astro) with in-form text explaining the end date and downgrade,
    rendered only while the TRIAL_OPEN kill switch is on (mirrors SIGNUPS_OPEN / ADR 0029).
  • /api/signup reads the trial flag (re-checking trialOpen() server-side), provisions a trial
    sign-up into the tier_trial Kanidm group and a non-trial into the participant baseline, and
    records consent (trial, trial_terms_version) in the signups table.
  • src/lib/kanidm.ts picks the trial vs base tier group per sign-up; the fallback base default
    is aligned to tier_participant to match the already-live prod value (bitborg-web#93 — this is
    the code fallback only, not a prod behaviour change; prod already sets it via group_vars).
  • Separate trial-terms page at /trial-terms (+ /en/trial-terms), linked from the checkbox:
    what the trial grants, the fixed end date, what the participant downgrade means (no new hosting,
    data retained and exportable), no charge, no auto-renewal.
  • Account panel shows a trial badge with the end date for tier_trial members.
  • Schema: signups.trial + signups.trial_terms_version (+ generated migration 0004).
  • i18n: signup.trial*, panel.plan.trial*, trialTerms.* in both locales.
  • Drive-by: fixed a stale TERMS_VERSION (2026-07-09 → 2026-07-26, matching the terms content).

How it works

A trial sign-up lands the person in tier_trial; the entitlement reconciler projects that to the
paid Forgejo quota group plus org-create and Actions (via the group's nesting). At end of August
an operator-run batch (runbook) moves trial members to the participant group and the reconciler
revokes the paid capabilities. Retiring the trial later = flip TRIAL_OPEN=false.

Depends on

  • bitborg-infra: tier_trial group + nesting + KANIDM_TRIAL_GROUP/TRIAL_OPEN env (PR in
    bitborg-infra).
  • bitborg-auth-reconciler: tier_trial → paid mapping (PR in bitborg-auth-reconciler).

Merge order for prod: reconciler + infra first (so the group exists and is projected), then this.

Testing

pnpm check (0 errors), pnpm lint, pnpm test (57 pass, incl. new trial provisioning cases),
content style guide check on all new copy — all green. Not yet applied to prod.

## What Adds an opt-in **trial** to sign-up: a new user can tick a box to start a time-boxed trial that grants the same capabilities as a paid account, ending at the end of August 2026, after which the account becomes a participant account. The checkbox is a temporary stand-in for the future "subscribe" option (ADR 0036). Implements bitborg-web#92 and bitborg-web#93 (epic bitborg-docs#51). ## Changes - **Trial checkbox** (`signup-form.astro`) with in-form text explaining the end date and downgrade, rendered only while the `TRIAL_OPEN` kill switch is on (mirrors `SIGNUPS_OPEN` / ADR 0029). - **`/api/signup`** reads the trial flag (re-checking `trialOpen()` server-side), provisions a trial sign-up into the `tier_trial` Kanidm group and a non-trial into the participant baseline, and records consent (`trial`, `trial_terms_version`) in the `signups` table. - **`src/lib/kanidm.ts`** picks the trial vs base tier group per sign-up; the fallback base default is aligned to `tier_participant` to match the already-live prod value (bitborg-web#93 — this is the code fallback only, **not** a prod behaviour change; prod already sets it via group_vars). - **Separate trial-terms page** at `/trial-terms` (+ `/en/trial-terms`), linked from the checkbox: what the trial grants, the fixed end date, what the participant downgrade means (no new hosting, data retained and exportable), no charge, no auto-renewal. - **Account panel** shows a trial badge with the end date for `tier_trial` members. - **Schema:** `signups.trial` + `signups.trial_terms_version` (+ generated migration `0004`). - **i18n:** `signup.trial*`, `panel.plan.trial*`, `trialTerms.*` in both locales. - Drive-by: fixed a stale `TERMS_VERSION` (2026-07-09 → 2026-07-26, matching the terms content). ## How it works A trial sign-up lands the person in `tier_trial`; the entitlement reconciler projects that to the `paid` Forgejo quota group plus org-create and Actions (via the group's nesting). At end of August an operator-run batch (runbook) moves trial members to the participant group and the reconciler revokes the paid capabilities. Retiring the trial later = flip `TRIAL_OPEN=false`. ## Depends on - bitborg-infra: `tier_trial` group + nesting + `KANIDM_TRIAL_GROUP`/`TRIAL_OPEN` env (PR in bitborg-infra). - bitborg-auth-reconciler: `tier_trial` → `paid` mapping (PR in bitborg-auth-reconciler). Merge order for prod: reconciler + infra first (so the group exists and is projected), then this. ## Testing `pnpm check` (0 errors), `pnpm lint`, `pnpm test` (57 pass, incl. new trial provisioning cases), content style guide check on all new copy — all green. Not yet applied to prod.
supernaut lade till 1 incheckning 2026-07-28 12:17:36 +00:00
feat: opt-in trial at sign-up with paid capabilities (ADR 0036)
En del kontroller misslyckades
ci / ci (pull_request) Failing after 51s
edeb1edaf3
- signup-form: opt-in trial checkbox + expiry/downgrade hint, behind trialOpen()
- api/signup: read trial flag (gated by TRIAL_OPEN), provision into trial tier,
  persist trial + trial_terms_version; also fix stale TERMS_VERSION (07-09 -> 07-26)
- kanidm lib: pick trial vs base tier group; default base to tier_participant
- schema: signups.trial + signups.trial_terms_version (+ migration 0004)
- trial-terms page (sv + en) linked from the checkbox
- account panel: trial badge with end date
- i18n: signup.trial*, panel.plan.trial*, trialTerms.* (sv + en)

Refs gitborg-web#92, gitborg-web#93, gitborg-docs#51
supernaut tvångsskickade feat/signup-trial från edeb1edaf3
En del kontroller misslyckades
ci / ci (pull_request) Failing after 51s
till ae816e5547
En del kontroller misslyckades
ci / ci (pull_request) Failing after 49s
2026-07-28 13:47:07 +00:00
Jämför
supernaut lade till 1 incheckning 2026-07-28 16:01:43 +00:00
refactor: tweak sign-up
Alla kontroller lyckades
ci / ci (pull_request) Successful in 53s
8e7d42dd6b
supernaut lade till 1 incheckning 2026-07-28 16:06:10 +00:00
chore: bump version
Alla kontroller lyckades
ci / ci (pull_request) Successful in 54s
56724dd7f2
supernaut sammanfogade incheckning e4648353c6 till main 2026-07-28 16:08:32 +00:00
supernaut tog bort grenen feat/signup-trial 2026-07-28 16:08:32 +00:00
supernaut refererade denna ändringsförfrågan från en incheckning 2026-07-28 16:08:34 +00:00
supernaut refererade denna ändringsförfrågan från en incheckning 2026-08-03 09:41:50 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web!94
Ingen beskrivning angiven.