Skip to content

Commit bfc9152

Browse files
authored
Keep the cloud e2e worker off the production PostHog project (#2394)
The e2e worker inherited the production PostHog key from wrangler.jsonc vars, so server-side flag gates evaluated live production flags for synthetic e2e users. Since google-oauth-review was widened in production, first-party-oauth fails on every run because Google is now listed. Clear the key in the e2e boot so each gate takes its no-flag-service path.
1 parent 12ffa47 commit bfc9152

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎e2e/scenarios/first-party-oauth.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,10 @@ scenario(
187187
});
188188
});
189189

190-
// The Executor-owned Google app is withheld from every listing: it is no
191-
// longer offered for new connections, so connecting Google means bringing
192-
// your own OAuth app. It stays fully resolvable by slug, which the
190+
// The Executor-owned Google app is listed only for users the
191+
// `google-oauth-review` flag admits, and withheld whenever no flag service
192+
// answers. The e2e stack configures no PostHog project (cloud.boot.ts),
193+
// so here it is withheld. It stays fully resolvable by slug, which the
193194
// `oauth.start` cases below exercise — that is the guarantee for everyone
194195
// already connected through it. Its reviewed consumer scope bundle, no
195196
// longer introspectable from here, is asserted on the config it is built

‎e2e/setup/cloud.boot.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ export const bootCloud = async (options: CloudBootOptions): Promise<CloudBooted>
128128
// scope policy, and authorization URL construction end to end.
129129
FIRST_PARTY_GOOGLE_CLIENT_ID: "e2e-first-party-google",
130130
FIRST_PARTY_GOOGLE_CLIENT_SECRET: "e2e-first-party-google-secret",
131+
// No PostHog project. wrangler.jsonc ships the production project key as a
132+
// var, and the worker evaluates server-side feature flags with it (the
133+
// Google OAuth listing, the enterprise-managed auth rollout). Inheriting it
134+
// made e2e outcomes follow whatever those flags are set to in production
135+
// and sent every synthetic e2e user to the production project. With no
136+
// key, each gate takes its documented no-flag-service path.
137+
VITE_PUBLIC_POSTHOG_KEY: "",
131138
// Shrink the per-org hourly execution cap (prod default 1000) to a number
132139
// the rate-limit-backstop scenario can actually exhaust with real
133140
// executions — but see execution-limits.ts: it must stay above every other

0 commit comments

Comments
 (0)