Skip to content

ci: validate hw_defs JSON against hwdef_schema.json - #7872

Merged
pfeerick merged 2 commits into
EdgeTX:mainfrom
pfeerick:pfeerick/ci-validate-hwdef-schema
Oct 6, 2026
Merged

pfeerick merged 2 commits into
EdgeTX:mainfrom
pfeerick:pfeerick/ci-validate-hwdef-schema

Conversation

@pfeerick

@pfeerick pfeerick commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary of changes:

tools/hwdef_schema.json was never checked against the board JSON files, so it drifted from them and from the Pydantic model without anyone noticing. Before this PR every board JSON failed validation against it.

  • Add the top-level haptic and key_lock_combo sections to the schema. Every board JSON has had these since chore: use settings from radio JSON files instead of hal.h #7411 and feat(radio): optional key lock feature #7383, but the schema did not list them. key_lock_combo reuses the key enum and requires exactly two distinct keys, matching the check in models.py.
  • Add KEY_BIND to the schema's key enum to match KeyEnum in models.py.
  • In validate_hw_defs.yml:
    • add a check-jsonschema step that validates every file in radio/src/boards/hw_defs/ against the schema (the same uvx check-jsonschema approach as validate_cmake_presets.yml)
    • rename the existing "Validate JSON schemas" step to "Validate against Pydantic model", since it never used the schema
    • also run the workflow when the schema or the workflow itself changes

Tested locally: all board JSONs pass both the schema and the Pydantic checks, and the workflow file passes GitHub's workflow schema.

🤖 Generated with Claude Code

pfeerick and others added 2 commits October 6, 2026 04:03
Both are top-level sections in every board JSON (EdgeTX#7411, EdgeTX#7383), but
the schema did not list them, so every file failed validation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing checked the board JSON files against the schema, so it drifted
from the files and the Pydantic model unnoticed. Add a check-jsonschema
step, and rename the existing step, which only checks the Pydantic
model. Run the workflow when the schema or the workflow itself changes.

Also add KEY_BIND to the schema's key enum to match KeyEnum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfeerick pfeerick added this to the 3.0 milestone Oct 6, 2026
@pfeerick pfeerick added the ci/cd 🔧 Related to GitHub Actions and similar issues label Oct 6, 2026
@pfeerick
pfeerick merged commit e8814a6 into EdgeTX:main Oct 6, 2026
3 checks passed
pfeerick added a commit that referenced this pull request Oct 7, 2026
The schema validation CI from #7872 rejects the status_led_rgb_strip
and status_led_pwm_timer* keys this branch adds to the leds block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd 🔧 Related to GitHub Actions and similar issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant