Skip to content

ci: test on PR, registry sync check, retry transient verify failures - #45

Merged
prPMDev merged 1 commit into
masterfrom
ci/test-and-gate
Sep 5, 2026
Merged

ci: test on PR, registry sync check, retry transient verify failures#45
prPMDev merged 1 commit into
masterfrom
ci/test-and-gate

Conversation

@prPMDev

@prPMDev prPMDev commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Why

PR #36 was open for seven weeks with a test suite that fails against it: 137 pass, 5 fail, because the registry JSON it added does not parse. Nothing ever ran it. The only workflow in the repo was publish.yml, which fires on v* tags.

So this is not a gap in test coverage. The tests were adequate and would have caught it on day one. They were simply never run on a pull request.

What changed

test.yml, new. Runs node --test test/*.test.js on every PR and every push to master, across Node 18, 20 and 22. Also parses every file in registry/ and docs/registry/ and fails with the offending filename if one is malformed.

Verified against the real failure: PR #36's original registry/workday.json fails the JSON gate.

Registry sync job. Runs npm run sync:registry-pages and fails if docs/registry/ changes, meaning the committed Pages copy was stale. Nothing caught this before, and the failure is silent: the site serves old data while the test suite stays green, since it is decoupled from live registry contents by design.

Verified by changing registry/lever.json without syncing. The check fails as intended.

verify-registry.mjs retries transient failures. A 118-entry run today produced 32 failures that were purely rate limiting, a 27% false drop rate. Since entries that fail the gate are silently dropped, this quietly discards good companies. Now retries 429, 5xx and network errors up to 3 times with exponential backoff and jitter. Tunable via --retries.

AtsError carries the upstream HTTP status. The retry decision has to distinguish a retryable 503 from a terminal 404, and doing that by matching the message text is unsafe: Workday error messages embed the pod name next to the status, so (ufp/wd503/Careers): 404 matches /5\d\d/ and a terminal 404 gets retried as a 5xx. I hit exactly this while writing it. The check is now err.status >= 500 against a real field.

Additive and backward compatible. The two-argument constructor still works and sets no status.

Testing

  • 142 tests pass locally
  • Transient classifier checked against 8 cases including the three pod-name false positives (wd501, wd503, wd504), all correct
  • Both CI gates confirmed to fail on real broken input, not just to pass on good input

PR #36 sat open seven weeks with a suite that fails on it (137/142).
Nothing ran it: the only workflow was publish-on-tag.

- test.yml runs the suite on PRs and master pushes, Node 18/20/22,
  plus a JSON parse gate over registry/ and docs/registry/
- separate job asserts docs/registry matches registry/, so the Pages
  copy cannot ship stale
- verify-registry.mjs retries 429/5xx/network failures with backoff;
  a 118-entry run had 32 false drops purely from rate limiting
- AtsError carries the upstream status so the retry decision is
  structural, not a message regex (Workday messages embed the pod
  name, so /5\d\d/ reads "wd503: 404" as a retryable 5xx)
@prPMDev
prPMDev merged commit 600827a into master Sep 5, 2026
4 checks passed
@prPMDev
prPMDev deleted the ci/test-and-gate branch September 5, 2026 20:50
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