Repository navigation
Commit 5b9f022
authored
fix(ci): make the gates capable of both passing and failing (#9)
* fix(ci): make the gates capable of both passing and failing
main was red, and had two opposite problems sitting next to each other.
PSALM. psalm.xml suppressed NoEnvOutsideConfig for src/, and Psalm reported
UnusedIssueHandlerSuppression because the issue is never raised — src/'s env()
calls live in files literally named config.php, which the Laravel plugin already
treats as config. So the suppression protected nothing and its own unusedness was
the only error Psalm found. Removing it takes Psalm from exit 2 to "No errors
found!" with the 1486 info-level issues unchanged. That was the whole Psalm half
of the red.
TESTS. tests.yml ran a bare `phpunit`, which includes the Module suite —
src/**/*Test.php, 448 known failures, treated everywhere else as visible debt
rather than a gate. So the workflow could never pass. It now runs
--testsuite=Feature,Unit, which is exit 0 with 269 tests, and the Module suite
gets its own job with continue-on-error so the number stays on screen and can be
driven down. That mirrors .gitlab-ci.yml, which had already made exactly this
split with the reasoning written out.
fail-fast is off on the matrix. With it on, the first failing leg cancelled the
others, so a break specific to one PHP version was indistinguishable from a break
on all three.
AND THE OTHER DIRECTION. ci.yml ran pint, phpstan and pest each with `|| true`.
It was the one check in the repository that could not fail, next to a Tests
workflow that could not pass. Removed, all three.
Doing that surfaced something the `|| true` had been hiding: the Pest step passed
--no-interaction, which is a PHPUnit flag. Pest answers `Unknown option
"--no-interaction"` and exits 2. That step has never run the suite once — not
"ran and was ignored", never ran. A check that swallows its exit code cannot tell
you it is not the check you think it is.
Verified locally, every gate:
pint --test exit 0
phpstan analyse exit 0
psalm --show-info=false exit 0 (was 2)
pest --testsuite=Feature,Unit exit 0 (was 2, on the bad flag)
phpunit --testsuite=Feature,Unit exit 0 (was 1, via the debt suite)
phpunit --testsuite=Module exit 1 — expected, now non-gating
The 448 is not 448 bugs, and the debt job says so: ~114 are class-not-found for
sibling packages' classes and cannot pass here at all, ~30 are one real defect
(StorageUrlResolver handed a CdnUrlBuilder where it wants a BunnyStorageService),
the rest ordinary assertion failures. Named there so the next person starts from
the breakdown rather than the total.
Left alone deliberately: ci.yml now overlaps static-analysis.yml on pint and
phpstan, and tests.yml on the suite. Duplicated gates are harmless; lying ones
are not. Consolidating them is a tidy-up, not this change.
Co-Authored-By: Virgil <virgil@lethean.io>
* fix(psalm): the 13 errors CI was actually failing on, and a wrong diagnosis undone
I diagnosed Psalm from local output and got it wrong twice. Correcting both here
rather than quietly.
WHAT I DID WRONG. Locally Psalm reported one error — UnusedIssueHandlerSuppression
for the NoEnvOutsideConfig suppression in psalm.xml — so I removed the suppression
and saw exit 0. In CI that removal produced 183 NoEnvOutsideConfig errors in
src/Core/config.php. The suppression was doing real work; it only looks unused
locally, because the Laravel plugin resolves the config directory differently
there. Reverted.
WHAT CI WAS ACTUALLY FAILING ON, which I should have read first: 13
PublicModelAccessor errors, none of which appear locally at all.
6 src/Core/Seo/SeoMetadata.php
2 src/Core/Seo/Models/SeoScoreHistory.php
2 src/Core/Media/Image/ImageOptimization.php
2 src/Core/Config/Models/ConfigValue.php
1 src/Core/Cdn/Models/StorageOffload.php
Eloquent accessors and mutators declared public. Laravel reaches them through
getAttribute()/__get, so protected is what they should be, and public invites
somebody to call getValueAttribute() directly and depend on it.
Made protected, all 13. Checked first that nothing calls any of them directly —
not in this package, and not in host.uk.com, which is the only consumer — so the
visibility change costs nobody anything. All five classes extend Model, so the
framework path is the only path.
The lesson is the same one I flagged in another repo this morning and then walked
into: local and CI disagreed, and I trusted the copy in front of me instead of
opening the job log. Local Psalm reports 1 error / 1486 issues, CI reports 13 / 1155.
On a tool with a Laravel plugin that bootstraps differently per environment, the
CI log is the only source that speaks for CI.
vendor/bin/pint --test pass
vendor/bin/phpstan analyse no errors
./vendor/bin/pest --testsuite=Feature,Unit 268 passed, 0 failed — unchanged
./vendor/bin/pest --testsuite=Module 448 failed / 308 passed — unchanged
Psalm itself cannot be verified from here, for the reason above. CI is the check.
Co-Authored-By: Virgil <virgil@lethean.io>1 parent 6d766ee commit 5b9f022
7 files changed
Lines changed: 74 additions & 18 deletions
File tree
- .github/workflows
- src/Core
- Cdn/Models
- Config/Models
- Media/Image
- Seo
- Models
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | | - | |
| 28 | + | |
22 | 29 | | |
23 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
24 | 34 | | |
25 | | - | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
39 | 48 | | |
40 | | - | |
| 49 | + | |
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| |||
46 | 55 | | |
47 | 56 | | |
48 | 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 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| |||
0 commit comments