Skip to content

🐛 ci: repair KB schema validation setup#19261

Merged
clubanderson merged 3 commits into
kubestellar:mainfrom
Jayant-kernel:codex/fix-kb-ajv-cli
Jun 20, 2026
Merged

🐛 ci: repair KB schema validation setup#19261
clubanderson merged 3 commits into
kubestellar:mainfrom
Jayant-kernel:codex/fix-kb-ajv-cli

Conversation

@Jayant-kernel

Copy link
Copy Markdown
Contributor

Fixes #19260

Repairs the KB nightly validation setup so the mission schema smoke test can run before gap tracking.

Changes:

  • Adds a small local Node/AJV schema validator under .github/kb-scripts.
  • Uses that helper from the mission validation scripts instead of expecting an ajv CLI on PATH.
  • Keeps the workflow install step focused on pinned helper dependencies.

Testing:

  • npm ci --ignore-scripts --prefix .github/kb-scripts
  • node .github\kb-scripts\validate-json-schema.cjs web\src\lib\missions\mission.schema.json scripts\testdata\validate-missions\valid\minimal-runtime-aligned.json
  • node .github\kb-scripts\validate-json-schema.cjs web\src\lib\missions\mission.schema.json scripts\testdata\validate-missions\invalid-missing-version\missing-version.json (expected failure)
  • npm audit --omit=dev --prefix .github/kb-scripts
  • git diff --check -- .github/kb-scripts/package.json .github/kb-scripts/package-lock.json .github/kb-scripts/validate-json-schema.cjs .github/workflows/kb-nightly-validation.yml scripts/validate-missions-schema-test.sh scripts/validate-missions.sh

Note: the full local shell smoke test reaches the mission validator but this Windows machine is missing jq; GitHub's Ubuntu runner provides it.

Signed-off-by: Jayant <212013719+Jayant-kernel@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 05:52
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jun 20, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Jun 20, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 939b1e4
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a36495fc2b33c000850da61
😎 Deploy Preview https://deploy-preview-19261.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 20, 2026
@Jayant-kernel

Copy link
Copy Markdown
Contributor Author

@clubanderson
review my pr when you are free

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Repairs the KB nightly validation pipeline by removing the dependency on an ajv CLI being present on PATH and instead using a pinned, local Node/AJV-based schema validation helper that the mission validation scripts can invoke directly.

Changes:

  • Adds a small Node-based schema validator script under .github/kb-scripts (AJV + ajv-formats).
  • Updates mission validation scripts to call the Node helper rather than ajv validate ....
  • Simplifies the GitHub Actions workflow by no longer exporting .github/kb-scripts/node_modules/.bin onto PATH.

Build/lint are expected to be validated by CI on this PR.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/validate-missions.sh Switches schema validation from ajv CLI to the new Node helper.
scripts/validate-missions-schema-test.sh Updates the schema smoke test to exercise the Node helper instead of ajv CLI.
.github/workflows/kb-nightly-validation.yml Removes the PATH modification step now that schema validation runs via node <script>.
.github/kb-scripts/validate-json-schema.cjs New AJV-based schema validator entry point used by CI and scripts.
.github/kb-scripts/package.json Pins AJV dependency versions for the helper.
.github/kb-scripts/package-lock.json Locks dependency graph updates for the helper.
Files not reviewed (1)
  • .github/kb-scripts/package-lock.json: Generated file

LOCAL_DIR=""
SCHEMA_FILE=""
AJV_FORMATS_PLUGIN="ajv-formats"
AJV_VALIDATOR=".github/kb-scripts/validate-json-schema.cjs"
Comment on lines 23 to 27
# Smoke-test that ajv can actually validate against the schema with formats
SMOKE_FILE=$(mktemp)
SMOKE_FILE=$(mktemp --suffix=.json)
trap 'rm -f "$SMOKE_FILE"' EXIT
echo '{"version":"kc-mission-v1","title":"AJV smoke test","steps":[{"title":"Step 1","description":"Smoke test"}]}' > "$SMOKE_FILE"

@clubanderson

Copy link
Copy Markdown
Collaborator

Scanner merge sweep: Unable to squash-merge this PR automatically — it modifies .github/workflows/kb-nightly-validation.yml and the current OAuth token lacks workflow scope. A maintainer with workflow permissions needs to merge this manually.

All CI checks are passing ✅ (build-gate: success).

@clubanderson

Copy link
Copy Markdown
Collaborator

⚠️ Scanner merge blocked — this PR modifies workflow files (.github/workflows/kb-nightly-validation.yml) and the current OAuth token lacks workflow scope. Needs manual merge by a maintainer with appropriate permissions.

@clubanderson

Copy link
Copy Markdown
Collaborator

⚠️ Scanner merge blocked — Cannot merge this PR via API due to GitHub OAuth scope limitation: the PR modifies .github/workflows/kb-nightly-validation.yml, which requires workflow scope that the current token lacks. This PR needs to be merged manually by a maintainer with appropriate permissions or via the GitHub web UI.

@kubestellar-prow kubestellar-prow Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 20, 2026
@clubanderson clubanderson merged commit f96745a into kubestellar:main Jun 20, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KB Validation: critical gaps detected 2026-06-20

3 participants