Skip to content

ci: wire npm run test:openapi into build-check.yml#4518

Open
bokelley wants to merge 3 commits into
mainfrom
ci/wire-openapi-freshness-gate
Open

ci: wire npm run test:openapi into build-check.yml#4518
bokelley wants to merge 3 commits into
mainfrom
ci/wire-openapi-freshness-gate

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Summary

Adds one step to the build job in .github/workflows/build-check.yml:

```yaml

  • name: OpenAPI freshness (static/openapi/registry.yaml regenerated from Zod source)
    run: npm run test:openapi
    ```

Why

package.json already 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 test script, and build-check.yml cherry-picks ~10 specific test scripts — test:openapi was never one of them. So Zod-schema PRs were landing without triggering a regen, and static/openapi/registry.yaml would drift until someone happened to run npm run build:openapi locally 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.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`.

Test plan

  • Workflow-only change; no source schemas touched
  • Confirm build-check CI on this PR passes the new step (yaml is fresh against main)

Closes #4516.

🤖 Generated with Claude Code

Brian O'Kelley and others added 3 commits May 14, 2026 04:51
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>
@bokelley bokelley force-pushed the ci/wire-openapi-freshness-gate branch from acd2054 to 8db6a98 Compare May 14, 2026 08:51
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.

CI: wire npm run test:openapi into build-check.yml

1 participant