fix(control-plane): green the example validation (validator crash + schema contradiction + broken JSON)#196
Merged
Conversation
…chema contradiction + broken JSON)
The control-plane contract check (surfaced via the 'OpsHistory contracts' CI job
that runs the whole `make validate`) has been red on main for ~2 months. Three
distinct defects, all fixed here:
1. Validator crash: tools/validate_control_plane_examples.py called
Path.with_name('./release-set.schema.json'), which raises ValueError because
with_name rejects names containing '/'. Removed the dead line; the correct
(schema_path.parent / legacy_ref).resolve() already sat right below it.
2. Contradictory schemas for one example: release_set.json and fingerprint.json
are validated by BOTH validate-control-plane-examples (via the control-plane
wrappers, which allOf-delegated to the legacy snake_case schemas) AND
validate-nlboot-examples (against the canonical v2 camelCase schemas). No single
document can satisfy both, so it was unfixable at the example level. Repointed the
two shared control-plane wrappers (ReleaseSet, Fingerprint) to delegate to the
canonical v2 contracts (../ReleaseSet.json, ../Fingerprint.json) — matching the
wrappers' stated purpose of providing a stable srcos namespace over the canonical
schema. BootReleaseSet/EnrollmentToken keep their legacy snake schemas (only the
control-plane validator checks them; no v2 equivalent).
3. Invalid JSON: examples/boot_release_set.json was a botched merge — two object
bodies concatenated (missing comma after the first block's notes, duplicate
status/artifacts/created_at/notes keys). Reconstructed as the single valid union
its schema requires (identity fields + the richer recovery body).
`make validate` now passes end-to-end (control-plane + nlboot + all families).
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.
The control-plane contract check — surfaced via the "Validate OpsHistory contracts" CI job, which runs the whole
make validateaggregate — has been red onmainfor ~2 months, independent of the cockpit contract pack (#195). This fixes it with a minimal, 4-file change.Three distinct defects
Validator crash —
tools/validate_control_plane_examples.pycalledPath.with_name("./release-set.schema.json"), which raisesValueError(with_namerejects names containing/). The correct(schema_path.parent / legacy_ref).resolve()already sat on the next line; removed the dead/crashing one.Contradictory schemas for one example (the core breakage).
examples/release_set.jsonandexamples/fingerprint.jsonare validated by both validators:validate-control-plane-examples→ the control-plane wrappers, whichallOf-delegated to the legacy snake_case schemas (release_set_id,created_at, …)validate-nlboot-examples→ the canonical v2 camelCase schemas (id/type/specVersion,createdAt, …)Both are
additionalProperties: falsewith mutually exclusive key sets, so no single document can satisfy both — unfixable at the example level. Repointed the two shared wrappers (schemas/control-plane/ReleaseSet.json,Fingerprint.json) to delegate to the canonical v2 contracts (../ReleaseSet.json,../Fingerprint.json) — matching the wrappers' stated purpose of "providing a stable srcos namespace."BootReleaseSet/EnrollmentTokenkeep their legacy snake schemas (only the control-plane validator checks them; no v2 equivalent).Invalid JSON —
examples/boot_release_set.jsonwas a botched merge (froma2b9dc9intowork/boot-provisioning-examples): two object bodies concatenated (missing comma after the first block'snotes, duplicatestatus/artifacts/created_at/notes). Reconstructed as the single valid union its rich schema requires (identity fields + the fuller recovery body).Result
make validatenow passes end-to-end — control-plane, nlboot, and all other families:Note: this is the control-plane / boot-provisioning lane. The boot JSON repair reconstructs the intended union of that workstream's merge; worth a glance from its owner to confirm the reconstructed
boot_release_set.jsonmatches intent.🤖 Generated with Claude Code