Skip to content

fix(ci): unbreak build — separate workerd test pool, correct phantom dep version - #132

Open
chitcommit wants to merge 3 commits into
mainfrom
worktree-fix-vitest-pool-overlap
Open

fix(ci): unbreak build — separate workerd test pool, correct phantom dep version#132
chitcommit wants to merge 3 commits into
mainfrom
worktree-fix-vitest-pool-overlap

Conversation

@chitcommit

@chitcommit chitcommit commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Why

The build job has been red on every PR opened or updated since the DO coordinator merge (c979f6a, Aug 2). The cause was in none of those PRs — it is on main.

Root causes

1. vitest config overlap (the actual test blocker)

vitest.config.ts globs tests/**/*.test.ts, which also matched tests/workers/coordinator.test.ts — a workerd-pool test importing cloudflare:test. That specifier only resolves under @cloudflare/vitest-pool-workers (vitest.workers.config.mts), so the node suite died at import:

Error: Cannot find package 'cloudflare:test' imported from tests/workers/coordinator.test.ts

It failed before running a single assertion. Excluded tests/workers/** from the node suite, preserving vitest's default node_modules/dist excludes.

2. hono-agents@^0.19.0 never existed

a60d0e1 applied the agents-SDK version to the wrong package. The registry tops out at 3.0.12; the lockfile already pinned 3.0.7. Fresh npm i failed outright with ETARGET. Aligned the manifest to the locked version — resolved version is still 3.0.7, so this is a manifest-only correction with no runtime change.

3. The workers suite ran nowhere in CI

npm run test:workers was never invoked by any workflow, so the DO coordinator tests had never executed in CI. Simply excluding them from npm test would have converted "loudly broken" into "silently unrun", so they are now wired into the build job.

Booting them required @cloudflare/vitest-pool-workers 0.22 — the pinned 0.20.1 bundles a workerd supporting compatibility dates only through 2026-08-06, one day behind the 2026-08-07 date a60d0e1 set:

This Worker requires compatibility date "2026-08-07",
but the newest date supported by this server binary is "2026-08-06".

Dev-only; the lockfile change is confined to that chain (pool-workers, miniflare, wrangler, workerd). hono-agents stays at 3.0.7.

Verification

Full sequence run locally against real infrastructure — no mocks, no stubs:

Step Before After
tsc -p tsconfig.json --noEmit clean clean
npm test 1 failed / 6 passed 68 passed, 0 failed
npm run test:workers could not boot (0 tests) 24 passed

This PR will still show build red — deliberately

build runs Dependency Audit before Typecheck/Test, so it fails at 22s and never reaches the fix above. That audit failure is independent of this PR and pre-existing on main.

Worth flagging clearly: npm audit is a moving gate. #128 passed it on Aug 14, but advisories published since (hono <=4.12.33, plus fast-uri, ip-address, js-yaml, nanoid, @hono/node-server, body-parser) now fail it on any branch — I verified this by merging #128 into this branch locally and re-running the gate; it still failed. #128 as it stands will not turn the queue green.

Clearing it requires bumping hono past 4.12.33 — a web-framework upgrade with real runtime risk that does not belong bundled inside a CI fix. Left as separate work, deliberately.

Suggested review path: confirm the test-infra reasoning here on its own merits; land the hono/advisory bump separately, after which this PR's build should go fully green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SpK3ddoHzUqgW3keYafHsD

Summary by CodeRabbit

  • Tests

    • Added automated worker test execution to the continuous integration checks.
    • Improved test discovery exclusions to avoid running Cypress, tooling, configuration, and build artifacts as tests.
  • Chores

    • Updated framework and testing dependencies for improved compatibility and support.

…dep version

The `build` job has been red on every PR opened or updated since the DO
coordinator merge (c979f6a, Aug 2). The cause was not in any of those PRs.

1. vitest config overlap. vitest.config.ts globs `tests/**/*.test.ts`, which
   also matched tests/workers/coordinator.test.ts — a workerd-pool test that
   imports `cloudflare:test`. That specifier only resolves under
   @cloudflare/vitest-pool-workers (vitest.workers.config.mts), so the node
   suite died at import with ERR_MODULE_NOT_FOUND before running an assertion.
   Excluded tests/workers/** from the node suite, preserving vitest's default
   node_modules/dist excludes.

2. hono-agents "^0.19.0" never existed. a60d0e1 applied the agents-SDK version
   to the wrong package; the registry tops out at 3.0.12 and the lockfile
   already pins 3.0.7. Fresh `npm i` failed outright. Aligned the manifest to
   the locked version — the resolved version is still 3.0.7, so this is a
   manifest-only correction with no runtime change.

3. The workers suite ran nowhere in CI. `npm run test:workers` was never
   invoked by any workflow, so the DO coordinator tests had never executed.
   Excluding them from `npm test` would have converted "loudly broken" into
   "silently unrun", so they are now wired into the build job. Booting them
   required @cloudflare/vitest-pool-workers 0.22: the pinned 0.20.1 bundles a
   workerd supporting compatibility dates only through 2026-08-06, one day
   behind the 2026-08-07 date a60d0e1 set. Dev-only; the lockfile change is
   confined to that chain (pool-workers, miniflare, wrangler, workerd).

Verified locally, full build sequence: tsc --noEmit clean; npm test 68 passed;
npm run test:workers 24 passed (previously 0 — the suite could not boot).

Not addressed here: the production advisories (hono, js-yaml, fast-uri,
ip-address, nanoid) that fail the Dependency Audit gate are pre-existing on
main and are what PR #128 already fixes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SpK3ddoHzUqgW3keYafHsD
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown
  1. @coderabbitai review
  2. @copilot review
  3. @codex review
  4. @claude review
    Adversarial review request: evaluate security, policy bypass paths, regression risk, and merge-gating bypass attempts.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5793d25f-404e-4199-9ec8-b2224c8cb6e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cb211fca-75a8-4577-8d11-54e16d25885f

📥 Commits

Reviewing files that changed from the base of the PR and between e94ce22 and 9c5d8ca.

📒 Files selected for processing (1)
  • vitest.config.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR updates worker testing dependencies, excludes worker tests from the Node Vitest suite, and adds a dedicated CI step to run them.

Changes

Worker test isolation

Layer / File(s) Summary
Update worker testing dependencies
package.json
Updates hono-agents and @cloudflare/vitest-pool-workers versions.
Separate worker test execution
vitest.config.ts, .github/workflows/ci.yml
Preserves Vitest defaults, excludes tests/workers/** from the Node suite, and runs worker tests through npm run test:workers in CI.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 9c5d8

This PR makes localized CI and test-infrastructure changes and corrects a development dependency version; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

🚥 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 clearly summarizes the main CI, worker test pool, and dependency version fixes.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-fix-vitest-pool-overlap

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.

Finding from separated adversarial review (claude-sonnet-4-5 via chittyclaw,
reviewer != implementer): setting `exclude` replaces vitest's built-in default
list wholesale instead of appending to it. The previous commit kept only
node_modules and dist, silently dropping the cypress, dot-directory, and
*.config.* patterns.

Verified inert today — nothing under tests/ matches any dropped pattern, and
`include` is scoped to tests/** so root config files were never candidates. It
is restated anyway so a future file under e.g. tests/.cache/ cannot quietly
re-enter the node suite.

Also verified from the same review, empirically rather than by assertion:
- `npm run test:workers` exits 1 on a broken config, so the new CI step is a
  real gate and not decorative. Checked by temporarily breaking the workers
  config and reading the exit code.
- `npm ls @cloudflare/workers-types` reports no unmet peer dependency. wrangler
  4.124 (pulled by pool-workers 0.22) resolves its own nested workers-types v5
  while the project continues to resolve v4; tsc --noEmit passes against v4.

Re-verified after this change: tsc clean, npm test 68 passed, test:workers 24
passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SpK3ddoHzUqgW3keYafHsD
@github-actions

Copy link
Copy Markdown
  1. @coderabbitai review
  2. @copilot review
  3. @codex review
  4. @claude review
    Adversarial review request: evaluate security, policy bypass paths, regression risk, and merge-gating bypass attempts.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] I will perform an adversarial review of #132. I will focus on security impact, policy-bypass paths, regression risk, and CI merge-gating bypass attempts. I only have the latest discussion comment as context.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

`npm audit --audit-level=high --omit=dev` is the first step of the CI build job,
so it gates every other check. It currently fails on `main` for reasons no PR
introduced: npm audit is a moving gate, and advisories published after a branch
last ran will fail it retroactively.

hono 4.12.23 -> 4.13.3 is entirely inside the already-declared "^4.12.23", so
this is a lockfile-only change with no manifest edit and no range widening. It
clears 12 hono advisories, including CORS middleware reflecting any Origin with
credentials when origin defaults to wildcard, hono/jsx cross-request context
leakage, memo() retaining SSR output across requests, and ReDoS in the CORS and
language middlewares.

Production advisory count drops 7 -> 5. Validated after the bump: tsc --noEmit
clean, npm test 68 passed, npm run test:workers 24 passed.

The gate is still red on the remaining 4 (fast-uri, ip-address, js-yaml,
nanoid). Those are transitive under agents/partyserver and each needs a forced
MAJOR override (js-yaml 4->5, nanoid 5->6, fast-uri 3->4) pushed into packages
that expect the older major. That is a distinct change with real silent-breakage
risk and belongs in its own reviewed PR, not bundled into a CI fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SpK3ddoHzUqgW3keYafHsD
@github-actions

Copy link
Copy Markdown
  1. @coderabbitai review
  2. @copilot review
  3. @codex review
  4. @claude review
    Adversarial review request: evaluate security, policy bypass paths, regression risk, and merge-gating bypass attempts.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] I will review #132 for security impact, policy-bypass paths, regression risk, and merge-gating bypass attempts.

⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
chittycommand 13f61ca Aug 18 2026, 11:21 PM

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.

1 participant