ci: validate plugins.json against schema + sort/dedup gate (P-CI1)#2
Merged
Conversation
Add .github/workflows/validate-catalog.yml (push + pull_request): - schema job: ajv-cli@5 + ajv-formats@2 (--spec=draft2020, -c ajv-formats) validates plugins.json against plugins.schema.json. ajv-formats is required because the schema uses `format: uri`; no setup-node `cache: npm` (no lockfile). - jq step: asserts valid JSON + entries sorted by `name` + no duplicate `name`. - pin-drift job (continue-on-error): downloads each pinned tarball and compares sha256sum to artifactSha256, surfacing drift without flaking PRs. Also reorder the `plugins` array by `name` (data-only; lastfm now precedes myanimelist/trakt) so the new sort-check passes. No field values changed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Step P-CI1 — Add JSON-Schema validation CI workflow
Adds
.github/workflows/validate-catalog.yml(triggered onpush+pull_request) that gates every change to the catalog trust root.Jobs / steps
schemajob) — validatesplugins.jsonagainst the already-mergedplugins.schema.jsonwith a pinned validator:npx --yes --package ajv-cli@5 --package ajv-formats@2 -- ajv validate --spec=draft2020 -s plugins.schema.json -d plugins.json -c ajv-formatsajv-formats@2is co-installed and passed via-c ajv-formatsbecause the schema usesformat: uri(plain ajv errors on theurikeyword — known catalog-PR landmine).--spec=draft2020because the schema is Draft 2020-12 (ajv-cli@5 / ajv v8 does not enable it by default).cache: npm— there is no lockfile in this repo (known landmine).jq -efilter assertsplugins.jsonis valid JSON (jq exits 5 on parse error) AND entries are sorted bynamewith no duplicatename. Addresses the "entries unsorted/undeduped" code-quality gap.pin-driftjob,continue-on-error: true) — for each entry, downloadshttps://github.com/<owner>/<repo>/archive/<ref>.tar.gzand assertssha256sum == artifactSha256, surfacing pin drift without flaking PRs.Data reorder (required)
The 4 entries on master were not sorted by
name(anidb, myanimelist, trakt, lastfm), so the new sort-check would have failed CI. This PR sorts thepluginsarray byname(anidb, lastfm, myanimelist, trakt) viajq '.plugins |= sort_by(.name)'. Proven data-only: sorting the original HEAD file and the new file and diffing is IDENTICAL — only element order changed, no field values touched.Local proof — GOOD data
Local proof — BAD data (each exits non-zero; fixtures never committed)
YAML validated with
python3 yaml.safe_load→ OK.Do not merge — Phase Coordinator owns the git cycle.
🤖 Generated with Claude Code