Commit ec6b32a
ci: verify committed models match regeneration from the pinned UCP spec (#62)
* ci: verify committed models match regeneration from the pinned UCP spec
The Tests workflow installs the committed generated models and runs the
unit suite, but never executes the generation pipeline itself
(generate_models.sh + preprocess_schemas.py + postprocess_models.py
end-to-end). A defect in the pipeline's wiring stays invisible as long
as the committed models are fine, and models edited or left stale
without regeneration are equally invisible.
This is not hypothetical: with the floating
datamodel-code-generator>=0.50.0 bound, the 0.72.0 release (2026-08-03)
mis-resolves the spec's remote $refs (HTTP 404 on a doubled path),
generation emits incomplete models, postprocess_models.py exits 1 -- and
CI stays green because it only ever tests the committed artifacts.
Add a model-drift job that regenerates the models against the pinned
UCP spec version for this SDK line (0.4.x -> 2026-04-08, per the README
compatibility table), normalizes file endings the way pre-commit does,
and fails if the result is not byte-identical to the committed models.
This catches a broken generator and uncommitted regeneration in one
check, without changing the release flow of committing generated
artifacts.
Pin the codegen toolchain (datamodel-code-generator==0.71.0,
ruff==0.16.1) so regeneration is reproducible; 0.71.0 + ruff 0.16.1
reproduce the committed models byte-for-byte after end-of-file
normalization.
* ci: pin github actions to commit hashes in tests.yml
* ci: upgrade and pin actions to latest versions in tests.yml
---------
Co-authored-by: damaz91 <federico.damato91@gmail.com>1 parent ce385e2 commit ec6b32a
2 files changed
Lines changed: 46 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| |||
0 commit comments