ci: test on PR, registry sync check, retry transient verify failures - #45
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onv*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. Runsnode --test test/*.test.json every PR and every push to master, across Node 18, 20 and 22. Also parses every file inregistry/anddocs/registry/and fails with the offending filename if one is malformed.Verified against the real failure: PR #36's original
registry/workday.jsonfails the JSON gate.Registry sync job. Runs
npm run sync:registry-pagesand fails ifdocs/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.jsonwithout syncing. The check fails as intended.verify-registry.mjsretries 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.AtsErrorcarries 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): 404matches/5\d\d/and a terminal 404 gets retried as a 5xx. I hit exactly this while writing it. The check is nowerr.status >= 500against a real field.Additive and backward compatible. The two-argument constructor still works and sets no
status.Testing
wd501,wd503,wd504), all correct