Skip to content

fix(ci): restore production — remove doubled working-directory from Vercel deploy steps#419

Merged
ajitpratap0 merged 5 commits intomainfrom
fix/website-seo-infra
Mar 19, 2026
Merged

fix(ci): restore production — remove doubled working-directory from Vercel deploy steps#419
ajitpratap0 merged 5 commits intomainfrom
fix/website-seo-infra

Conversation

@ajitpratap0
Copy link
Owner

🚨 P0 HOTFIX — Production Playground Broken

Symptom: gosqlx.dev/playground shows "Failed to fetch WASM binary: HTTP 404"

Root cause: website.yml used working-directory: website on all three Vercel CLI steps. The Vercel project has rootDirectory=website set in the dashboard. Combined, these cause the CLI to resolve paths as website/website/package.json (doubled), which fails with ENOENT on every run.

Timeline: 3 consecutive production deploy failures since 2026-03-17. Vercel's own Git Integration was auto-deploying on each push to main but WITHOUT the WASM build step → WASM 404 for all users.

Fix: Remove working-directory: website from the Pull Vercel environment, Build with Vercel, and Deploy to Vercel steps. Running from repo root lets Vercel CLI correctly interpret rootDirectory=website as <repo_root>/website/.

Changes

Closes

Closes #398, #400, #401, #403, #404

🤖 Generated with Claude Code

Ajit Pratap Singh and others added 3 commits March 19, 2026 21:05
… 404 status

- Issue #397: not-found.tsx is already correct Next.js App Router structure
  (no changes needed — returns HTTP 404 automatically for unmatched routes)
- Issue #398: Replace relative .md file links with website doc routes in
  GETTING_STARTED.md, CLI_GUIDE.md, USAGE_GUIDE.md, LINTING_RULES.md,
  CONFIGURATION.md, API_REFERENCE.md, SQL_COMPATIBILITY.md
- Issue #403: Version WASM service worker cache key (gosqlx-wasm-v2),
  add self.clients.claim() on activate, scope cache deletion to
  gosqlx-wasm-* prefix only, guard fetch with response.ok check

Closes #397, #398, #403

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Vercel project has rootDirectory=website in the dashboard. Running
vercel CLI from website/ CWD caused doubled-path resolution:
website/website/package.json → ENOENT on every deploy since 2026-03-17.

Running from repo root lets Vercel CLI resolve rootDirectory=website
correctly (repo_root/website/), so WASM binary copied to
website/public/wasm/ in the Build WASM step is included in the artifact.

Fixes: 3 consecutive production deploy failures, WASM 404 in playground.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 19, 2026

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

Project Deployment Actions Updated (UTC)
gosqlx-website Ready Ready Preview, Comment Mar 19, 2026 5:45pm

@github-actions github-actions bot added documentation Improvements or additions to documentation ci-cd labels Mar 19, 2026
@github-actions
Copy link

github-actions bot commented Mar 19, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

…pushes

Path filter caused the workflow to skip on synchronize events where only
non-matched files changed (e.g., .yml, .md). The opened event bypasses
path filtering so it ran on first push but not on subsequent pushes.

Also adds workflow_dispatch for manual triggering and reopened type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 19, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@github-actions
Copy link

github-actions bot commented Mar 19, 2026

Claude finished @ajitpratap0's task —— View job


🔍 PR Review Complete

Todo List:

  • Read and analyze workflow file changes
  • Review the root cause and proposed fix
  • Check for security concerns in CI/CD modifications
  • Assess code quality and best practices
  • Provide comprehensive feedback

Overall Assessment: LGTM with Strong Approval

This is an excellent production hotfix that demonstrates strong understanding of Vercel CLI behavior and GitHub Actions best practices.

📋 Changes Reviewed

.github/workflows/website.yml - Excellent Fix

What was removed:

# From these 3 steps:
- name: Pull Vercel environment
- name: Build with Vercel  
- name: Deploy to Vercel

# Removed this line from each:
working-directory: website

Analysis:

  • Root Cause Correctly Identified: The issue was path doubling (website/website/package.json) due to Vercel project having rootDirectory=website in dashboard settings combined with working-directory: website in CI
  • Fix is Minimal and Targeted: Only removed the problematic lines without changing anything else
  • Preserves Existing Logic: WASM build step correctly copies to ../website/public/wasm/ from wasm/ directory

.github/workflows/claude-code-review.yml - Smart Enhancement

What was changed:

  • ✅ Removed overly restrictive path filters that caused workflow to skip on .yml/.md changes
  • ✅ Added reopened event type for complete PR lifecycle coverage
  • ✅ Added workflow_dispatch for manual triggering

🔒 Security Assessment: No Concerns

  • Secrets Handling: Properly uses ${{ secrets.* }} for all sensitive values
  • Permissions: Workflow permissions are minimal and appropriate
  • No New Attack Vectors: Changes only remove restrictions, don't add new functionality

🚀 Performance & Best Practices: Excellent

  • CI Efficiency: Removing path filters prevents unnecessary workflow skips
  • Debugging: workflow_dispatch addition enables manual testing
  • Resource Usage: No changes to timeout or concurrency settings (appropriate 20min timeout retained)

🐛 Bug Analysis: Fix Addresses Root Cause

The Problem (Timeline Reconstruction):

  1. Vercel project configured with rootDirectory=website in dashboard
  2. CI workflow used working-directory: website on Vercel CLI steps
  3. Vercel CLI resolved paths as website/website/package.jsonENOENT
  4. Build step copied WASM to website/public/wasm/ but Vercel couldn't find it due to path issues
  5. Vercel's Git Integration auto-deployed without WASM → playground 404s

The Solution:

  • Vercel CLI now runs from repo root, correctly interprets rootDirectory=website setting
  • WASM files at website/public/wasm/ are now included in deployment artifact

📝 Minor Observations

  1. Documentation Alignment: PR mentions changes to docs/*, website/public/wasm-sw.js, and other files but the visible diff only shows workflow changes. This suggests either:

    • These changes are in earlier commits (confirmed by git history)
    • The PR description covers the full scope of the branch work
  2. Go Version: Uses Go 1.26 (cutting edge) - ensure this aligns with project requirements

🎯 Test Coverage Recommendations

While I can't run the workflows, consider:

  1. Manual Workflow Test: Use workflow_dispatch to verify the Vercel deployment works
  2. WASM Verification: Check that gosqlx.dev/playground loads the WASM binary after deployment
  3. Path Resolution Test: Verify Vercel CLI can find website/package.json from repo root

Final Verdict

Strongly Approved - This is a well-analyzed production fix that:

  • Correctly identifies and resolves the path doubling issue
  • Makes minimal, targeted changes without side effects
  • Enhances CI workflow reliability with better event coverage
  • Follows security best practices
  • Demonstrates strong understanding of Vercel CLI behavior

The fix should resolve the playground WASM 404 issue and prevent similar path resolution problems in the future.


Job run

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

Labels

ci-cd documentation Improvements or additions to documentation

Projects

None yet

1 participant