Skip to content

chore: verify the node floor in CI - #174

Merged
electrohyun merged 5 commits into
mainfrom
chore/node-floor
Aug 7, 2026
Merged

electrohyun merged 5 commits into
mainfrom
chore/node-floor

Conversation

@electrohyun

Copy link
Copy Markdown
Owner

Summary

Adds the two-tier check that lets smocket declare a Node floor it actually runs.

vitest.dist.config.ts runs the mock target against dist/ instead of src/, so the suite exercises what a consumer installs. scripts/smoke.mjs covers the part that suite cannot reach: vitest 4 pulls in rolldown, rolldown calls util.styleText, and Node 20 grew that mid-line, so the runner does not start below 20.13.0. The smoke imports node:assert and dist/ and nothing else, and drives a join, a room broadcast, and the sender's exclusion from it, so a floor that loads but delivers nothing fails.

The CI job installs and builds on 22, then switches Node twice and reuses that node_modules. Verified locally on Windows across 20.0.0, 20.12.0, 20.13.0, 20.14.0, 20.15.1, 20.16.0, 20.17.0, 20.18.0, and 20.19.4. This PR is draft until the ubuntu runner confirms the same, since pnpm's node_modules is a symlink tree on Linux and a junction tree on Windows.

engines.node is deliberately not in these commits. It lands once the job is green, so a red run costs a CI change rather than a published contract.

Related issue

Closes #143

Checklist

  • Tests added or updated
  • Behavior verified against real socket.io

The dist suite is the existing dual-run tests against the built package, so the real target is unchanged at 174.

The mock target ran against `src/`, so nothing exercised what a consumer
installs. `vitest.dist.config.ts` points the two specifiers the tests reach the
library through at `dist/index.js`, leaving every test file and source file
untouched.

The run is 148 tests where `pnpm test:mock` is 174. The config comment breaks
the gap down, since the two halves of it have different causes and 148 is not
"the whole suite against dist".
The suite above cannot reach the lowest Node the package claims. vitest 4 pulls
in rolldown, rolldown calls `util.styleText`, and Node 20 grew that mid-line, so
the runner does not start below 20.13.0.

`scripts/smoke.mjs` covers what the runner cannot. It imports `node:assert` and
`dist/` and nothing else, so whatever Node can run the package can run it.

It drives a join, a room broadcast, and the sender's exclusion from it rather
than only importing the module, so a floor that loads but delivers nothing fails
here. Non-receipt is proven with the marker pattern from `src/test-events.ts`,
never with a timeout.
Install and build run on 22, since pnpm 11 needs 22.13 and cannot move down.
The two steps that follow switch Node and reuse that `node_modules`, so no
reinstall and no artifact hand-off is needed.

The smoke runs on 20.0.0 and the dist suite on 20.13.0. Those are different
numbers on purpose: the second is the lowest Node vitest itself starts on, which
is a fact about our runner rather than about smocket, and keeping it out of the
declared range is the point of splitting the check in two.
@electrohyun electrohyun self-assigned this Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@electrohyun, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 673bc190-d16c-4f21-b7cb-348f34e269d5

📥 Commits

Reviewing files that changed from the base of the PR and between 364789d and 0bea9c2.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
📝 Walkthrough

Walkthrough

The package now declares Node.js 20 or newer as its runtime floor. It adds a built-package smoke test, distribution test configuration, and CI coverage for Node 20 and Node 22.

Changes

Node support validation

Layer / File(s) Summary
Runtime contract and smoke validation
package.json, scripts/smoke.mjs
package.json requires Node.js >=20 and adds test:dist and smoke scripts. The smoke test starts the built package, connects two clients, and checks broadcast delivery and sender exclusion.
Distribution test configuration and CI wiring
vitest.dist.config.ts, .github/workflows/ci.yml
Vitest runs mock tests against dist/index.js with source-only exclusions. The node-floor job builds on Node 22, runs the smoke test on Node 20.0.0, and runs distribution tests on Node 20.13.0.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes determine and declare a Node.js floor of >=20 and verify the built package across lower Node.js versions for issue #143.
Out of Scope Changes check ✅ Passed The CI, smoke test, dist test configuration, and Node.js engine declaration all support issue #143.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly identifies the main change: verifying the supported Node.js floor in CI.
Description check ✅ Passed The description directly explains the CI checks, built-package tests, smoke test, and Node.js floor objective.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

@github-actions github-actions Bot added the chore Tooling, CI, and dependencies label Aug 7, 2026
The package declared nothing, so the floor was whatever a consumer happened to
have. `>=20` is now the claim, and the job added ahead of it is what makes the
claim checkable rather than stated: the smoke runs the built package on 20.0.0
itself, so the exact version named here is exercised.

#104 planned to copy socket.io's `>=10.2.0`, on the reasoning that the mock
should not claim a narrower range than the oracle. That reasoning is dropped.
socket.io keeps a low floor for its own users, who run it on servers they cannot
upgrade; smocket is a devDependency and shares neither the users nor the reason.
The oracle governs delivery behavior, not install conditions.

Lowering a floor later is not a breaking change, so `>=20` costs nothing if it
turns out to be conservative. Raising one is, which is why this lands before
v1.0.0 rather than after.

Closes #143
@electrohyun
electrohyun marked this pull request as ready for review August 7, 2026 07:10
@electrohyun electrohyun changed the title chore: verify the node floor in CI ㄹㄷㅁㅅ: verify the node floor in CI Aug 7, 2026
@electrohyun electrohyun changed the title ㄹㄷㅁㅅ: verify the node floor in CI feat: verify the node floor in CI Aug 7, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed chore Tooling, CI, and dependencies labels Aug 7, 2026
@electrohyun electrohyun changed the title feat: verify the node floor in CI chore: verify the node floor in CI Aug 7, 2026
@github-actions github-actions Bot added chore Tooling, CI, and dependencies and removed enhancement New feature or request labels Aug 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 69-109: Update the node-floor job by adding a job-level
permissions block granting only contents: read, and configure its
actions/checkout step with persist-credentials: false. Keep the existing
checkout, installation, build, and Node-version steps unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a6465692-33a5-4085-a92a-33ac65cfed45

📥 Commits

Reviewing files that changed from the base of the PR and between e9a26b3 and 364789d.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • package.json
  • scripts/smoke.mjs
  • vitest.dist.config.ts

Comment thread .github/workflows/ci.yml Resolved
Neither was set on any job. The workflow only ever reads the repository, so
`permissions: contents: read` sits at the top and covers all seven rather than
being repeated per job. The repository default is already `read`, which makes it
a guard against that setting widening later rather than a change in what runs
today.

`persist-credentials: false` is the one with an effect now. Checkout leaves the
token in `.git/config`, and `pnpm install` runs dependency scripts that could
reach it. All seven checkouts are covered, since hardening one job would leave
the other six as they were.
@electrohyun
electrohyun merged commit df8e733 into main Aug 7, 2026
10 checks passed
@electrohyun
electrohyun deleted the chore/node-floor branch August 7, 2026 07:17
@electrohyun electrohyun added the 📏 m Pull request changes 50–199 lines label Aug 11, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in smocket Aug 27, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in smocket Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Tooling, CI, and dependencies 📏 m Pull request changes 50–199 lines

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

chore: decide and declare the supported Node range

1 participant