Introduce ability to bypass experiments. More information on Confluence docs and in .md file#699
Introduce ability to bypass experiments. More information on Confluence docs and in .md file#699wRLSS wants to merge 1 commit into
Conversation
Coverage ReportIlc/serverCommit SHA:cf1ef019debf93ac17ea2a846a47989754f294cb Test coverage results 🧪File details
Ilc/clientCommit SHA:cf1ef019debf93ac17ea2a846a47989754f294cb Test coverage results 🧪File details
RegistryCommit SHA:cf1ef019debf93ac17ea2a846a47989754f294cb Test coverage results 🧪File details
|
| // so neither server-router nor ClientRouter merges an empty `experiments` into every | ||
| // app's appProps, and nothing extra is inlined into the page. | ||
| if (!experimentsEnabled()) { | ||
| return; |
There was a problem hiding this comment.
Shouldn't we expire stale cookies when experiments are disabled? eg. users who already have x-ab-* cookies keep readable variant cookies for up to 90 days. Clients can continue seeing/applying a variant even while the kill-switch is expected to put everyone in control.
| protocol: 'ILC_CLIENT_PROTOCOL', | ||
| }, | ||
| experiments: { | ||
| enabled: 'EXPERIMENTS_ENABLED', |
There was a problem hiding this comment.
prefix with ILC_? Not sure, but it looks like half of the variables follow this convention.
| const { experiments } = this.#ilcState; | ||
| const experimentsProps = experiments ? { appProps: { experiments } } : {}; | ||
|
|
||
| return deepmerge.all([appConfigProps, routeProps, experimentsProps]); |
There was a problem hiding this comment.
a bit expensive operation. I do not see alternative now but it could be a bottleneck potentially
| * | ||
| * @param options.secure emit cookies with `Secure` (set when the site is https). | ||
| */ | ||
| export function assignExperiments( |
There was a problem hiding this comment.
Do you use function by purpose ? I could be complex to scale functions maybe it make sense to create responsible class ?
| import { createHash } from 'node:crypto'; | ||
| import type { ExperimentId, ExperimentVariant, VariantName } from './interfaces'; | ||
|
|
||
| const BUCKET_COUNT = 100; |
There was a problem hiding this comment.
Does it make sense to put it into configuration ?
| // ILC mints its own session id (gateway-agnostic, ILC-public like `ilc-i18n`), so the | ||
| // feature works in OSS ILC without depending on any deployment's identity headers. | ||
| /** Stable per-visitor session id minted by ILC; seeds deterministic bucketing. */ | ||
| export const SESSION_COOKIE = 'ilc-sid'; |
There was a problem hiding this comment.
Who is responsible for establish the cookie ?
No description provided.