Commit 33fb171
authored
fix(release): round-2 mutator fixes discovered in rel-820 cut first exercise (openemr#12731)
Fixes 5 bugs surfaced by today's rel-820 cut — the first end-to-end
production exercise of the branch-cut + release-prep + release-finalize
automation. Four PRs currently open on rel-820 (openemr#12725 release-prep,
openemr#12726 release-finalize, openemr#12727 branch-cut rel-side, openemr#12728 branch-cut
master-side) each hit at least one of these. After this PR lands: close
those four + delete their branches + delete rel-820 + recreate — the
four cut-time PRs re-open fresh against the corrected mutators.
## Changes
**1. `DockerUpgradeScaffoldMutator`** — generate `fsupgrade-(N+1).sh` by
copying `fsupgrade-N.sh` in full and applying five line-level
substitutions (docker-version `N` → `N+1` in the header comment and two
echoes; prior-openemr-version marker in header comment and in the
`priorOpenemrVersion` shell variable). Previously wrote a stub that
failed ShellCheck (SC2034 on `priorOpenemrVersion`) and lacked a
trailing newline. Copy-in-full preserves the shellcheck directives,
trailing newline, and existing upgrade body from the prior file. New
test fixture: real `fsupgrade-11.sh` input + golden
`fsupgrade-12.sh.expected` showing exactly the 5-line diff.
**2. `PostReleaseTargetsMutator`** — early-return with a skipped
`MutatorResult` when no live row exists for the target rel branch in
`release-targets.yml`. Previously ran the "drop `latest` from prior
holder" step unconditionally, leaving the file with no row carrying
`latest` when release-finalize fired prematurely at cut time (openemr#12726's
symptom).
**3. `ReleasePrepCommand`** — remove `GlobalsIncMutator` from the
rel-side mutator list. Cut owns the `allow_debug_language` flip; running
it again at release-prep was defensive but hid the "did cut merge?"
question behind mutator idempotency.
**4. `DockerComposeProductionMutator`** — drop digest handling entirely.
Previously pinned `openemr/openemr:latest@sha256:X` →
`openemr/openemr:VERSION@sha256:X`, requiring `--image-digest` at
release-prep time. Chicken-and-egg: the release image is built after the
tag fires, which requires release-prep to merge. New behavior swaps only
the tag: `openemr/openemr:latest[@sha256:X]` → `openemr/openemr:VERSION`
(no digest). `MutatorContext::imageDigest` field and the
`--image-digest` CLI option are removed alongside.
**5. Docs updated** — `docs/release-automation-plan.md` (release-prep
mutator bullets reflect the new behavior) and `docs/RELEASE_PROCESS.md`
(the short "conductor rewrites" summary catches up).
## Test coverage
Per-change adequate coverage:
| Change | New/updated tests |
|---|---|
| 1. DockerUpgradeScaffold | 5 new methods + real fsupgrade-11 input +
golden fsupgrade-12 expected |
| 2. PostReleaseTargets | 2 new methods (no-live-row +
only-unreleased-placeholder cases) |
| 3. ReleasePrepCommand | 1 new method asserting GlobalsIncMutator
absent |
| 4. DockerComposeProduction | 2 test methods in MutatorTest.php updated
to reference new `pinned_tag_only_expected.yml` fixture (3 old fixtures
deleted) |
| 5. MutatorContext | `imageDigest`-specific tests removed cleanly |
Net delta: **+4 tests** on the isolated suite (new tests minus removed
imageDigest-specific).
## Verification
- `pit` clean: **3587 tests pass** in a freshly-nuked-and-recreated
docker stack
- Pre-commit hooks all green (phpstan, phpcs, rector,
composer-require-checker, codespell, conventional-commits)
- Manual audit for `imageDigest` residual references: only remaining
mention is in `DockerComposeProductionMutator.php`'s docstring
explaining the historical why (valid documentation)
- No TODO/FIXME markers left
## After merge
Clean-slate rebuild for the rel-820 cut:
```
gh pr close 12725 12726 12727 12728 --repo openemr/openemr --delete-branch
git push origin --delete rel-820
git push origin master:rel-820
```
All 4 workflows re-fire with the corrected mutators → 4 fresh PRs
against the fixed state.1 parent 1d39d67 commit 33fb171
25 files changed
Lines changed: 503 additions & 278 deletions
File tree
- docs
- src/Common/Command
- ReleasePrep
- Mutator
- tests/Tests/Isolated/Common/Command/ReleasePrep
- Mutator
- fixtures
- docker_compose
- docker_upgrade
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
222 | 225 | | |
223 | 226 | | |
224 | 227 | | |
225 | 228 | | |
226 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
| |||
302 | 312 | | |
303 | 313 | | |
304 | 314 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
309 | 321 | | |
310 | 322 | | |
311 | 323 | | |
| |||
406 | 418 | | |
407 | 419 | | |
408 | 420 | | |
409 | | - | |
410 | | - | |
| 421 | + | |
411 | 422 | | |
412 | 423 | | |
413 | 424 | | |
| |||
428 | 439 | | |
429 | 440 | | |
430 | 441 | | |
431 | | - | |
432 | | - | |
| 442 | + | |
| 443 | + | |
433 | 444 | | |
434 | 445 | | |
435 | 446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
| |||
161 | 160 | | |
162 | 161 | | |
163 | 162 | | |
164 | | - | |
165 | 163 | | |
166 | 164 | | |
167 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | 137 | | |
139 | 138 | | |
140 | 139 | | |
| |||
Lines changed: 21 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | | - | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 60 | + | |
68 | 61 | | |
69 | 62 | | |
70 | 63 | | |
| |||
95 | 88 | | |
96 | 89 | | |
97 | 90 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 91 | + | |
102 | 92 | | |
103 | 93 | | |
104 | 94 | | |
| |||
114 | 104 | | |
115 | 105 | | |
116 | 106 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
133 | 111 | | |
134 | 112 | | |
0 commit comments