Skip to content

feat(config): unknown WALGIT__ overrides fail closed - #18

Closed
dumontg wants to merge 2 commits into
imports/11-zero-concurrencyfrom
imports/12-strict-env
Closed

dumontg wants to merge 2 commits into
imports/11-zero-concurrencyfrom
imports/12-strict-env

Conversation

@dumontg

@dumontg dumontg commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #17.

Imports tobi/walgit#100 by @jonasgrosch. An environment override that cannot apply (unknown key, malformed name, wrong type) is a startup error naming the variable, matching the TOML file, which already refuses unknown keys.

Conflicts: its decision keeps the number D50 (freed by the Azure layer); the example [store.s3] section combines its defaults with the credential chain notes from tobi#60.

Verified on the top of this stack: cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check, the crate test suites, and the Azure harness (just test-azure: store contract plus git push, clone, pull and cold restart on Azurite) pass. Known unrelated failures: the runtime stall timing tests in e2e (also intermittent on main) and the web UI asset tests that need pnpm run build.

jonasgrosch-conxai and others added 2 commits October 7, 2026 08:42
An environment override this build could not apply was dropped with a
WARN: `WALGIT__SERVER__LSITEN=0.0.0.0:8080` left the server on the default
127.0.0.1:8080, a wrong-typed value likewise ran the default. The file
itself already refuses unknown keys (`deny_unknown_fields`); the env path
now does the same.

A malformed name, an unknown section or key, or a value of the wrong type
is an error at startup and in `walgit config check`, naming every such
variable at once and, for an unknown key, the nearest known one:

  WALGIT__SERVER__LSITEN: unknown key `lsiten` in [server]; did you mean WALGIT__SERVER__LISTEN?

Nothing of a refused batch is applied. The nearest key comes from serde's
own `expected one of` list (Levenshtein over the siblings, no new
dependency).

No escape hatch. The warn-and-ignore loader existed for config/image skew
(2026-08-21: a host on an older image crash-looped on a newer key), not
for foreign variables sharing the prefix — nothing in the tree sets a
non-config `WALGIT__*` name. That case is answered by ordering (image
before the env that needs it) and by `config check --env-file` run by the
binary that will serve; `--strict` and `apply_env_report` are removed, as
the check is now always strict. Recorded as D50. walgit-config no longer
uses tracing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1eca457)
walgit.example.toml documents "every key with its default", but its
[store.s3] block showed AWS values: `force_path_style = false` and an AWS
endpoint, while `S3Config::default()` is `force_path_style = true` with
`endpoint = "http://127.0.0.1:9000"`.

The code is right: the flag goes straight to aws-sdk-s3, and the default
endpoint is the local rustfs/MinIO rig, which needs path-style addressing
(s3.rs notes it as required for rustfs; virtual-hosted would address
`bucket.host`). So the example follows the code, and says when to set
false (AWS, virtual-hosted addressing). `example_configurations_parse_
and_validate` now pins the example's [store.s3] to the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ee5f506)
@dumontg

dumontg commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Landed on main in 8347913 (merge of the stack top 59b206f), so this PR's changes are on main.

@dumontg dumontg closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants