Skip to content

fix(ci): scope deploy-api install to the API workspace#286

Merged
github-actions[bot] merged 1 commit into
developfrom
fix/deploy-api-workflow-scope
Jun 9, 2026
Merged

fix(ci): scope deploy-api install to the API workspace#286
github-actions[bot] merged 1 commit into
developfrom
fix/deploy-api-workflow-scope

Conversation

@tomymaritano

@tomymaritano tomymaritano commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Deploy API workflow has been failing since at least 2026-03-29 (every run since). Root cause: `pnpm install` in the Test + Deploy jobs runs the postinstall scripts of EVERY workspace, including `apps/desktop`'s `electron-builder install-app-deps` step that rebuilds `better-sqlite3` against Electron headers via `node-gyp`.

That rebuild fails on the Linux + Node 22 runner due to a V8 API mismatch in better-sqlite3 12.10.0 against the current Electron headers (`no matching function for call to 'v8::External::Value()'` and similar errors).

The API worker has nothing to do with better-sqlite3 or Electron. It runs on Cloudflare Workers and only needs its own transitive deps.

Change

```diff

  •  - run: pnpm install
    
  •  - run: pnpm install --filter '@readied/api...' --ignore-scripts
    

```

Applied in both the `test` and `deploy` jobs.

  • `--filter '@readied/api...'` brings in `@readied/api` and everything it depends on (transitive workspace + npm deps), nothing else.
  • `--ignore-scripts` is belt-and-suspenders so we don't run `install-app-deps` even if some transitive dep declares a similar postinstall later.

Why this is release-blocking

The v0.15.0 release (PR #245) auto-deploys the API to production when it merges (the workflow runs on `push` to main affecting `packages/api/**`). The audit stack modifies `packages/api/wrangler.toml` (documentation comment for LICENSE_SIGNING_PRIVATE_KEY), which triggers the path filter. Without this fix, that auto-deploy fails on merge.

Verification

After this PR merges to develop and the release PR (#245) carries it to main, the next manually-triggered deploy:
```
gh workflow run deploy-api.yml -f environment=staging
```
should succeed end-to-end (Test → Deploy → wrangler deploy --env staging).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Optimized the API deployment workflow's dependency installation process to use a filtered installation limited to API workspace dependencies, reducing unnecessary build steps and improving deployment reliability.

The Deploy API workflow was running plain \`pnpm install\` which triggers
EVERY workspace's postinstall — including apps/desktop's
\`electron-builder install-app-deps\` step that rebuilds better-sqlite3
against Electron headers via node-gyp. That rebuild fails on the Linux
+ Node 22 CI runner (V8 API mismatch in better-sqlite3 12.10.0 against
current Electron headers): "no matching function for call to
'v8::External::Value()'" and friends.

The API worker has nothing to do with better-sqlite3 or Electron. It
runs on Cloudflare Workers and only needs its own transitive deps. So:

  pnpm install
->
  pnpm install --filter '@readied/api...' --ignore-scripts

- \`--filter '@readied/api...'\` brings in @readied/api and everything it
  depends on (transitive within the monorepo), nothing else.
- \`--ignore-scripts\` is belt-and-suspenders so we don't run install-app-deps
  even if some transitive dep declares a similar postinstall.

This unblocks the API deploy that was failing since 2026-03-29.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
readide Error Error Jun 9, 2026 4:10am

@github-actions github-actions Bot enabled auto-merge (squash) June 9, 2026 04:08
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR modifies the API deployment workflow to install dependencies only for the @readied/api workspace with --ignore-scripts, avoiding postinstall script failures from other workspaces in both the test and deploy jobs.

Changes

Workspace-filtered dependency installation

Layer / File(s) Summary
Filtered pnpm install in test and deploy jobs
.github/workflows/deploy-api.yml
Both test job (lines 34–39) and deploy job (line 61) dependency installation steps now run pnpm install --filter=@readied/api --ignore-scripts with inline comments explaining the avoidance of failing postinstall behavior from other workspaces on the Linux Node 22 runner.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

ci, size/S

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: scoping the deploy-api install command to only the API workspace instead of installing all workspaces.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deploy-api-workflow-scope

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot merged commit 34ebc47 into develop Jun 9, 2026
14 of 18 checks passed
tomymaritano added a commit that referenced this pull request Jun 9, 2026
## Why hotfix to main

PR #245 (audit release develop→main) merged **before** PR #286
(deploy-api install scope fix) reached develop. Net result: main got the
audit work without the workflow fix. The auto-deploy of \`@readied/api\`
on the #245 merge failed, and manual \`workflow_dispatch\` from main
still fails because the workflow file in main is the pre-fix version.

This PR cherry-picks the one-commit fix from develop (\`53577d3\`)
directly onto main. Same diff as PR #286, no new logic.

## What this changes

\`\`\`diff
- - run: pnpm install
+ - run: pnpm install --filter '@readied/api...' --ignore-scripts
\`\`\`

Applied in both the \`test\` and \`deploy\` jobs of
\`.github/workflows/deploy-api.yml\`.

Scope: prevent \`pnpm install\` from running every workspace's
postinstall on the CI runner. Specifically, blocks \`apps/desktop\`'s
\`electron-builder install-app-deps\` step that rebuilds better-sqlite3
against Electron headers — a build that fails on Linux + Node 22 due to
a V8 API mismatch in better-sqlite3 12.10.0.

## Verification (already done)

The same fix on develop was validated by run
https://github.com/tomymaritano/readide/actions/runs/27183894368 —
\`@readied/api\` deployed cleanly to \`readied-api-staging\`, smoke test
returned HTTP 200 with \`{"name":"Readied
API","version":"0.1.0","status":"healthy"}\`.

The failing main deploy was
https://github.com/tomymaritano/readide/actions/runs/27184061589.

## What lands after this merges

1. Manual re-trigger of Deploy API workflow from main → expected pass
against \`readied-api-production\`
2. Then we can trigger the Release workflow for desktop v0.15.0

## Why directly to main (not via develop again)

- develop already has this exact fix from #286
- Going through develop → main release PR would re-stack the entire
audit work that just released; only delta is one workflow line
- This is the textbook case for a hotfix branch

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant