Core: report unreadable implicit configuration files #1796

Open
github-bot wants to merge 1 commit from github-bot/gh-1796 into main AGit
Owner

@⁠VlREX on GitHub · 2026-11-24 22:45 UTC · original
VlREX:fix/config-read-errors → main · +50 −12 · 1 files · 1 commits · open

No description provided.

**@⁠VlREX** on GitHub · 2026-11-24 22:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1796) `VlREX:fix/config-read-errors` → `main` · +50 −12 · 1 files · 1 commits · open *No description provided.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:51 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:36 UTC · original · edited 2026-11-25 15:24 UTC

Automated triage for the maintainers.

Merge candidate (worth a look). Now that it merges cleanly: in victory-core/src/config.rs, Config::load used to check path.is_file() first, so an implicit ./victory.toml that exists but can't be read (a directory, permission denied) was silently ignored, and a directory named by VICTORY_CONFIG was reported as "does not exist". The new read_config_file treats only NotFound on the implicit path as optional and reports every other read error with the path; an explicit path keeps failing, now with the OS error. I checked that tempfile is already a dev-dependency of victory-core, that the downcast in the UTF-8 test works through anyhow's context, and that main's later explicit_config_path handling is kept. CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/1796#issuecomment-7149742535) · edited 2026-11-25 15:24 UTC <!-- victory-triage v1 head=200dc3205557a691a251132b313168e29193aede verdict=merge-candidate at=2026-11-25T15:33:00Z --> Automated triage for the maintainers. **Merge candidate (worth a look).** Now that it merges cleanly: in `victory-core/src/config.rs`, `Config::load` used to check `path.is_file()` first, so an implicit `./victory.toml` that exists but can't be read (a directory, permission denied) was silently ignored, and a directory named by `VICTORY_CONFIG` was reported as "does not exist". The new `read_config_file` treats only `NotFound` on the implicit path as optional and reports every other read error with the path; an explicit path keeps failing, now with the OS error. I checked that `tempfile` is already a dev-dependency of `victory-core`, that the downcast in the UTF-8 test works through anyhow's context, and that `main`'s later `explicit_config_path` handling is kept. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠oddmaniv on GitHub · 2026-11-25 08:14 UTC · original

Independent native Windows verification of this PR at 5edb19078fa0df07bb178bb97323630dac679afe, plus separately recorded integration results:

Original PR head

  • Clean, production-unmodified checkout: cargo test --locked -p victory-core passed 13 tests. Workspace Clippy with all targets passed both default and all-features configurations, warnings denied; asset policy passed.
  • A separate checkout at the same head added only synthetic integration-test instrumentation. Four public Config::load() entry-point cases passed: a directory at implicit victory.toml produces a read error; a missing implicit file remains optional; a missing explicit file errors; and a valid implicit file loads. Each case ran in an isolated child process through cargo test --locked -p victory-core --test config_implicit <case> -- --exact --nocapture. Production files were unchanged, and the tested fixture bytes matched the local fixture.

Historical main-based integration, not a claim about today's main

  • Main base: 4118f33b3910f6b6b738216d6a66e8b355502b28; originating PR head: 5edb19078fa0df07bb178bb97323630dac679afe.
  • Without the PR adaptation, the same entry-point suite produced 3 passes and 1 failure: the implicit-directory case.
  • With the adaptation, all 4 entry-point tests and 15 core unit tests passed. Both workspace Clippy configurations, changed-file formatting and asset policy passed.
  • The adaptation retained main's newer explicit_config_path() handling while applying the author's configuration-read change. It was a separate local integration tree, not an edit to the author's branch; it does not replace testing the original PR head. No additional production fix is being claimed.

The main-integration evidence was collected earlier; the original-head checks above were subsequently added to close that verification gap. No full workspace test suite, game or GPU execution was performed. These results cover the synthetic cases listed, not all filesystem error conditions or gameplay behavior.

Credit to @⁠VlREX for the production change. AI assistance was used for the additional test instrumentation and verification.

**@⁠oddmaniv** on GitHub · 2026-11-25 08:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/1796#issuecomment-7156780597) Independent native Windows verification of this PR at `5edb19078fa0df07bb178bb97323630dac679afe`, plus separately recorded integration results: **Original PR head** - Clean, production-unmodified checkout: `cargo test --locked -p victory-core` passed 13 tests. Workspace Clippy with all targets passed both default and all-features configurations, warnings denied; asset policy passed. - A separate checkout at the same head added only synthetic integration-test instrumentation. Four public `Config::load()` entry-point cases passed: a directory at implicit `victory.toml` produces a read error; a missing implicit file remains optional; a missing explicit file errors; and a valid implicit file loads. Each case ran in an isolated child process through `cargo test --locked -p victory-core --test config_implicit <case> -- --exact --nocapture`. Production files were unchanged, and the tested fixture bytes matched the local fixture. **Historical main-based integration, not a claim about today's main** - Main base: `4118f33b3910f6b6b738216d6a66e8b355502b28`; originating PR head: `5edb19078fa0df07bb178bb97323630dac679afe`. - Without the PR adaptation, the same entry-point suite produced 3 passes and 1 failure: the implicit-directory case. - With the adaptation, all 4 entry-point tests and 15 core unit tests passed. Both workspace Clippy configurations, changed-file formatting and asset policy passed. - The adaptation retained main's newer `explicit_config_path()` handling while applying the author's configuration-read change. It was a separate local integration tree, not an edit to the author's branch; it does not replace testing the original PR head. No additional production fix is being claimed. The main-integration evidence was collected earlier; the original-head checks above were subsequently added to close that verification gap. No full workspace test suite, game or GPU execution was performed. These results cover the synthetic cases listed, not all filesystem error conditions or gameplay behavior. Credit to @⁠VlREX for the production change. AI assistance was used for the additional test instrumentation and verification.
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 23:05 UTC · original · approved these changes

Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae).

cargo test -p victory-core --locked → 13 passed, 0 failed. read_config_file distinguishes missing-implicit (optional) from missing-explicit (required) config — missing_implicit_config_is_optional_but_explicit_is_required covers both.

**@⁠catminou4** on GitHub · 2026-11-24 23:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/1796#pullrequestreview-6048826107) · **approved these changes** Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae). cargo test -p victory-core --locked → 13 passed, 0 failed. read_config_file distinguishes missing-implicit (optional) from missing-explicit (required) config — missing_implicit_config_is_optional_but_explicit_is_required covers both.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 18:47 UTC · original · approved these changes

Verified 200dc3205557a691a251132b313168e29193aede cleanly merged onto main (63bcca43) on Windows 11 x64:

  • read_config_file (crates/victory-core/src/config.rs:125-133) preserves main's explicit_config_path() handling, ignores only ErrorKind::NotFound on the implicit path, and surfaces unreadable paths, directory paths, invalid UTF-8, and missing explicit VICTORY_CONFIG files with path context.
  • cargo test -p xtask --locked policy::tests::repository_passes_policy: 1 passed (asset policy: 191 files ok).
  • cargo clippy --locked -p victory-core --all-targets -- -D warnings: clean.
  • cargo test --locked -p victory-core --lib: 16 passed, 0 failed (including all three new config::tests cases).

Minor formatting nit: rustfmt --edition 2024 --check crates/victory-core/src/config.rs flags wrapping on config.rs:129-130. Ready to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 18:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/1796#pullrequestreview-6079150462) · **approved these changes** Verified `200dc3205557a691a251132b313168e29193aede` cleanly merged onto `main` (`63bcca43`) on Windows 11 x64: - `read_config_file` (`crates/victory-core/src/config.rs:125-133`) preserves `main`'s `explicit_config_path()` handling, ignores only `ErrorKind::NotFound` on the implicit path, and surfaces unreadable paths, directory paths, invalid UTF-8, and missing explicit `VICTORY_CONFIG` files with path context. - `cargo test -p xtask --locked policy::tests::repository_passes_policy`: `1 passed` (`asset policy: 191 files ok`). - `cargo clippy --locked -p victory-core --all-targets -- -D warnings`: clean. - `cargo test --locked -p victory-core --lib`: `16 passed, 0 failed` (including all three new `config::tests` cases). Minor formatting nit: `rustfmt --edition 2024 --check crates/victory-core/src/config.rs` flags wrapping on `config.rs:129-130`. Ready to merge.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1796/head:github-bot/gh-1796'
git switch 'github-bot/gh-1796'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1796'
git switch 'github-bot/gh-1796'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1796'
git switch 'github-bot/gh-1796'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1796'
git switch 'main'
git merge --squash 'github-bot/gh-1796'
git switch 'main'
git merge --ff-only 'github-bot/gh-1796'
git switch 'main'
git merge 'github-bot/gh-1796'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1796
No description provided.