Skip to content

Commit 0998919

Browse files
Vivswansettings-as-code-release
andauthored
refactor(errors): neverthrow Results with typed problems across validation, config, fold, flows, and the library (#145)
Co-authored-by: settings-as-code-release <settings-as-code-release@users.noreply.github.com>
1 parent 10a1f7b commit 0998919

72 files changed

Lines changed: 3273 additions & 2129 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/scripts/changed-sections.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const ALL_SELECTING_PREFIXES = [
7777
"src/plain-data.ts",
7878
"src/private-open.ts",
7979
"src/private.ts",
80+
"src/problem.ts",
8081
"src/schema.ts",
8182
"src/types.ts",
8283
"test/e2e/",

‎.github/scripts/gen-action-docs.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import { readFileSync, writeFileSync } from "node:fs";
88
import { dirname, join, posix } from "node:path";
9-
import type { InputDecl } from "../../src/action/inputs.js";
10-
import { INPUT_DECLS } from "../../src/action/inputs.js";
119
import { OUTPUT_DECLS } from "../../src/action/io.js";
10+
import type { InputDecl } from "../../src/flows/inputs.js";
11+
import { INPUT_DECLS } from "../../src/flows/inputs.js";
1212
import { UNDECLARED_POLICY_SECTIONS, type UndeclaredPolicySection } from "../../src/schema.js";
1313
import { overrideAdviceLevel } from "../../src/sections/contract/errors.js";
1414
import type { SectionMeta } from "../../src/sections/contract/module.js";

‎action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ branding:
66
color: blue
77

88
inputs:
9-
# BEGIN GENERATED: action-inputs (bun run build:action-docs; edit src/action/inputs.ts)
9+
# BEGIN GENERATED: action-inputs (bun run build:action-docs; edit src/flows/inputs.ts)
1010
token:
1111
description: >-
1212
Token used for the API calls. Most sections need a fine-grained PAT with

‎architecture.yml‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ layers:
1818
report: [src/report/]
1919
schema: [src/schema.ts]
2020
io: [src/io.ts]
21+
problem: [src/problem.ts]
2122
types: [src/types.ts]
2223
plain-data: [src/plain-data.ts]
2324
private: [src/private.ts, src/private-open.ts]
@@ -34,12 +35,13 @@ exclude:
3435
edges:
3536
main: [action]
3637
action: [library]
37-
library: [discovery, engine, flows, github, io, report, schema, sections, types]
38-
flows: [discovery, engine, github, io, private, report, schema]
39-
engine: [discovery, github, io, plain-data, schema, sections, types]
38+
library: [discovery, engine, flows, github, io, problem, report, schema, sections, types]
39+
flows: [discovery, engine, github, io, plain-data, private, problem, report, schema, types]
40+
engine: [discovery, github, io, plain-data, problem, schema, sections, types]
4041
sections: [discovery, engine, github, schema, types, upstream-gaps]
4142
github: [io, plain-data]
42-
discovery: [github, private]
43-
report: [discovery, engine, github, io, private, schema, sections, types]
43+
discovery: [github, private, problem]
44+
report: [discovery, engine, github, io, private, problem, schema, sections, types]
45+
problem: [plain-data, schema]
4446
schema: [sections, types]
4547
upstream-gaps: [types]

‎bun.lock‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/reference/architecture.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ graph TD
239239
report["src/report/"]
240240
schema["src/schema.ts"]
241241
io["src/io.ts"]
242+
problem["src/problem.ts"]
242243
types["src/types.ts"]
243244
plain_data["src/plain-data.ts"]
244245
private["src/private.ts<br>src/private-open.ts"]
@@ -250,6 +251,7 @@ graph TD
250251
library --> flows
251252
library --> github
252253
library --> io
254+
library --> problem
253255
library --> report
254256
library --> schema
255257
library --> sections
@@ -258,13 +260,17 @@ graph TD
258260
flows --> engine
259261
flows --> github
260262
flows --> io
263+
flows --> plain_data
261264
flows --> private
265+
flows --> problem
262266
flows --> report
263267
flows --> schema
268+
flows --> types
264269
engine --> discovery
265270
engine --> github
266271
engine --> io
267272
engine --> plain_data
273+
engine --> problem
268274
engine --> schema
269275
engine --> sections
270276
engine --> types
@@ -278,14 +284,18 @@ graph TD
278284
github --> plain_data
279285
discovery --> github
280286
discovery --> private
287+
discovery --> problem
281288
report --> discovery
282289
report --> engine
283290
report --> github
284291
report --> io
285292
report --> private
293+
report --> problem
286294
report --> schema
287295
report --> sections
288296
report --> types
297+
problem --> plain_data
298+
problem --> schema
289299
schema --> sections
290300
schema --> types
291301
upstream_gaps --> types

‎docs/reference/inputs.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Every `with:` input the action accepts, and the outputs it sets for the steps af
88

99
## Inputs
1010

11-
<!-- BEGIN GENERATED: inputs-table (bun run build:action-docs; edit src/action/inputs.ts) -->
11+
<!-- BEGIN GENERATED: inputs-table (bun run build:action-docs; edit src/flows/inputs.ts) -->
1212
| Input | Default | Meaning |
1313
|---|---|---|
1414
| `token` | `github.token` | Token for the API calls (see [Token permissions](permissions.md)) |

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@octokit/plugin-throttling": "11.0.5",
3636
"age-encryption": "0.3.1",
3737
"bottleneck": "2.19.5",
38+
"neverthrow": "8.2.0",
3839
"yaml": "2.9.0",
3940
"zod": "4.5.4"
4041
},

0 commit comments

Comments
 (0)