You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ci): open the protected immutable cockpit preview with its own automation 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>
# Deployment protection answers every path on the unaliased artifact
1115
+
# with 302 -> vercel.com/sso-api, which the smoke reports as
1116
+
# "expected 308, received 302". Bypass secrets are issued per Vercel
1117
+
# project, so the Website secret cannot open this one. Say so.
1118
+
if [ -z "${VERCEL_AUTOMATION_BYPASS_SECRET}" ]; then
1119
+
echo "::error::VERCEL_COCKPIT_AUTOMATION_BYPASS_SECRET is unset — the protected immutable cockpit preview cannot be verified. Enable 'Protection Bypass for Automation' on the Vercel threadplane-cockpit project and store the value as this repository secret."
? ' Raw Path rejection failed; verify the Vercel project WAF Raw Path prerequisite before promotion.'
384
394
: '';
385
395
if(response.status!==smokeCase.expectedStatus){
396
+
constprotectionHint=
397
+
response.status===302&&
398
+
(response.headers.location??'').startsWith(
399
+
'https://vercel.com/sso-api'
400
+
)
401
+
? ` The deployment answered with Vercel deployment protection, not the redirect service; supply the owning project's automation bypass secret via ${BYPASS_SECRET_ENV}.`
402
+
: '';
386
403
thrownewRedirectContractError(
387
-
`[${mode}] ${smokeCase.name}: expected ${smokeCase.expectedStatus}, received ${response.status}.${rawGateHint}`
404
+
`[${mode}] ${smokeCase.name}: expected ${smokeCase.expectedStatus}, received ${response.status}.${rawGateHint}${protectionHint}`
0 commit comments