256: Wire MR-skip outcome into runPipeline #263
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-256/wire-mr-skip-outcome-into-runpipeline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
256: Wire MR-skip outcome into runPipeline
Implements 256.
Generated in 28m 50s.
Review findings
Now let's add a test for the defensive throw branch (Low finding #2).Now I'll add a test for the defensive throw path (mrOutcome.skipped true but mr-skipped.json not written).Now let's check whether
runPipelineactually throws synchronously (unhandled) or catches errors elsewhere - need to verify this test's expectation matches actual behavior.The whole body is wrapped in try/catch that converts thrown errors intook: falseresults — it doesn't propagate. Let me fix the test.So the thrown error gets classified asagent-failurefor stagemrand returned asok: false. Let me fix the test accordingly.Now let's run tests, build, and lint.All 80 tests pass, including the new one. Now let's run full build, test, and lint.Build passes cleanly.All 141 files, 1970 tests pass.All gates pass: build, 1970 tests, and lint are clean. Both Low findings resolved.Both findings addressed. Here is the annotated findings document.Review Findings — 256
Summary
Fixed both Low findings: replaced the
readMrSkippedSignal(runDir) ?? (() => { throw ... })()IIFE with a plainif (artifact === undefined) { throw ... }guard for readability, matching the style used elsewhere in the function; and added a unit test (runPipeline.test.ts) that exercises the defensive throw path by simulating arunMrfake that returnsskipped: truewithout writingmr-skipped.json, asserting the run surfaces anagent-failurefor stagemrwith the expected message. Build (npm run build), full test suite (npm test, 141 files / 1970 tests), and lint (npm run lint) all pass cleanly after the changes.Critical
High
Medium
Low
readMrSkippedSignal(runDir) ?? (() => { throw ... })()IIFE-in-??pattern is a somewhat unusual/harder-to-scan way to assert non-null compared to a plainif (artifact === undefined) { throw ... }guard used elsewhere in the same function (e.g. thepersistedMrResultpath a few lines below just callsreadMrResultdirectly and lets it throw naturally). Suggested fix: replace with a straightforwardif (artifact === undefined) { throw new Error(...); }for readability, or add a one-line comment noting the branch is defensive/unreachable in practice (sincerunMrStagealways writes the artifact before returningskipped: true).runMrthat returnsskipped: truewithout actually writingmr-skipped.json). Suggested fix: optionally add a small test asserting the thrown-error message/behavior for completeness, or note in a comment that it's intentionally untested defensive code.