🐛 ci: repair KB schema validation setup#19261
Conversation
Signed-off-by: Jayant <212013719+Jayant-kernel@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@clubanderson |
There was a problem hiding this comment.
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/.binonto 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" |
| # 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" | ||
|
|
|
Scanner merge sweep: Unable to squash-merge this PR automatically — it modifies All CI checks are passing ✅ ( |
|
|
|
|
Fixes #19260
Repairs the KB nightly validation setup so the mission schema smoke test can run before gap tracking.
Changes:
.github/kb-scripts.ajvCLI on PATH.Testing:
npm ci --ignore-scripts --prefix .github/kb-scriptsnode .github\kb-scripts\validate-json-schema.cjs web\src\lib\missions\mission.schema.json scripts\testdata\validate-missions\valid\minimal-runtime-aligned.jsonnode .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-scriptsgit 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.shNote: the full local shell smoke test reaches the mission validator but this Windows machine is missing
jq; GitHub's Ubuntu runner provides it.