Skip to content

fix(schema): regenerate schema and fail CI when stale - #157

Merged
github-actions[bot] merged 5 commits into
mainfrom
fix/jsonschema-current
Oct 30, 2026
Merged

github-actions[bot] merged 5 commits into
mainfrom
fix/jsonschema-current

Conversation

@brujack

@brujack brujack commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • jsonschemagen/schema.json dated from 2026-05-24. It named actions by Rust variant (CommandRun), so no manifest validated against it, and nothing checked whether it was current. It is now regenerated: actions appear under their YAML names, zsh.oh-my-zsh among them.

  • jsonschemagen/tests/schema_current.rs fails when the committed file differs from the generated schema. It runs under cargo nextest, so make test, CI and the release job all enforce it. make schema regenerates the file, writing through a temp file so a failed run cannot truncate it.

  • Regenerating exposed host-dependent output. schemars evaluates serde defaults while it builds the schema, so:

    • command.run's dir embedded the generator's cwd (/home/bruce/...).
    • The user, group and package provider fields embedded the host OS: Linux and aptitude here, homebrew on macOS.

    Those 10 fields now drop the default from the schema via utilities::without_default. Serde behaviour is unchanged, and a doc comment now gives each field's schema description. The output is byte-identical whether it is generated from /, from /tmp, or with a different HOME.

  • jsonschemagen exits 1 on a serialize error. Before, it printed nothing and exited 0.

  • Releases attach the schema as etch-schema.json (unsigned; listed in the README).

  • Removed the 2022 comtrya Netlify files (jsonschemagen/.build/_redirects, jsonschemagen/.gitignore).

  • New P3 backlog row: PackageProviders::default() panics on hosts other than Ubuntu and macOS, so make test would panic there too. No fleet host or CI runner is affected.

Test Plan

  • Red first: the currency test (stale at line 2), the cwd test (schema embeds the cwd), and the host-OS test (Linux/aptitude defaults).
  • Mutation: removing the transform from package/repository.rs turns the host-OS and currency tests red.
  • CI mutation-pr round 1 found two survivors (without_default replaced with (), since only etch-lib tests run for a lib mutant; and main replaced with ()). Fixed in 5491583 with lib-side tests and a binary test. Local cargo mutants --in-diff: 4 of 4 caught.
  • The make schema failure path, with cargo not on PATH: rc 2, no temp file left, schema.json untouched.
  • No cfg(target_os) gate sits on a schema-visible type, so a macOS run generates the same file. This was checked by reading the code, not by running on macOS.
  • make test: 1161 nextest passed, 167 pytest passed.
  • Coverage (CI run 41145606346): Rust 83.50% (5280/6323, floor 81); Python 95.28% (floor 90). jsonschemagen is excluded from tarpaulin.

Code review

reviewed-sha: 5491583
diff-hash: 0705ba6d01acbef0bdc402979a0c31dd73c1ce6179946cc12269d294f7f41b7f
reviewers: 5/5

Four rounds. Round 1 (bf912ed): one finding, fixed in e087513 (package provider schema description claimed every host has a default; only Ubuntu and macOS do, others panic). Round 2 (e087513): one finding, fixed in 6db9214 (backlog row's suggested fix path was not implementable as written). Round 3 (0338187, README line listing etch-schema.json): no findings. Round 4 (5491583, tests killing the two mutants CI's mutation-pr found surviving): no findings. Steps 2-3 ran inline: root CLAUDE.md is the only one in scope.

RESOLVED: 2 fixed, 0 kept

Spec alignment

SKIP: no open plan has a spec: line (backlog fix, no plan)

🤖 Generated with Claude Code

https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf

brujack and others added 4 commits October 30, 2026 19:03
The committed schema dated from 2026-05-24 and named actions by Rust
variant, so no manifest validated against it, and nothing checked it.

- jsonschemagen/tests/schema_current.rs fails when schema.json differs
  from the generated schema; make test and CI run it. make schema
  regenerates it.
- Regenerating exposed host-dependent output: schemars evaluates serde
  defaults, so command.run's dir embedded the generator's cwd and the
  user, group and package providers embedded the host OS (Linux,
  aptitude; homebrew on macOS). Those ten fields now drop the default
  from the schema via utilities::without_default.
- jsonschemagen exits 1 instead of printing nothing on a serialize
  error.
- Releases attach the schema as etch-schema.json.
- Remove the 2022 Netlify hosting files under jsonschemagen/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
The published description said every host has a default; only Ubuntu
(apt) and macOS (brew) do, and other hosts panic. Backlog the panic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
@github-actions
github-actions Bot enabled auto-merge (squash) October 30, 2026 23:30
mutation-pr missed two mutants: cargo-mutants runs only etch-lib's tests
for a lib mutation, so jsonschemagen's guards never saw without_default
replaced with (); and nothing ran the jsonschemagen binary. Add lib-side
tests for without_default and command.run's schema, and a test that the
binary prints render()'s output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
@github-actions
github-actions Bot merged commit 045947e into main Oct 30, 2026
13 checks passed
@brujack
brujack deleted the fix/jsonschema-current branch October 30, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant