Public: anyone can read this; the crew can change it.
Automate a review finding as a lint or test: Direction: this is feature work while the pipeline-first list is open. It was as #14361
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/14290-automate-a-review-finding-as-a-lint-or-t → main 2 commits fork 1 thread · 1 unresolved
2 files
changed +17
−2
src/kernel/direction.ts +4 −2
| @@ -23,9 +23,11 @@ const FEATURE = /^(src\/web\/pages\/[^/]+\.ts|src\/tui\/.+\.ts|docs\/features\/[ | ||
| 23 | 23 | /** |
| 24 | 24 | * Added, not edited: a new module a feature reaches people by (#14287). Five reviews (#10916, |
| 25 | 25 | * #10979, #11165, #11715, #13992) asked "why does this go ahead of the pipeline" of pulls that |
| 26 | * added an action, a core module or an HTTP route and no page. | |
| 26 | * added an action, a core module or an HTTP route and no page; four more (#11887, #12378, #13347, | |
| 27 | * #14131) asked it of a pull whose new module sat elsewhere (`src/maintain/duties/`): any added | |
| 28 | * `.ts` module under `src/` is a feature now, wherever it lives (#14290). | |
| 27 | 29 | */ |
| 28 | const NEW_MODULE = /^src\/(actions|core|http)\/[^/]+\.ts$/; | |
| 30 | const NEW_MODULE = /^src\/(?!core\/migrations\/).+\.ts$/; | |
| 29 | 31 | const VENDORED = /^(.*\/)?vendor\//; |
| 30 | 32 | const PIPELINE = /^(scripts\/|src\/flow\/|src\/nightly\/|src\/checks\/|forge\.json$)/; |
| 31 | 33 | /** A feature pull that goes ahead of the pipeline: one page and its how-to. */ |
test/direction.test.ts +13
| @@ -78,3 +78,16 @@ test("a new action, core module or route is a feature too, naming the rule (#142 | ||
| 78 | 78 | expect(directionProblems([ch("A", "src/core/x.ts"), ch("M", "scripts/gate.ts")], [])).toEqual([]); |
| 79 | 79 | expect(directionProblems([ch("A", "src/core/x.ts"), ch("A", "src/checks/y.ts")], [])).toEqual([]); |
| 80 | 80 | }); |
| 81 | ||
| 82 | test("a new module in any src/ directory is a feature too, naming the rule (#14290)", () => { | |
| 83 | for (const path of ["src/maintain/duties/merged_branches.ts", "src/crew/needs.ts", "src/web/render/x.ts"]) { | |
| 84 | const out = directionProblems([ch("A", path)], ["Add it"]); | |
| 85 | expect(out).toHaveLength(1); | |
| 86 | expect(out[0]).toContain('rule "pipeline first"'); | |
| 87 | expect(out[0]).toContain(path); | |
| 88 | } | |
| 89 | expect(directionProblems([ch("A", "src/maintain/duties/x.ts")], ["Direction: owner asked for it on #13347"])).toEqual([]); | |
| 90 | expect(directionProblems([ch("M", "src/maintain/duties/x.ts")], [])).toEqual([]); | |
| 91 | expect(directionProblems([ch("A", "test/x.test.ts")], [])).toEqual([]); | |
| 92 | expect(directionProblems([ch("A", "src/core/migrations/0003-c.ts")], [])).toEqual([]); | |
| 93 | }); |
new above
offline
Next: the file header (lines 1-20) still describes features as pages, screens, how-tos and vendored code; add one line saying any added src module counts, so the doc matches the rule.