Skip to content

ci(e2e): gate staging e2e on critical staging-instance config drift#8757

Open
jacekradko wants to merge 1 commit into
jacek/staging-e2e-resilience-p0from
jacek/staging-e2e-validate-gate
Open

ci(e2e): gate staging e2e on critical staging-instance config drift#8757
jacekradko wants to merge 1 commit into
jacek/staging-e2e-resilience-p0from
jacek/staging-e2e-validate-gate

Conversation

@jacekradko
Copy link
Copy Markdown
Member

Follow-up to #8756. The validate-staging-instances script already compares prod vs staging /v1/environment and prints a diff, but it always exited 0, so a drifted staging mirror (like the missing WhatsApp channel that makes whatsapp-phone-code time out) blocked nothing and stayed invisible until tests failed 200-deep.

This gives the script teeth without flipping any behavior yet. It gains a tight CRITICAL_PATHS allowlist (attribute enabled toggles, phone_number.channels, auth factors, social enable/disable, password policy) plus an ACCEPTED_DRIFT escape hatch, so a known and tracked gap doesn't block while new drift does. In strict mode it exits non-zero on a blocking mismatch; fetch failures and cosmetic drift never fail the build.

Strictness is driven by the STAGING_VALIDATE_STRICT repo variable and defaults to report-only, and integration-tests now depends on validate-instances. So nothing changes until someone sets the variable: today it just logs the blocking drift and the gate it would apply. The piece worth a look is the CRITICAL_PATHS set, that is the policy of what is worth blocking a run over.

Before enabling strict, run the validator against current staging to confirm the only blocking drift is expected, and add ACCEPTED_DRIFT entries for anything intentionally tolerated. Stacked on #8756.

validate-staging-instances.mjs already diffs prod vs staging /v1/environment
but every exit path returned 0, so detected drift blocked nothing and the
job was not a dependency of the test matrix. A drifted staging mirror (e.g. a
missing phone_number WhatsApp channel) therefore surfaced only as opaque test
timeouts 200 tests deep.

Add a tight CRITICAL_PATHS allowlist (attribute enabled toggles,
phone_number.channels, auth factors/strategies, social enable/disable,
password settings) and an ACCEPTED_DRIFT escape hatch so known gaps don't
block while new drift does. In strict mode the script exits non-zero on a
blocking mismatch; fetch failures and cosmetic drift never fail the build.

Wire integration-tests to need validate-instances, and drive strictness from
the STAGING_VALIDATE_STRICT repo variable (default report-only). So this is a
no-op until the team opts in: it logs blocking drift and the proposed gate
without failing anything. Flip the variable to make it enforce.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 5, 2026

🦋 Changeset detected

Latest commit: 07c335c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 8d9787cb-6939-4e82-b29b-0acb5582fe1d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jun 5, 2026 3:01am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant