Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

chore(ci): spec-validation gate — json-strict + manifest + register checks#32

Merged
rubenvdlinde merged 1 commit into
developmentfrom
chore/spec-validation-gate
May 12, 2026
Merged

chore(ci): spec-validation gate — json-strict + manifest + register checks#32
rubenvdlinde merged 1 commit into
developmentfrom
chore/spec-validation-gate

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Adds a Spec Validation workflow + 3 checks that catch the class of bug seen in scholiq Wave 2 before it reaches development (silent schema clobber on a bad JSON merge, appendOnly nested in x-openregister, a lifecycle requires: pointing at a non-existent PHP class). Every app scaffolded from this template inherits it. See commit message for detail. To make it block merges, add Spec Validation / validate to the branch-protection ruleset's required checks (org settings). 🤖 Generated with Claude Code

…hecks

Adds a Spec Validation workflow + three checks that catch the class of bug
seen in scholiq Wave 2 *before* it reaches development:

- tests/validate-json-strict.js — strict JSON parse of src/manifest.json +
  lib/Settings/*_register.json; FAILS on duplicate keys (git merges JSON
  line-by-line; two adds at the same key but different file positions produce
  no textual conflict, just a doc with a dup key, and json_decode keeps the
  last → silent schema/page loss) and on `appendOnly` nested inside an
  x-openregister block (OpenRegister's Schema::hydrate only reads a top-level
  appendOnly, so a nested one is silently dropped).
- tests/validate-register.js — structural checks on the register seed: every
  schema has slug/type/required/properties; slug uniqueness; lifecycle
  `requires:` references a PHP class that exists under lib/ (catches scholiq's
  missing CoursePublishGuard); a 'schema looks clobbered / is a stub' heuristic
  (≤3 props + no x-openregister-*). Optional deep check against OR's
  configurations/validate endpoint when OR_BASE_URL + OR_BASIC_AUTH are set.
- package.json: check:register, check:json-strict, check:specs scripts.
- .github/workflows/spec-validation.yml: runs `npm run check:specs` on every
  push/PR. Add 'Spec Validation / validate' to the branch-protection ruleset's
  required checks to make it block merges.
- README: documents the new checks and why they matter.

Every app scaffolded from this template inherits the gate.
@rubenvdlinde rubenvdlinde merged commit 1ab445d into development May 12, 2026
25 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/nextcloud-app-template @ 7df3317

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 427/427
PHPUnit
Newman
Playwright ⏭️

Coverage: 0% (0/3 statements)


Quality workflow — 2026-05-12 07:50 UTC

Download the full PDF report from the workflow artifacts.

rubenvdlinde added a commit to ConductionNL/scholiq that referenced this pull request May 12, 2026
…ate (#46)

Adds tests/validate-register.js + tests/validate-json-strict.js + the
Spec Validation workflow + check:register / check:json-strict / check:specs
npm scripts (mirrors ConductionNL/nextcloud-app-template#32). Catches the
Wave-2 class of bug — silent schema clobber on a bad JSON merge, appendOnly
nested in x-openregister, a lifecycle requires: pointing at a missing PHP
class — on every push/PR. Add 'Spec Validation / validate' to the branch
ruleset's required checks to make it block merges.

All three checks PASS on the current register + manifest.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant