victory config: exit nonzero on an asset-policy violation (port of upstream #1830) #1324

Closed
CwWwWwW wants to merge 1 commit from upstream-pr/1327 into main
CwWwWwW commented 2026-11-26 15:33:46 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-26T15:33:46Z.


Problem

victory config prints POLICY VIOLATION: ... for each configured path the asset policy refuses (a game_dir, test title, cache_dir or data_dir inside the repository), but still returns Ok(()) and exits 0. A script or user checking the configuration cannot tell the asset policy was violated, although the repository requires those paths to stay outside it (nothing from the game may be committed).

Upstream VIctory fixed this in commit 834d643 (pull request #1830, by Ingenioer); this is that fix ported to the fork.

Change

  • The policy loop moves into check_policy(cfg), counts violations, and returns an error (anyhow ensure) naming the count when there is one.
  • show_config ends with check_policy(&cfg), so victory config exits nonzero for a violated policy, like every other failed command.
  • Same output lines as before for violations; no other command changed.

Tests

  • New config_check_passes_paths_outside_the_repository and config_check_fails_a_path_inside_the_repository (a game_dir under CARGO_MANIFEST_DIR).
  • cargo test -p victory --locked: 3 passed, 0 failed.
  • cargo clippy -p victory --all-targets --locked -- -D warnings: clean.
  • No game or GPU needed.

(CI note: the check job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)

<!-- greyfinch-sync:fxceless/victory-fork:issue:6630007643 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1327). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-26T15:33:46Z. --- ## Problem victory config prints POLICY VIOLATION: ... for each configured path the asset policy refuses (a game_dir, test title, cache_dir or data_dir inside the repository), but still returns Ok(()) and exits 0. A script or user checking the configuration cannot tell the asset policy was violated, although the repository requires those paths to stay outside it (nothing from the game may be committed). Upstream VIctory fixed this in commit 834d643 (pull request #1830, by Ingenioer); this is that fix ported to the fork. ## Change - The policy loop moves into check_policy(cfg), counts violations, and returns an error (anyhow ensure) naming the count when there is one. - show_config ends with check_policy(&cfg), so victory config exits nonzero for a violated policy, like every other failed command. - Same output lines as before for violations; no other command changed. ## Tests - New config_check_passes_paths_outside_the_repository and config_check_fails_a_path_inside_the_repository (a game_dir under CARGO_MANIFEST_DIR). - cargo test -p victory --locked: 3 passed, 0 failed. - cargo clippy -p victory --all-targets --locked -- -D warnings: clean. - No game or GPU needed. (CI note: the check job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)
upstream-sync closed this pull request 2026-11-26 16:06:34 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!1324
No description provided.