Skip to content

fix(void): strip resolve.external from worker env in Vite plugin - #207

Merged
cpojer merged 3 commits into
mainfrom
fix/worker-env-test-external
May 19, 2026
Merged

cpojer merged 3 commits into
mainfrom
fix/worker-env-test-external

Conversation

@TheAlexLichter

Copy link
Copy Markdown
Member

Follow-up of #188

Setting an own worker env was not enough.
When testing, Vitest prepares an SSR-like Node env. To make it Node built-ins behave correctly there, it sets resolve.external to things like fs, path, etc.
Eventually, the "invalid" resolve.external ends up on void_worker (The CF plugin doesn't allow this).

This is not an issue in dev or build because the environment is Cloudflare-oriented from the start.

@netlify

netlify Bot commented May 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for staging-void-cloud ready!

Name Link
🔨 Latest commit dad3b92
🔍 Latest deploy log https://app.netlify.com/projects/staging-void-cloud/deploys/6a0b3d6fb370d40008a8da6f
😎 Deploy Preview https://deploy-preview-207--staging-void-cloud.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@TheAlexLichter
TheAlexLichter force-pushed the fix/worker-env-test-external branch from 1262b43 to fd76077 Compare May 18, 2026 16:17
@TheAlexLichter
TheAlexLichter marked this pull request as ready for review May 18, 2026 16:19
@cpojer
cpojer merged commit 53d77a1 into main May 19, 2026
9 checks passed
@cpojer
cpojer deleted the fix/worker-env-test-external branch May 19, 2026 00:09
cpojer pushed a commit that referenced this pull request Sep 11, 2026
…#207)

* feat(api): report a "Void Build" check run for github_actions deploys

The "Void Build" GitHub Check Run was created/finalized only on the
container path (inside the BuildManager DO). github_actions builds never
called the executor-agnostic check-run helper, so Actions deploys showed
no status on the commit — despite the build row carrying a real commit
SHA (from OIDC) and an installation id.

Wire the existing helper into the github_actions lifecycle:
- create "Void Build" (in_progress) at the OIDC exchange, after the
  post-create freshness re-check (so the cancel-and-return branch can't
  strand a run in_progress), and persist check_run_id
- complete it (success/failure) in the workflow_run:completed handler,
  guarded on the terminal CAS so a redelivery can't double-PATCH

Both calls are best-effort (wrapped, never fail the exchange or break the
webhook 2xx) — the deploy is the critical path; the check is cosmetic.
details_url points at the GitHub Actions run (the Actions executor's real
details view; it has no DO log store).

Prereq: the "Void Deploy" GitHub App needs Checks: write AND must be
subscribed to the workflow_run event, or the check is created but never
completes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(api): harden github_actions "Void Build" check-run wiring

Addresses adversarial-review findings on the check-run wiring:

- OIDC check-run create+persist stays SYNCHRONOUS (never waitUntil):
  deferring it reopened a duplicate-create race (a reused build read a
  null check_run_id) and a completion-miss race (workflow_run arriving
  before persist). Awaiting closes both; the !check_run_id guard is now
  race-free for sequential retries.
- Complete the check from GitHub's workflow_run.conclusion INDEPENDENT of
  our internal build-status CAS, so a build terminalized out-of-band
  (push-supersede, OIDC latest-wins, disconnect, teardown, reaper) still
  gets its check finalized. Widen CheckRunConclusion with timed_out.
- setBuildCheckRunId is CAS `check_run_id IS NULL` (immutable once set).
- Webhook completion deferred via waitUntil (idempotent; redelivery
  re-completes; off the token-revoking DB path).
- Tests: single-POST on repeated same-run exchange, complete-on-already-
  terminal build, setBuildCheckRunId immutability. Document the bounded
  concurrent-same-run duplicate residual (pathological, cosmetic).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
cpojer pushed a commit that referenced this pull request Sep 11, 2026
…d deploy) (#210)

The `schema-compat` CI gate started failing on every prod deploy since #207,
blocking the `deploy` job with:

    delete from "projects" violates FK "builds_project_id_projects_id_fk"
    Key (id)=(proj_test74) is still referenced from table "builds"

Root cause is a test-isolation bug, not a real migration incompatibility:

- `clearTables()` never deleted `builds` (or the github tables), and
  `builds` references deployments/projects/users WITHOUT `onDelete: 'cascade'`
  (a prod project delete removes its builds explicitly, so the schema omits
  cascade by design). A leftover `builds` row therefore blocks the deletes.
- Only `schema-compat` runs against ONE shared real Postgres
  (`VOID_TEST_DATABASE_URL` set -> `fileParallelism: false`); regular
  integration uses a fresh per-file PGlite, so build-row residue never crosses
  files and the bug stays hidden. #207 appended `createBuild` tests to
  api-oidc/api-webhooks, tipping the latent bug into a hard failure.

Fix: delete `builds`, `githubConnections`, `githubInstallations` before
`deployments`/`projects`/`users` in `clearTables`, mirroring the
`clearBuildTables` helper the build-creating test files already use.

Verified against a real local Postgres (reproduces the exact `proj_test74`
FK failure pre-fix; full integration suite 942/942 green post-fix).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants