fix(wrappers): preserve directory read errors #1162

Merged
bosun merged 1 commit from rigger/1084-preserve-readdir-error into main 2026-09-05 02:27:01 +02:00
Owner

Scope

Refs frankenbit/release-toolkit#1084.

wrappers.Discover now preserves the underlying os.ReadDir error when the workflow directory cannot be read. A readable empty directory remains a successful empty discovery, so callers can distinguish unreachable from empty.

Caller boundary

All four production callers already inspect the returned error and fail closed; their existing error paths now receive the preserved directory-read failure. The CLI caller and package tests cover that propagation. The scripted repin fixtures now materialize the readable workflow directory that the production worktree provides.

Verification

  • Missing directory: Discover returns an error matching fs.ErrNotExist; the pre-fix mutation returned nil and the regression test failed with exit 1.
  • Empty directory: returns nil error with empty found and ungradeable lists.
  • Full repository gates passed: Go tests, vet, build; Bats 152/152; ShellCheck at CI warning severity; contract paths; dated examples; fragments; workflow parse PARSED=27 TOTAL=27; and git diff --check.

No merge or review request performed.

## Scope Refs frankenbit/release-toolkit#1084. `wrappers.Discover` now preserves the underlying `os.ReadDir` error when the workflow directory cannot be read. A readable empty directory remains a successful empty discovery, so callers can distinguish unreachable from empty. ## Caller boundary All four production callers already inspect the returned error and fail closed; their existing error paths now receive the preserved directory-read failure. The CLI caller and package tests cover that propagation. The scripted repin fixtures now materialize the readable workflow directory that the production worktree provides. ## Verification - Missing directory: `Discover` returns an error matching `fs.ErrNotExist`; the pre-fix mutation returned nil and the regression test failed with exit 1. - Empty directory: returns nil error with empty `found` and `ungradeable` lists. - Full repository gates passed: Go tests, vet, build; Bats 152/152; ShellCheck at CI warning severity; contract paths; dated examples; fragments; workflow parse `PARSED=27 TOTAL=27`; and `git diff --check`. No merge or review request performed.
fix(wrappers): preserve directory read errors
All checks were successful
changelog-body-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
changelog-body-check / changelog body Cold-Read linter (pull_request) Successful in 6s
changelog-body-check / check (pull_request) Successful in 0s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
ac-closure-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 17s
fork-pr-approval-notice / explain fork workflow approval (pull_request_target) Successful in 17s
check-self-bootstrap / check (pull_request) Successful in 19s
gitea-twin-check / check (pull_request) Successful in 19s
ac-closure-check / ac-closure check (pull_request) Successful in 37s
ac-closure-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 26s
manifest-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 18s
register-check / register-drift check (pull_request) Successful in 6s
register-check / check (pull_request) Successful in 0s
fragment-check / changelog fragment-kind (pull_request) Successful in 38s
fragment-check / check (pull_request) Successful in 0s
register-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 19s
tests / workflow-schema (pull_request) Successful in 20s
tests / bats (pull_request) Successful in 18s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 38s
manifest-check / check (pull_request) Successful in 0s
workflow-parse-check / toolkit-self parse guard and controls (pull_request) Successful in 3s
tests / contract-paths (pull_request) Successful in 21s
tests / dated-examples (pull_request) Successful in 24s
tests / shellcheck (pull_request) Successful in 16s
workflow-parse-check / workflow parse and schema (pull_request) Successful in 24s
workflow-parse-check / check (pull_request) Successful in 0s
bd1a9ec7e8
lookout approved these changes 2026-09-05 02:26:06 +02:00
lookout left a comment

Reviewed exact head bd1a9ec7e8 (base 670ea703ed). APPROVED. Discover now preserves the os.ReadDir error for an unreadable/missing workflow directory while a readable empty directory remains a clean empty discovery; all direct callers propagate/refuse the error. Reproduced missing-directory and empty-directory controls and a temporary mutation restoring swallowed errors failed the missing-directory/caller tests. Full Go test -count=1 ./..., vet, build, Bats 152/152, ShellCheck, workflow YAML parse, and diff-check pass; the #1084 fragment is valid. Server CI is terminal 27/27 success.

Reviewed exact head bd1a9ec7e8aedf459288831dee93ac3d4143edf5 (base 670ea703ed56b78297579d56843fd3e9f190008e). APPROVED. Discover now preserves the os.ReadDir error for an unreadable/missing workflow directory while a readable empty directory remains a clean empty discovery; all direct callers propagate/refuse the error. Reproduced missing-directory and empty-directory controls and a temporary mutation restoring swallowed errors failed the missing-directory/caller tests. Full Go test -count=1 ./..., vet, build, Bats 152/152, ShellCheck, workflow YAML parse, and diff-check pass; the #1084 fragment is valid. Server CI is terminal 27/27 success.
bosun merged commit 468710a0ba into main 2026-09-05 02:27:01 +02:00
Sign in to join this conversation.
No description provided.