Skip to content

ci: give the Website preview verification a Vercel automation bypass - #974

Merged
blove merged 3 commits into
mainfrom
blove/preview-verify-bypass
Sep 3, 2026
Merged

ci: give the Website preview verification a Vercel automation bypass#974
blove merged 3 commits into
mainfrom
blove/preview-verify-bypass

Conversation

@blove

@blove blove commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Merging this requires a new repository secret — see "Before merging" below.

Summary

The Verify Website preview runtime embedding policy step added in #963 cannot pass. Vercel deployment protection answers every preview path with 302 -> vercel.com/sso-api, so Playwright drives the browser to an SSO page and times out waiting for the app:

locator.click: Test timeout of 30000ms exceeded.
  waiting for [data-cockpit-desktop-navigation] button "Settings"

It has never succeeded — skipped on 738b2ed8 as stale, failed on its first real execution (26ec7e99).

Why this matters

The step sits mid-way through the deploy job, so its failure skips everything after it: Website promotion, the cockpit redirect build, and cockpit promotion. Production has not advanced since the control-plane arc landed. That is why cockpit.threadplane.ai still answers 200 where the smoke suite expects 308 — the Cockpit retirement shipped to main but never reached production.

Change

Send the project's automation bypass when CI supplies it. The header is added only when VERCEL_AUTOMATION_BYPASS_SECRET is set, so local runs and production runs are unchanged, and every URL this suite visits is a first-party Threadplane origin.

The step also now fails with an actionable message instead of a silent 90-second timeout when the secret is missing.

Adds two regression tests to playwright-config.spec.ts:

  • the bypass headers appear only when the secret is supplied;
  • the production-smoke spec stays free of import.meta, which is what silently broke it in feat: unify docs and runtime control plane #963 (comments stripped first, so the prose warning doesn't trip the guard).

Before merging

Create the secret, or this step will fail loudly on main:

  1. Vercel → the threadplane project → Settings → Deployment Protection → enable Protection Bypass for Automation.
  2. Copy the generated value into the GitHub repository secret VERCEL_AUTOMATION_BYPASS_SECRET.

The step only runs on push to main, so this PR's own CI will be green either way.

Verification

  • createWebsitePlaywrightConfig({}) → no extraHTTPHeaders; with the secret → both headers set. Covered by tests.
  • Mutation-probed the import.meta guard by reintroducing import.meta.url — it fails as intended.
  • ci-workflow.spec.mjs: 33/33.
  • The smoke spec still collects 104 tests.

🤖 Generated with Claude Code

The "Verify Website preview runtime embedding policy" step added in #963 cannot
pass. Vercel deployment protection answers every preview path with
302 -> vercel.com/sso-api, so Playwright drives the browser to an SSO page and
times out waiting for the app:

    locator.click: Test timeout of 30000ms exceeded.
      waiting for [data-cockpit-desktop-navigation] button "Settings"

It has never succeeded: skipped on 738b2ed as stale, failed on its first real
execution. Because the step sits mid-deploy, its failure skips Website
promotion, the cockpit redirect build and cockpit promotion — production has
not advanced since the arc landed, which is why cockpit.threadplane.ai still
answers 200 where the smoke suite expects 308.

Send the project's automation bypass when CI supplies it. The header is added
only when VERCEL_AUTOMATION_BYPASS_SECRET is set, so local and production runs
are unchanged, and every URL this suite visits is a first-party origin. The
step now fails with an actionable message rather than a silent 90s timeout when
the secret is missing.

Requires the repository secret VERCEL_AUTOMATION_BYPASS_SECRET, from
"Protection Bypass for Automation" on the Vercel website project.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 3, 2026 3:46am UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit 93db300 into main Sep 3, 2026
68 of 69 checks passed
blove added a commit that referenced this pull request Sep 3, 2026
…tomation bypass (#984)

With #983 the deploy job reached "Exhaustively verify immutable cockpit
preview" for the first time, and it failed on its first probe:

    [preview] root default redirect: expected 308, received 302.

The 302 is Vercel deployment protection sending every path on the unaliased
artifact to vercel.com/sso-api — the same wall #974 removed for the Website
preview. Bypass secrets are issued per Vercel project, so the Website secret
cannot open the cockpit deployment.

- deploy-smoke.ts sends `x-vercel-protection-bypass` on every probe when
  VERCEL_AUTOMATION_BYPASS_SECRET is set, read from the environment so the
  value never lands in argv or step logs. A 302 to the SSO endpoint now names
  deployment protection and the missing secret instead of reporting a bare
  status mismatch.
- The workflow step supplies the secret from
  VERCEL_COCKPIT_AUTOMATION_BYPASS_SECRET and fails with a provisioning
  message when it is unset.
- Unit tests cover the header on every probe (including the hostile-header
  case), its absence without a secret, and the SSO hint; the workflow guard
  asserts both preview checks carry their own project's secret.

Requires the repository secret VERCEL_COCKPIT_AUTOMATION_BYPASS_SECRET.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant