feat/metadata-schema-validation #165

Merged
unkinben merged 4 commits from feat/metadata-schema-validation into master 2026-05-17 12:34:33 +10:00

4 Commits

Author SHA1 Message Date
unkinben db5a829429 test: validate all metadata.yaml files against schema in pytest
ci/woodpecker/pr/build-fedora42 Pipeline was successful
ci/woodpecker/pr/build-fedora44 Pipeline was successful
ci/woodpecker/pr/build-fedora43 Pipeline was successful
ci/woodpecker/pr/build-almalinux9 Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build-almalinux8 Pipeline was successful
2026-05-17 12:32:46 +10:00
unkinben ff34987784 refactor: use make test in pre-commit hook 2026-05-17 12:30:35 +10:00
unkinben f46e8bfc0b feat: add pytest pre-commit hook and tests scaffold (issue #162)
- pyproject.toml with pytest>=8 in [dependency-groups.dev] so
  uv run --group dev pytest resolves without a global install
- tests/__init__.py and tests/conftest.py skeleton referencing issue #162
- pre-commit local hook runs pytest tests/ on Python file changes;
  exit code 5 (no tests collected) is treated as success so commits
  are not blocked while the test suite is being built out
2026-05-17 12:30:35 +10:00
unkinben 26c399598c feat: JSON Schema validation for metadata.yaml as pre-commit hook
Adds schema/metadata.json (JSON Schema draft-07) as the authoritative
schema for all rpms/*/metadata.yaml files.  Key constraints:

- additionalProperties: false at both the top level and builds items,
  so unknown fields are rejected outright
- name allows dots (fixes neovim-glibc-2.17)
- github is optional (fixes claude-code, which has no GitHub repo)
- repository enum includes fedora/42, fedora/43, fedora/44
- dist_tag boolean field documented in schema

Pre-commit hook (check-jsonschema 0.37.2) runs against every file
matching ^rpms/[^/]+/metadata\.yaml$ on every commit.

Also fixes rpms/claude-code/metadata.yaml: removes the unknown
claude_ai field and normalises field order.
2026-05-17 12:30:35 +10:00