anishshiva7 opened a new pull request, #9663:
URL: https://github.com/apache/texera/pull/9663
### What changes were proposed in this PR?
**Root cause:** `LOG_PRETTY` was parsed with `z.coerce.boolean()`, which is
`Boolean(value)`. Any non-empty string, `"false"` and `"0"` included, read as
`true`.
```
Before: LOG_PRETTY=false -> pretty LOG_PRETTY=0 -> pretty
LOG_PRETTY=yes -> pretty
After: LOG_PRETTY=false -> JSON LOG_PRETTY=0 -> JSON
LOG_PRETTY=yes -> startup error
```
| Value (trimmed, any case) | Result |
| --- | --- |
| unset or empty | `false` (unchanged default) |
| `true`, `1` | `true` |
| `false`, `0` | `false` |
| anything else | `EnvSchema.parse` throws, like the schema's other invalid
settings |
`EnvSchema` is now exported so the parsing can be tested without reloading
the module.
### Any related issues, documentation, discussions?
Closes #9660.
### How was this PR tested?
New `src/config/env.spec.ts`. Before the fix, 8 of its 15 cases failed
(every `false`/`0` spelling and every invalid value); all pass now. It covers
unset, empty, case and whitespace variants, values that must be rejected, and
the defaults of an empty environment. The existing `logger.spec.ts` still
passes.
```
cd agent-service
bun test # 362 pass, 0 fail
bunx tsc --noEmit
bunx prettier --check "src/**/*.{ts,tsx,json}"
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]