Skip to content

fix(ci): resolve Deploy - Frontend to Vercel and Artifacts failures (#393) - #518

Open
ValJnr-dev1 wants to merge 2 commits into
PromptMintLabs:mainfrom
ValJnr-dev1:fix/issue-393-deploy-action-versions
Open

fix(ci): resolve Deploy - Frontend to Vercel and Artifacts failures (#393)#518
ValJnr-dev1 wants to merge 2 commits into
PromptMintLabs:mainfrom
ValJnr-dev1:fix/issue-393-deploy-action-versions

Conversation

@ValJnr-dev1

Copy link
Copy Markdown

Summary

Resolves the recurring SEV-1 deploy failures. The workflow has been broken on every push to main since the bad action-version dependabot bumps landed. Issue #393 is the latest incident ticket triggered by commit efb845a.


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:

Action Was Now
actions/setup-node @v7 @v4
actions/upload-artifact @v7 @v4
actions/download-artifact @v8 @v4
Vercel deploy vercel/action@v5 ❌ (does not exist) amondnet/vercel-action@v42

Affected files: deploy.yml (all five upload steps, all five download steps, Vercel step, two setup-node calls) and auto-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 in README.md and enforced by scripts/check-local-setup.mjs. Updated to '22' in deploy-frontend and generate-sbom.

3. Wrong package manager — npm vs Yarn 4 Berry

The project uses Yarn 4 Berry (packageManager field in package.json, yarn.lock present, no package-lock.json). The workflow called npm ci and npm run build, which fail because there is no npm lockfile.

Fixed in deploy-frontend and generate-sbom:

  • Added corepack enable step
  • npm ciyarn install --immutable
  • npm run buildyarn build
  • cache: 'npm'cache: 'yarn'

4. Double res.status(200).json() in api/status.ts

The /api/status handler called res.json() twice — a second call was appended to include circuitBreakers in 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: circuitBreakers is now included in the single withVersion response.


Tests

api/status.test.ts            3/3  ✅
src/lib/ops/rollback.test.ts  16/16 ✅
Total                         19/19 ✅

Files changed

  • .github/workflows/deploy.yml
  • .github/workflows/auto-rollback.yml
  • api/status.ts

Closes #393

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
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

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.

[SEV-1] Automated rollback: Deploy - Frontend to Vercel and Artifacts failure (efb845a)

1 participant