Skip to content

feat(feature-flags): add the feature-flags test apps - #4136

Merged
johncwaters merged 3 commits into
mainfrom
johnw/feature-flags-e2e
Sep 23, 2026
Merged

johncwaters merged 3 commits into
mainfrom
johnw/feature-flags-e2e

Conversation

@johncwaters

@johncwaters johncwaters commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Feedback wanted: ready to merge. Approve or request changes. Hold the merge until PostHog/wizard#1322 ships (see "Before merge").

  • Should the feature-flags e2e assert its own outcome (flags created inactive at 0%, one evaluation per side, a constants module) instead of the generic checks?
  • The two apps are copies of the basic-integration Next.js and Django apps, as other commands do. Keep the copies, or run feature-flags e2e against the basic-integration apps directly?

The wizard's new feature-flags command needs e2e coverage in wizard-workbench.

Companion PRs: context-mill (PostHog/context-mill#405) and wizard (PostHog/wizard#1322).

Changes

  • feature-flags manifest entry with two apps: Next.js App Router SaaS and Django 3 SaaS, both without PostHog installed. Marked e2eOnly, so CI grades them only through --e2e assertions and never through the diff evaluator, which has no feature-flags rubric.
  • No service changes. Gateway token minting stays local-only, because CI supplies a pre-issued token.

Before merge: PostHog/wizard#1322 must ship and the backend must register feature-flags in WIZARD_GATEWAY_PROGRAM_IDS. The weekly scheduled sweep runs every e2e app against wizard main, so merging earlier would add failing legs.

Test plan

  • pnpm wizard-ci feature-flags/next-js/15-app-router-saas --e2e and pnpm wizard-ci feature-flags/django/django3-saas --e2e pass against a test project, starting with no example flags in the project, using a gateway token minted locally. Next.js creates both example flags; Django creates only the backend flag, because its templates contain no scripts.

LLM context

Written with Claude Code.

Adds the feature-flags command to the manifest with Next.js and Django apps, and ensureGatewayToken, which mints and caches a phe_ gateway token so --e2e runs can reach the gateway.
--e2e keeps reading the already-issued gateway token from WIZARD_CI_GATEWAY_TOKEN_FILE, as CI supplies it.
@johncwaters johncwaters changed the title feat(wizard-ci): add feature-flags e2e apps and gateway token minting feat(feature-flags): add the feature-flags test apps Sep 23, 2026
The diff evaluator has no feature-flags rubric, and the weekly sweep
would run these apps through it.
@gewenyu99

Copy link
Copy Markdown
Contributor

Should the feature-flags e2e assert its own outcome (flags created inactive at 0%, one evaluation per side, a constants module) instead of the generic checks?

If you wanna build it go for it!

The two apps are copies of the basic-integration Next.js and Django apps, as other commands do. Keep the copies, or run feature-flags e2e against the basic-integration apps directly?

Totally valid to reuse

@johncwaters
johncwaters marked this pull request as ready for review September 23, 2026 21:28
@johncwaters
johncwaters requested a review from a team as a code owner September 23, 2026 21:28
@johncwaters
johncwaters merged commit eb593b7 into main Sep 23, 2026
11 checks passed
@johncwaters
johncwaters deleted the johnw/feature-flags-e2e branch September 23, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants