Skip to content

ci: check that docs/cli/schema.json is up to date on every PR#458

Open
Mpdreamz wants to merge 3 commits into
elastic:mainfrom
Mpdreamz:fix/schema-ci-check
Open

ci: check that docs/cli/schema.json is up to date on every PR#458
Mpdreamz wants to merge 3 commits into
elastic:mainfrom
Mpdreamz:fix/schema-ci-check

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Adds a CI job that regenerates docs/cli/schema.json and fails if the result differs from what is committed. This catches cases where source changes (new commands, added options, removed subcommands) are merged without running npm 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

  • Runs on ubuntu-latest only (no need for cross-platform, the output is deterministic)
  • npm run build:schema re-executes node --import tsx/esm src/cli.ts cli-schema > docs/cli/schema.json
  • git diff --exit-code docs/cli/schema.json fails the job if the file changed, with a clear message pointing to the fix

The job is wired into the CI Result aggregate so it blocks merges.

Test plan

  • Merge this, then open a PR that changes a command without updating the schema — confirm the check fails with a clear message
  • Open a PR that includes the schema update — confirm the check passes

🤖 Generated with Claude Code

Mpdreamz and others added 2 commits June 23, 2026 21:47
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>
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
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>
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