Commit e1a5b49
authored
feat(release): reusable check-vendored-contracts workflow + path overrides (#717)
Adds the missing piece for catching cross-repo contract drift in CI: a
reusable workflow consumer repos call to drift-check their vendored
copies of `dispatch.schema.json`, `TagVerifier.php`, and
`TagVerificationResult.php` against canonical, plus path-override flags
that let website-openemr's non-canonical layout participate.
Refs #664. Closes the May 8 status snapshot's open
follow-up: *"Drift-check tooling for the vendored `dispatch.schema.json`
copies — today proved the manual propagation is a real failure mode."*
## Why now
The check-vendored tool itself has existed since #665 and was tightened
in #668 (semantic equivalence: JSON canonicalization, namespace
stripping). But **no consumer's CI runs it.** I confirmed this by
running the tool locally against checkouts of openemr/openemr and
openemr/website-openemr — both are silently drifted right now. The
failure mode #700 hit (manual propagation skipped) is alive and well;
without a CI gate in each consumer it'll keep biting us.
## What this PR adds
1. **`tools/release/src/VendoredFileChecker.php`** — optional
canonical→consumer path-overrides map. Required because website-openemr
vendored `TagVerifier` and `TagVerificationResult` into `src/Release/`
instead of `src/`, so the checker could never validate it before. Drift
findings now report the *consumer-relative* path so the failure points
at the file the consumer actually has on disk.
2. **`tools/release/bin/check-vendored.php`** — two complementary flags:
- `--override CANON=CONSUMER` (repeatable) for direct CLI use.
- `--overrides` (single value, newline-delimited) for CI inputs that
arrive as multi-line strings; the PHP CLI does the parsing so the
calling workflow doesn't have to construct a flag list in shell.
3. **`.github/workflows/check-vendored-contracts.yml`** —
`workflow_call` reusable workflow consumers invoke with one job:
```yaml
jobs:
drift:
uses:
openemr/openemr-devops/.github/workflows/check-vendored-contracts.yml@master
with:
consumer_subpath: tools/release
```
website-openemr passes `path_overrides` to map its `src/Release/...`
layout.
4. **`.github/workflows/vendored-contracts-self-test.yml`** + fixtures —
exercises the reusable workflow against a canonical-layout fixture and a
website-style override fixture inside this PR's CI, so the workflow has
end-to-end coverage before any consumer adopts it.
Same shape as the reusable-workflow shim the May 8 follow-up on #664
proposes for the conductor itself; building it here at lower stakes
validates the pattern before we apply it to the conductor.
## Adoption (separate PRs, after this lands)
- openemr/openemr — add a workflow that calls this one with
`consumer_subpath: tools/release`. Will fail until the existing PHP-file
drift is reconciled (this PR doesn't touch the canonical content, only
the checker).
- openemr/website-openemr — add a workflow with `consumer_subpath:
tools/release-docs` and the path overrides. Same drift-reconciliation
prerequisite, plus the `TagVerificationResult` ↔ `VerificationResult`
rename to sort out.
Both adoptions are blocked on a separate drift-reconciliation pass; this
PR only ships the tooling so the gate *can* be added later without
further changes here.
## Test plan
- [x] `vendor/bin/phpunit` — 14 tests, +4 covering override mapping,
override-aware drift reporting, and unknown-key validation
- [x] `vendor/bin/phpcs` — clean
- [x] `vendor/bin/phpstan analyse` — clean
- [x] `actionlint` on both new workflows — clean
- [x] CLI smoke-tested against both consumer checkouts — overrides
resolve correctly, drift findings name the consumer's actual paths
- [x] Self-test workflow green on PR CI — both `good` and
`good-with-overrides` jobs pass, validating the reusable workflow
end-to-end1 parent 424f428 commit e1a5b49
11 files changed
Lines changed: 861 additions & 5 deletions
File tree
- .github/workflows
- tools/release
- bin
- src
- tests
- fixtures/vendored
- good-overrides
- contracts
- src/Release
- good
- contracts
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 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 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
45 | 60 | | |
46 | 61 | | |
47 | 62 | | |
| |||
63 | 78 | | |
64 | 79 | | |
65 | 80 | | |
66 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
67 | 123 | | |
68 | 124 | | |
69 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
| 64 | + | |
50 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
51 | 92 | | |
52 | 93 | | |
53 | 94 | | |
| |||
58 | 99 | | |
59 | 100 | | |
60 | 101 | | |
61 | | - | |
| 102 | + | |
| 103 | + | |
62 | 104 | | |
63 | 105 | | |
64 | 106 | | |
| |||
70 | 112 | | |
71 | 113 | | |
72 | 114 | | |
73 | | - | |
| 115 | + | |
74 | 116 | | |
75 | 117 | | |
76 | 118 | | |
77 | 119 | | |
78 | 120 | | |
79 | 121 | | |
80 | 122 | | |
81 | | - | |
| 123 | + | |
82 | 124 | | |
83 | 125 | | |
84 | 126 | | |
| |||
0 commit comments