feat: the pipeline runs the schema check first

PR validation runs validate_schemas.py --source-only and the pipeline did not, so a profile with an unquoted numeric core name passed every step and failed CI on push. It is step 0 now, skipped where jsonschema is not installed.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 04:50:04 +02:00
1 parent 8a44161810
commit 8bd2d319b2
4 files changed
+33

No files matched your search

+16
View File
@@ -2,6 +2,7 @@
"""Run the full retrobios pipeline.
Steps, numbered as the run prints them:
0 validate_schemas.py profiles and platform YAMLs, as PR CI checks them
1 generate_db.py --force rebuild database.json from bios/
1b provenance_report.py dump-catalog coverage, derivable.json
1c romset_recipes.py archive identification, reconstruction targets
@@ -39,6 +40,7 @@ from __future__ import annotations
import argparse
import contextlib
import importlib.util
import os
import re
import subprocess
@@ -469,6 +471,20 @@ def main() -> None:
total_start = time.monotonic()
results = StepResults(total_start)
# Step 0: the schema check PR validation runs. Without it a profile with
# `cores: [81]` unquoted passed the whole pipeline and failed CI on push.
# jsonschema is tooling only, so its absence skips the step.
if importlib.util.find_spec("jsonschema") is None:
print("\n--- 0/8 validate schemas: SKIPPED (jsonschema not installed) ---")
results["validate_schemas"] = SKIPPED
else:
ok, _ = run(
[sys.executable, "scripts/validate_schemas.py", "--source-only"],
"0/8 validate schemas",
)
results["validate_schemas"] = ok
all_ok = all_ok and ok
# Step 1: Generate database
ok, out = run(
[
+15
View File
@@ -5572,5 +5572,20 @@ class AHashConflictIsReportedOnce(unittest.TestCase):
self.assertEqual(err.getvalue().count("WARNING"), 1)
class ThePipelineRunsTheSchemaCheckCIRuns(unittest.TestCase):
"""The pipeline the repository asks for after every change never ran
validate_schemas.py, which PR validation does: a profile with an
unquoted numeric core name passed it and failed CI on push."""
def test_the_ci_command_is_a_pipeline_step(self):
workflow = (ROOT / ".github" / "workflows" / "validate.yml").read_text(encoding="utf-8")
command = re.search(r"python (scripts/validate_schemas\.py[^\n]*)", workflow).group(1)
script, *flags = command.split()
source = (ROOT / "scripts" / "pipeline.py").read_text(encoding="utf-8")
self.assertIn(f'"{script}"', source)
for flag in flags:
self.assertIn(f'"{flag}"', source)
if __name__ == "__main__":
unittest.main()
+1
View File
@@ -365,6 +365,7 @@ python scripts/pipeline.py --offline
This executes in sequence:
0. `validate_schemas.py --source-only` - the schema check PR validation runs
1. `generate_db.py` - rebuild `database.json` from `bios/`
1b. `provenance_report.py` - dump-catalog coverage from `provenance/`
2. `refresh_data_dirs.py` - update data directories (skipped with `--offline`)
+1
View File
@@ -23,6 +23,7 @@ Pipeline steps:
| Step | Description | Skipped by |
|------|-------------|------------|
| 0/8 | Validate profiles and platform YAMLs against the schemas | - (no `jsonschema` installed) |
| 1/8 | Generate database | - |
| 1b | Dump-catalog coverage report | - (offline, reads `provenance/`) |
| 1c | Romset recipes: identify archives, list rebuild targets | - (offline, reads `recipes/`) |