fix(ci): resolve Deploy - Frontend to Vercel and Artifacts failures (#393) - #518
Open
ValJnr-dev1 wants to merge 2 commits into
Open
fix(ci): resolve Deploy - Frontend to Vercel and Artifacts failures (#393)#518ValJnr-dev1 wants to merge 2 commits into
ValJnr-dev1 wants to merge 2 commits into
Conversation
Identical root causes as the SEV-1 incident at efb845a (and PromptMintLabs#387 before it). The deploy workflow has been broken on every push to main since the bad action-version bumps landed. This commit fixes all three root causes: Action version mismatches (non-existent versions → correct latest): - actions/setup-node@v7 → @v4 (deploy.yml ×2, auto-rollback.yml) - actions/upload-artifact@v7 → @v4 (deploy.yml ×5) - actions/download-artifact@v8 → @v4 (deploy.yml ×5) - vercel/action@v5 (does not exist) → amondnet/vercel-action@v42 Wrong Node.js version: - node-version '18.x' → '22' to match project requirements (README, check-local-setup.mjs) Wrong package manager (npm vs Yarn 4 Berry): - Project has yarn.lock and packageManager field; no package-lock.json. npm ci / npm run build fail because there is no npm lockfile. - Fixed: corepack enable, yarn install --immutable, yarn build, cache: yarn (deploy-frontend and generate-sbom jobs) Double res.status(200).json() in api/status.ts: - The handler called res.json() twice; the second call crashes the serverless function with 'Cannot set headers after they are sent'. - Fix: merge circuitBreakers into the single versioned response object. Tests: api/status.test.ts 3/3 ✅ src/lib/ops/rollback.test.ts 16/16 ✅ Closes PromptMintLabs#393
|
@ValJnr-dev1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves the recurring SEV-1 deploy failures. The workflow has been broken on every push to
mainsince the bad action-version dependabot bumps landed. Issue #393 is the latest incident ticket triggered by commitefb845a.Root causes & fixes
1. Non-existent GitHub Actions action versions
Every job in the workflow referenced versions that do not exist in the Marketplace, causing the run to fail before any step executes:
actions/setup-node@v7❌@v4✅actions/upload-artifact@v7❌@v4✅actions/download-artifact@v8❌@v4✅vercel/action@v5❌ (does not exist)amondnet/vercel-action@v42✅Affected files:
deploy.yml(all five upload steps, all five download steps, Vercel step, twosetup-nodecalls) andauto-rollback.yml(setup-node).2. Wrong Node.js version
node-version: '18.x'was set in two jobs. The project requires Node 22+ as documented inREADME.mdand enforced byscripts/check-local-setup.mjs. Updated to'22'indeploy-frontendandgenerate-sbom.3. Wrong package manager — npm vs Yarn 4 Berry
The project uses Yarn 4 Berry (
packageManagerfield inpackage.json,yarn.lockpresent, nopackage-lock.json). The workflow callednpm ciandnpm run build, which fail because there is no npm lockfile.Fixed in
deploy-frontendandgenerate-sbom:corepack enablestepnpm ci→yarn install --immutablenpm run build→yarn buildcache: 'npm'→cache: 'yarn'4. Double
res.status(200).json()inapi/status.tsThe
/api/statushandler calledres.json()twice — a second call was appended to includecircuitBreakersin the response but was never merged into the first. In any environment that enforces the Node.js HTTP contract (including Vercel serverless), the second call throws "Cannot set headers after they are sent to the client", crashing the function and causing health checks to fail.Fix:
circuitBreakersis now included in the singlewithVersionresponse.Tests
Files changed
.github/workflows/deploy.yml.github/workflows/auto-rollback.ymlapi/status.tsCloses #393