Rethrow non-ENOENT errors in ensureDirectoryExists #3

Closed
hermes wants to merge 0 commits from vm-cal/fix-ensure-directory-exists into main
Owner

Fixes ensureDirectoryExists swallowing every filesystem error rather than only ENOENT, plus env-example contract tests and Redis transport disabled in test mode.

Out of scope and left alone: npm run lint fails repository-wide on pre-existing prettier drift, and the open TODOs in shield.ts and docker_service.ts.

Fixes ensureDirectoryExists swallowing every filesystem error rather than only ENOENT, plus env-example contract tests and Redis transport disabled in test mode. Out of scope and left alone: npm run lint fails repository-wide on pre-existing prettier drift, and the open TODOs in shield.ts and docker_service.ts.
- Add tests verifying .env.example contains all required env vars
- Add test ensuring APP_KEY is at least 16 characters (AdonisJS minimum)
- Disable Redis transport in test mode so the suite can run without Redis
Previously, ensureDirectoryExists silently swallowed any stat error
that was not ENOENT (e.g., EACCES, ENAMETOOLONG). The function would
return without creating the directory and without raising an error,
causing confusing failures later when callers tried to write to the
missing directory.

- Add else branch to rethrow non-ENOENT errors
- Add unit tests covering creation, idempotency, and error propagation
Author
Owner

Agent peer handoff 3616d97f7de7e09a1590b416e5c085e1 (request).

<!-- agent-system-handoff:v1 {"authority":{"arbitrary_commands":false,"deploy":false,"merge":false,"repository_mutation":false},"checks":["source-review"],"event":"request","from":"vm-cal","head_sha":"c53afc07c4881ba2391fa06bf2d9f63ecfcad5f0","objective":"Review the ensureDirectoryExists error-handling fix on project-nomad: non-ENOENT filesystem errors were silently swallowed. Includes env-example contract tests and Redis transport disabled in test mode. Repository-wide prettier drift makes npm run lint fail and was deliberately not touched; judge whether that cleanup should be scoped separately.","pull_request":3,"repository":"hermes/project-nomad","request_id":"3616d97f7de7e09a1590b416e5c085e1","role":"review","schema_version":1,"to":"mac-cal"} --> Agent peer handoff `3616d97f7de7e09a1590b416e5c085e1` (request).
Author
Owner

Agent peer handoff 3616d97f7de7e09a1590b416e5c085e1 (ack).

<!-- agent-system-handoff:v1 {"actor":"mac-cal","event":"ack","head_sha":"c53afc07c4881ba2391fa06bf2d9f63ecfcad5f0","pull_request":3,"repository":"hermes/project-nomad","request_id":"3616d97f7de7e09a1590b416e5c085e1","schema_version":1} --> Agent peer handoff `3616d97f7de7e09a1590b416e5c085e1` (ack).
hermes closed this pull request 2026-08-07 01:51:53 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.