refactor(onboarding): Encapsulate the quickstart experiment in one module - #8263
refactor(onboarding): Encapsulate the quickstart experiment in one module#8263khvn26 wants to merge 14 commits into
Conversation
The onboarding flow decision is now made in the backend, per organisation. Serving a multivariate split assignment records the experiment exposure; the first SDK evaluation of any of the organisation's environments records the conversion, both against the organisation targeting key. - flagsmith 6.2.0 and openfeature-provider-flagsmith from its experimentation-tracking PR branch - events enabled on the Flagsmith-on-Flagsmith client via FLAGSMITH_ON_FLAGSMITH_SERVER_EVENTS_API_URL (set in staging and production ECS task definitions; never enabled in offline mode) - get_openfeature_client() attaches the provider's exposure hook, so any multivariate split evaluation records an exposure - onboarding_variant field on the organisation serialiser beep boop
The gate no longer evaluates the Flagsmith-on-Flagsmith flag client-side; the backend decides per organisation and the exposure is recorded server-side. beep boop
Also refreshes a stale line reference in the generated events catalogue. beep boop
The frontend decides the onboarding variant before the organisation exists, evaluating with an anonymous identity. Storing that identity's identifier as the organisation's targeting key keeps bucketing and experiment events on one identifier from the first anonymous evaluation onward. Write-only on create and immutable after; org.<id> when unset. beep boop
The entry decision is made under a server-assigned anonymous identity before the organisation exists: the frontend identifies with an empty identifier, reads the flag under the returned one (recording the exposure), and stores identifier and variant. The identifier becomes the organisation's targeting key at creation in both arms, and the stored variant drives routing, the chromeless layout and the gate. The backend no longer serves onboarding_variant: with one Flagsmith-on-Flagsmith project across frontend and API, the flag decision needs no API surface. beep boop
When the routing timeout won the race, the late decision still wrote its variant and targeting key — read from whatever identity the SDK held by then, possibly the logged-in user. Decisions are now persisted only when they win the race. beep boop
The render check already treats a missing decision as the legacy page, so the defaulted copy was redundant. beep boop
…ation The stored targeting key survived invite acceptance and keyless creation paths, so a user's first organisation created long after the entry decision could consume it. Any organisation membership now clears the key. beep boop
…dule All frontend code the experiment touches now lives in common/experiments/onboardingQuickstart.ts, including a useOnboardingQuickstart hook that owns the gate's variant read and analytics tagging. Cleaning up the experiment is deleting the module and unpicking its importers. beep boop
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@themis-blindfold review |
⚖️ Themis review: ✅ Ship itClean encapsulation of the onboarding quickstart experiment into a single frontend module (
📝 Walkthrough
🧪 How to verify
Automate: steps 4–5 are already covered by CI; step 2 could be a lightweight integration test asserting the response body omits Product take: This is plumbing for experiment observability, not a user-facing change. It makes the quickstart experiment measurable (conversion events tied to bucketing) and makes future cleanup straightforward (delete one module). Solid infrastructure work. 🧭 Assumptions & unverified claims
An experiment module that's born ready for its own funeral — respect. · reviewed at 9b16eb5 |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Follow-up to #8242, per the review suggestion to encapsulate experiments for easy cleanup.
All frontend code the onboarding quickstart experiment touches now lives in
common/experiments/onboardingQuickstart.ts. The hook-proof consumers import plain functions from the same module.Cleaning up the experiment should be much easier.
How did you test this code?
Moved and extended the unit tests.