Repository navigation
Commit 0b2f6b7
settings-as-code-release
refactor(errors): return typed problems as neverthrow Results across validation, config, fold, flows, and the library
Every failure outside the sections' API-call channel is now a member of one `Problem` union (src/problem.ts, discriminated on `code`) returned as a neverthrow `Result`/`ResultAsync` instead of a thrown domain error or a `{error: string}` shape. `describeProblem` is the one renderer; the action edge (`failRun`, `run()`) renders there, so every line the action prints, every output, summary, and exit code is unchanged (the e2e corpus is green as it was).
Converted: `validateSectionShapes`, `validateSettingsDoc`, `mergeLayers` (the admission walk returns Results; the `LayerRefusal` throw and `describeRefusal` are gone, their prose lives in `describeProblem` as the `layer-*` cases under the same value-free invariant), `parseSettingsDoc`, `readSettingsFile` (now takes the file's role, which selects the advice), `readLayerFiles`, `foldLayers`, `runSingle`, `runMulti` (a `safeTry` async generator; `orTee` flushes the buffered central warnings on the fatal paths), `runMerge` (returns the finished merge; `concludeMerge` writes the summary), `parseConfig` (`safeTry`), `parseReposInput`, `parseRepoSlug`, `resolveCentralTargets`, `discoverRepos` (`ResultAsync.fromPromise`), `parseRecipient`, and the library's `validateSettings`.
`isPlainObject` moves to src/plain-data.ts so the renderer and the fold share it; `quoteList` moves to src/problem.ts. `ARTIFACT_NEEDS_UPLOADER` is gone: `requireUploader` returns the `artifact-uploader-missing` problem and `openReportChannel`'s backstop throw renders it. `architecture.yml` gains the `problem` layer (edges from engine, flows, discovery, report, library; problem reads github and plain-data).
Tests assert on `code` and the structured payload; test/problem.test.ts renders one specimen per member, typed over every code so a new member fails compilation until it has both a case and a specimen.1 parent f0bc13c commit 0b2f6b7
57 files changed
Lines changed: 2201 additions & 1372 deletions
File tree
- .github/scripts
- docs/reference
- src
- action
- discovery
- engine
- flows
- report
- sections
- actions_secrets
- actions
- repository
- secret_scanning_custom_patterns
- webhooks
- test
- action
- discovery
- docs
- e2e
- engine
- flows
- library
- report
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| |||
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
| 254 | + | |
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
| |||
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| 263 | + | |
261 | 264 | | |
| 265 | + | |
262 | 266 | | |
263 | 267 | | |
264 | 268 | | |
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
| |||
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
| 286 | + | |
281 | 287 | | |
282 | 288 | | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
| 292 | + | |
286 | 293 | | |
287 | 294 | | |
288 | 295 | | |
| 296 | + | |
| 297 | + | |
289 | 298 | | |
290 | 299 | | |
291 | 300 | | |
| |||
0 commit comments