ci: check that docs/cli/schema.json is up to date on every PR#458
Open
Mpdreamz wants to merge 3 commits into
Open
ci: check that docs/cli/schema.json is up to date on every PR#458Mpdreamz wants to merge 3 commits into
Mpdreamz wants to merge 3 commits into
Conversation
Adds a lightweight ubuntu-only job that regenerates the CLI schema and fails if the result differs from what is committed. Catches cases where source changes (new commands, added options, removed subcommands) are merged without re-running 'npm run build:schema'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Schema was last generated before several commands were added/modified. Regenerated with 'npm run build:schema' to bring it current so the new CLI schema check passes on this PR and future PRs start from a clean baseline. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
🔍 Preview links for changed docs⏳ Building and deploying preview... View progress This comment will be updated with preview links when the build is complete. |
npm run build:schema imports from @elastic/es-schemas which is a local workspace package; tsc -b must run first to compile it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 a CI job that regenerates
docs/cli/schema.jsonand fails if the result differs from what is committed. This catches cases where source changes (new commands, added options, removed subcommands) are merged without runningnpm run build:schema.The check was missing — noticed when the schema drifted on #457 and had to be regenerated manually.
cc @lcawl @georgewallace @shainaraskas
How it works
ubuntu-latestonly (no need for cross-platform, the output is deterministic)npm run build:schemare-executesnode --import tsx/esm src/cli.ts cli-schema > docs/cli/schema.jsongit diff --exit-code docs/cli/schema.jsonfails the job if the file changed, with a clear message pointing to the fixThe job is wired into the
CI Resultaggregate so it blocks merges.Test plan
🤖 Generated with Claude Code