ci: wire npm run test:openapi into build-check.yml#4518
Open
bokelley wants to merge 3 commits into
Open
Conversation
35117a7 to
2b22fe1
Compare
2 tasks
The OpenAPI freshness script (tsx scripts/generate-openapi.ts && git diff --exit-code static/openapi/registry.yaml) already existed in package.json and ran inside the umbrella npm run test. But build-check.yml cherry-picks specific test scripts and never invoked it, so Zod-schema PRs were landing without regenerating static/openapi/registry.yaml. Drift accumulated until someone happened to run npm run build:openapi locally (e.g. #4515 absorbed ~340 lines). After this change any PR that edits server/src/schemas/registry.ts (or any schema reachable from generate-openapi.ts) without regenerating the yaml will fail its own CI with the existing error message: "OpenAPI spec is out of date. Run: npm run build:openapi". Workflow-only — no source schemas change. Closes #4516. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…step generate-openapi.ts transitively imports auth middleware which constructs WorkOS at module load — the script never makes a network call but the constructor demands API key or client ID. Dummy values satisfy validation; CI doesn't ship real secrets and shouldn't need to for spec generation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
acd2054 to
8db6a98
Compare
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.
Summary
Adds one step to the
buildjob in.github/workflows/build-check.yml:```yaml
run: npm run test:openapi
```
Why
package.jsonalready had the freshness gate:```json
"test:openapi": "tsx scripts/generate-openapi.ts && git diff --exit-code static/openapi/registry.yaml || (echo 'OpenAPI spec is out of date. Run: npm run build:openapi' && exit 1)"
```
But it lived inside the umbrella
npm run testscript, andbuild-check.ymlcherry-picks ~10 specific test scripts —test:openapiwas never one of them. So Zod-schema PRs were landing without triggering a regen, andstatic/openapi/registry.yamlwould drift until someone happened to runnpm run build:openapilocally as part of an unrelated PR. Most recently #4515 absorbed ~340 lines of catchup.After this change any PR that touches a Zod schema reachable from
generate-openapi.tswithout regenerating the yaml will fail its own CI with the existing error message: `OpenAPI spec is out of date. Run: npm run build:openapi`.Test plan
build-checkCI on this PR passes the new step (yaml is fresh against main)Closes #4516.
🤖 Generated with Claude Code