Skip to content

Add CI workflow and support Node 24#5

Open
duncaan wants to merge 6 commits into
masterfrom
feature/sc-209915/support-node-24
Open

Add CI workflow and support Node 24#5
duncaan wants to merge 6 commits into
masterfrom
feature/sc-209915/support-node-24

Conversation

@duncaan

@duncaan duncaan commented Jul 10, 2026

Copy link
Copy Markdown
Member

Sets up GitHub Actions CI so the native addon build and test suite run on every push and PR. Story: sc-209915.

What

  • New CI workflow (.github/workflows/test.yaml) — builds addon + runs tests on Node 20/22/24.

Fixes needed to make CI actually work

  • .gitignore.* was silently ignoring the entire .github/ directory, so no workflow could ever be committed. Added !.github exception. (This is why workflows were not showing up in git.)
  • Workflow — prior committed test.yaml never installed deps or built the native addon, and ran the long-dead expresso runner via make test. Now runs npm ci (npm auto-triggers node-gyp) then npm test.
  • yarn.lock → package-lock.json — committed yarn.lock was corrupt (each entry had two integrity hashes on one line, invalid yarn v1 syntax that crashed yarn install). Replaced with a clean package-lock.json; switched CI to npm.
  • Makefile — dropped expresso, defers to npm test.

Native fixes (were uncommitted in working tree)

  • Bucket-name buffer overflow: allocate length + 1 for the NUL terminator.
  • Replace fixed 30-byte sprintf buffer with std::string.
  • Add <cstdint> include.

Verification

Fresh npm ci + npm test locally → 10 passing, addon builds clean.

🤖 Generated with Claude Code

duncaan and others added 6 commits July 10, 2026 14:28
Set up GitHub Actions so the addon build and tests run on every push
and PR. Several fixes were needed to make the pipeline actually work:

- .gitignore: `.*` was silently ignoring the entire .github directory,
  so no workflow could ever be committed. Add a `!.github` exception.
- Workflow: the committed test.yaml never installed deps or built the
  native addon and ran the long-dead `expresso` runner via `make test`.
  Now runs `npm ci` (npm auto-triggers node-gyp) then `npm test` across
  Node 20/22/24.
- Replace corrupt yarn.lock (each entry had two integrity hashes on one
  line, invalid yarn v1 syntax that crashed `yarn install`) with a clean
  package-lock.json.
- Makefile: drop `expresso`, defer to `npm test`.
- src/hash_ring: fix bucket-name buffer overflow (+1 for NUL), replace
  fixed 30-byte sprintf buffer with std::string, add <cstdint> include.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Correct package name (@movable/hash_ring).
- Drop obsolete node-waf / node-gyp configure build steps; install now
  compiles via node-gyp automatically.
- Fix example: correct require path, use { HashRing }, document
  getNode/getBuckets and the precision arg.
- Tests run via `npm test` (mocha), not `node test/...` or expresso.
- Point clone URL and links at movableink.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
node-addon-api@3 fails to compile against Node 24 headers on Linux/g++
(TypedThreadSafeFunction parse errors in napi.h), breaking CI. Bump to
^8.0.0, which supports current Node. Raise engines floor to Node >=18
(node-addon-api@8 requirement).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
md5.cc computed a pointer's address via `data - (md5_byte_t *)0` to test
4-byte alignment. Subtracting a null pointer is undefined behavior
(clang -Wnull-pointer-subtraction). Use `(uintptr_t)data & 3` instead;
same check, no UB, no warning. Add <stdint.h> for uintptr_t.

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