Skip to content

chore(1.4.1): ops polish — health version, cache stampede, input length guards - #22

Merged
jjesse merged 3 commits into
masterfrom
copilot/chore141-ops-polish
Aug 1, 2026
Merged

jjesse merged 3 commits into
masterfrom
copilot/chore141-ops-polish

Conversation

@jjesse

@jjesse jjesse commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

1.4.1 ops polish batch.

Changes

  • /api/health returns version from package.json
  • Cache stampede protection via pendingFetches promise coalescing
  • Input length guards (MAX_PARAM_LENGTH = 256) on lookup/trace
  • MAX_TRACE_IPS promoted to top-level constant
  • User-Agent includes app version
  • package.json 1.4.1, author, engines ≥20; .nvmrc
  • OpenAPI 1.4.1 + health schema; tests for version + length guard
  • CONTRIBUTING tree, .env.example ALLOWED_ORIGINS, CHANGELOG, TODO

After merge

Tag v1.4.1 when ready.

jjesse and others added 3 commits August 1, 2026 17:29
… guards

- /api/health returns version from package.json
- promise-coalescing pendingFetches map prevents CENR cache stampede
- MAX_PARAM_LENGTH guards on lookup/trace params; MAX_TRACE_IPS top-level
- User-Agent includes app version
- package.json 1.4.1, author, engines >=20; add .nvmrc
- docs: CONTRIBUTING distance.js, .env.example ALLOWED_ORIGINS, OpenAPI 1.4.1, CHANGELOG/TODO
Copilot AI review requested due to automatic review settings August 1, 2026 21:37
@jjesse
jjesse merged commit 089834b into master Aug 1, 2026
2 checks passed

Copilot AI 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.

Pull request overview

Ops-focused 1.4.1 polish that improves operability and robustness of the API by surfacing the running app version, reducing duplicate upstream fetches under load, and hardening request parameter handling.

Changes:

  • Adds version to /api/health (sourced from package.json) and updates OpenAPI + tests accordingly.
  • Implements cache-stampede protection for Zscaler CENR fetches via in-flight promise coalescing (pendingFetches).
  • Introduces parameter length guards (MAX_PARAM_LENGTH) and promotes MAX_TRACE_IPS to a top-level constant; bumps Node/tooling metadata to 1.4.1.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
TODO.md Marks several previously-tracked reliability/code-quality items as completed.
tests/integration/api.test.js Adds integration assertions for health version and /api/lookup max-length rejection.
server.js Adds app version wiring, fetch coalescing, length guards, and promotes constants.
package.json Bumps to 1.4.1, sets author, and raises Node engines requirement to >=20.
package-lock.json Syncs lockfile metadata with 1.4.1 and Node engines >=20.
openapi.yaml Updates API version to 1.4.1 and documents health version field.
CONTRIBUTING.md Fixes project tree listing to include utils/distance.js.
CHANGELOG.md Documents 1.4.1 release notes for the ops-polish batch.
.nvmrc Pins local Node version to 20.
.env.example Documents ALLOWED_ORIGINS for optional restricted CORS configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server.js
Comment on lines +481 to +486
if (typeof cloud === 'string' && cloud.length > MAX_PARAM_LENGTH) {
return res.status(400).json({
success: false,
error: `Parameter too long (max ${MAX_PARAM_LENGTH} characters)`
});
}
Comment thread server.js
Comment on lines +481 to +486
if (typeof cloud === 'string' && cloud.length > MAX_PARAM_LENGTH) {
return res.status(400).json({
success: false,
error: `Parameter too long (max ${MAX_PARAM_LENGTH} characters)`
});
}
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.

3 participants