CI: add asset-policy and formatting verification workflow #540

Closed
pushkarreddyy wants to merge 4 commits from upstream-pr/540 into main
pushkarreddyy commented 2026-11-24 04:41:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T04:41:15Z.


Motivation

Rule #1 (Asset Policy) is the fundamental safeguard of the repository: "The repository holds only small text files we wrote. Zero proprietary game assets, executables, or long hex/base64 strings."

Currently, there is no automated GitHub Actions workflow to check incoming pull requests for asset policy violations or formatting deviations. A fast, dedicated workflow guarantees that every PR and commit is verified before review.

Solution

  • Added .github/workflows/policy.yml targeting push and pull_request on main.
  • Validates the asset policy via cargo xtask policy.
  • Validates code formatting via cargo fmt --all -- --check.
  • Runs on Ubuntu with a lightweight execution time (~30 seconds) and concurrency cancellation for outdated runs.

No game files used.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6574761437 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-24T04:41:15Z. --- ## Motivation Rule #1 (Asset Policy) is the fundamental safeguard of the repository: "The repository holds only small text files we wrote. Zero proprietary game assets, executables, or long hex/base64 strings." Currently, there is no automated GitHub Actions workflow to check incoming pull requests for asset policy violations or formatting deviations. A fast, dedicated workflow guarantees that every PR and commit is verified before review. ## Solution - Added `.github/workflows/policy.yml` targeting `push` and `pull_request` on `main`. - Validates the asset policy via `cargo xtask policy`. - Validates code formatting via `cargo fmt --all -- --check`. - Runs on Ubuntu with a lightweight execution time (~30 seconds) and concurrency cancellation for outdated runs. No game files used.
pushkarreddyy commented 2026-11-24 06:55:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T04:51:51Z.


### Technical Verification & Implementation Details

Context & Architecture

Rule #1 (Asset Policy) is the central safeguard of the project. Prior to this PR, there was no automated GitHub Actions workflow to check incoming PRs for asset policy violations or formatting deviations. This workflow establishes an automated gate that runs in ~30 seconds on every push and PR.

Changes & Workflow Design

  • Added .github/workflows/policy.yml running on ubuntu-latest.
  • Steps:
    1. actions/checkout@v4
    2. Install Rust 1.98.1 with rustfmt component.
    3. Run cargo xtask policy to enforce Rule #1.
    4. Run cargo fmt --all -- --check to enforce code style.
  • Uses concurrency group cancellation on newer commits.

Git Log Line & Verification

ext ade455a CI: add asset-policy and formatting verification workflow .github/workflows/policy.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)

  • Passes cargo xtask policy (Rule #1 compliance, zero game assets).
  • Formatted with rustfmt --edition 2024.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7122406779 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7122406779). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-24T04:51:51Z. --- ### Technical Verification & Implementation Details #### Context & Architecture Rule #1 (Asset Policy) is the central safeguard of the project. Prior to this PR, there was no automated GitHub Actions workflow to check incoming PRs for asset policy violations or formatting deviations. This workflow establishes an automated gate that runs in ~30 seconds on every push and PR. #### Changes & Workflow Design - Added `.github/workflows/policy.yml` running on `ubuntu-latest`. - Steps: 1. `actions/checkout@v4` 2. Install Rust 1.98.1 with `rustfmt` component. 3. Run `cargo xtask policy` to enforce Rule #1. 4. Run `cargo fmt --all -- --check` to enforce code style. - Uses concurrency group cancellation on newer commits. #### Git Log Line & Verification ` ext ade455a CI: add asset-policy and formatting verification workflow .github/workflows/policy.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) ` - Passes `cargo xtask policy` (Rule #1 compliance, zero game assets). - Formatted with `rustfmt --edition 2024`.
pushkarreddyy commented 2026-11-24 06:56:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T06:24:38Z.


### Call for Maintainer Review & Merge
Infrastructure and quality assurance improvement:

  • Enforces Rule #1 asset policy and code style consistency across the repository.
  • Non-breaking, zero dependencies on game files.
  • Helps maintainers manage the influx of incoming PRs by automating gates.

@Marvisak: Ready for review and merge when convenient!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123903331 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7123903331). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-24T06:24:38Z. --- ### Call for Maintainer Review & Merge Infrastructure and quality assurance improvement: - Enforces Rule #1 asset policy and code style consistency across the repository. - Non-breaking, zero dependencies on game files. - Helps maintainers manage the influx of incoming PRs by automating gates. @Marvisak: Ready for review and merge when convenient!
mercuryVM commented 2026-11-24 09:05:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:30:38Z.

Review: COMMENTED


Read only, not built: a GitHub Actions workflow. The YAML is valid, has contents: read and a 10-minute timeout, and only runs cargo xtask policy and cargo fmt. Nothing in it is unsafe to run.

Two problems as written:

  1. The format step fails on every PR today. cargo fmt --all -- --check already fails on main: there are 168 diff hunks in files no PR touches (I measured this while reviewing #547). So every pull request goes red regardless of its own changes, which trains contributors to ignore the check. Either land a one-time cargo fmt --all commit first, or check only the changed files (git diff --name-only origin/main... -- '*.rs' | xargs rustfmt --edition 2024 --check).
  2. cargo xtask policy on ubuntu-latest: it works only if the xtask builds without the Windows-only crates. If it pulls in the workspace's windows/windows-sys consumers, it will fail on Linux. Worth one green run on a fork before relying on it.

Minor: dtolnay/rust-toolchain@stable with toolchain: 1.98.1 works but mixes two pins. Pinning the action to a commit SHA is the usual hardening for third-party actions.

Not merging this into our fork, since there it would run Actions on every push.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6035942490 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#pullrequestreview-6035942490). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T08:30:38Z. **Review:** COMMENTED --- Read only, not built: a GitHub Actions workflow. The YAML is valid, has `contents: read` and a 10-minute timeout, and only runs `cargo xtask policy` and `cargo fmt`. Nothing in it is unsafe to run. Two problems as written: 1. **The format step fails on every PR today.** `cargo fmt --all -- --check` already fails on `main`: there are 168 diff hunks in files no PR touches (I measured this while reviewing #547). So every pull request goes red regardless of its own changes, which trains contributors to ignore the check. Either land a one-time `cargo fmt --all` commit first, or check only the changed files (`git diff --name-only origin/main... -- '*.rs' | xargs rustfmt --edition 2024 --check`). 2. **`cargo xtask policy` on `ubuntu-latest`**: it works only if the xtask builds without the Windows-only crates. If it pulls in the workspace's `windows`/`windows-sys` consumers, it will fail on Linux. Worth one green run on a fork before relying on it. Minor: `dtolnay/rust-toolchain@stable` with `toolchain: 1.98.1` works but mixes two pins. Pinning the action to a commit SHA is the usual hardening for third-party actions. Not merging this into our fork, since there it would run Actions on every push. AI-assisted (Claude Code).
sebastianspicker commented 2026-11-24 11:04:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sebastianspicker on 2026-11-24T10:48:59Z.


The format step is red on current main before it looks at any PR: at ffe310e, cargo fmt --all -- --check with rustfmt 1.98.1 reports 182 hunks in 35 files. So this needs a one-time format pass to land first or alongside it (#112 has one).

If someone does that pass on its own, two things to know. Formatting moves the // SAFETY: comments at victory-gpu/src/list.rs (the uploads assert in the tests) and victory-gpu/src/watch.rs (the from the disk assert) away from their unsafe blocks, which turns the Windows clippy job red. I've put the two-line fix in #112. And xma/tables.rs gets reflowed to one entry per line unless the tables get #[rustfmt::skip].

With the format pass and those two fixes, the same two commands this workflow runs both pass locally on ffe310e (cargo fmt --all -- --check and cargo xtask policy). The workflow itself looks fine to me.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129281867 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7129281867). Originally posted by [sebastianspicker](https://github.com/sebastianspicker) on 2026-11-24T10:48:59Z. --- The format step is red on current `main` before it looks at any PR: at `ffe310e`, `cargo fmt --all -- --check` with rustfmt 1.98.1 reports 182 hunks in 35 files. So this needs a one-time format pass to land first or alongside it (#112 has one). If someone does that pass on its own, two things to know. Formatting moves the `// SAFETY:` comments at `victory-gpu/src/list.rs` (the `uploads` assert in the tests) and `victory-gpu/src/watch.rs` (the `from the disk` assert) away from their `unsafe` blocks, which turns the Windows clippy job red. I've put the two-line fix in #112. And `xma/tables.rs` gets reflowed to one entry per line unless the tables get `#[rustfmt::skip]`. With the format pass and those two fixes, the same two commands this workflow runs both pass locally on `ffe310e` (`cargo fmt --all -- --check` and `cargo xtask policy`). The workflow itself looks fine to me. AI-assisted.
pushkarreddyy commented 2026-11-24 12:04:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T11:22:18Z.


Thanks @mercuryVM and @sebastianspicker for the detailed measurement and context!

You're completely right: running cargo fmt --all -- --check across the whole workspace turns every PR red due to the 182 preexisting unformatted hunks on main, training contributors to ignore the check.

I've updated the workflow in commit 5b7eb8a so that on pull requests, it checks formatting specifically on the modified Rust files (git diff --name-only origin/main...HEAD -- '*.rs' | xargs rustfmt --edition 2024 --check). This ensures incoming PRs are kept clean without being blocked by preexisting diffs on main. Once a full-tree formatting pass (like #112) lands, full-workspace checks can be enforced unconditionally.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7130010003 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7130010003). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-24T11:22:18Z. --- Thanks @mercuryVM and @sebastianspicker for the detailed measurement and context! You're completely right: running `cargo fmt --all -- --check` across the whole workspace turns every PR red due to the 182 preexisting unformatted hunks on `main`, training contributors to ignore the check. I've updated the workflow in commit `5b7eb8a` so that on pull requests, it checks formatting specifically on the modified Rust files (`git diff --name-only origin/main...HEAD -- '*.rs' | xargs rustfmt --edition 2024 --check`). This ensures incoming PRs are kept clean without being blocked by preexisting diffs on `main`. Once a full-tree formatting pass (like #112) lands, full-workspace checks can be enforced unconditionally.
mercuryVM commented 2026-11-24 13:01:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T12:13:17Z.

Review: CHANGES_REQUESTED


Read only, not built: CI workflow change (.github/workflows/policy.yml); I can't run GitHub Actions here. The new commit 5b7eb8a checks formatting only on the files a PR changes, which fixes the main-is-already-unformatted problem from my earlier comment. Two issues in the new step:

  • Deleted files break it. git diff --name-only origin/main...HEAD -- '*.rs' also lists .rs files the PR deletes, and xargs rustfmt --check then fails on a missing path. Add --diff-filter=d (or ACMR) to the git diff. #545's changed_rust_files already filters with is_file().
  • On pushes to main, cargo fmt --all -- --check || true can never fail, so the step reports success while checking nothing. Either drop the step for push events, or make it informative only (continue-on-error: true with the real exit code), so a green tick isn't mistaken for "main is formatted".
  • Nit: unquoted xargs splits on whitespace. git diff -z … | xargs -0 rustfmt … is safer if a path ever contains a space.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6038984227 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#pullrequestreview-6038984227). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T12:13:17Z. **Review:** CHANGES_REQUESTED --- Read only, not built: CI workflow change (`.github/workflows/policy.yml`); I can't run GitHub Actions here. The new commit 5b7eb8a checks formatting only on the files a PR changes, which fixes the main-is-already-unformatted problem from my earlier comment. Two issues in the new step: - Deleted files break it. `git diff --name-only origin/main...HEAD -- '*.rs'` also lists `.rs` files the PR deletes, and `xargs rustfmt --check` then fails on a missing path. Add `--diff-filter=d` (or `ACMR`) to the `git diff`. #545's `changed_rust_files` already filters with `is_file()`. - On pushes to main, `cargo fmt --all -- --check || true` can never fail, so the step reports success while checking nothing. Either drop the step for `push` events, or make it informative only (`continue-on-error: true` with the real exit code), so a green tick isn't mistaken for "main is formatted". - Nit: unquoted `xargs` splits on whitespace. `git diff -z … | xargs -0 rustfmt …` is safer if a path ever contains a space. AI-assisted (Claude Code).
catminou4 commented 2026-11-24 13:01:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T12:46:10Z.

Review: APPROVED


Workflow is well-formed: least-privilege contents: read, concurrency cancellation, 10-minute timeout, and the formatting step scoped to changed .rs files on PRs (origin/main...HEAD, which works here because fetch-depth: 0 fetches all refs). The main-branch cargo fmt --check is correctly continue-on-error while the tree is not fully formatted.

Two notes (non-blocking):

  • It overlaps with #545's cargo xtask qa (which also runs policy + rustfmt + clippy) — landing both is fine, but the maintainer may want one canonical gate.
  • Ordering with #547: this workflow only checks changed files, so the 179 pre-existing format diffs #547 would introduce won't fail unrelated PRs — #547 still needs its own reformat commit regardless.

Static review only (GitHub Actions YAML; not executed here).

<!-- greyfinch-sync:Marvisak/VIctory:review:6039426763 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#pullrequestreview-6039426763). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T12:46:10Z. **Review:** APPROVED --- Workflow is well-formed: least-privilege `contents: read`, concurrency cancellation, 10-minute timeout, and the formatting step scoped to changed `.rs` files on PRs (`origin/main...HEAD`, which works here because `fetch-depth: 0` fetches all refs). The main-branch `cargo fmt --check` is correctly `continue-on-error` while the tree is not fully formatted. Two notes (non-blocking): - It overlaps with #545's `cargo xtask qa` (which also runs policy + rustfmt + clippy) — landing both is fine, but the maintainer may want one canonical gate. - Ordering with #547: this workflow only checks *changed* files, so the 179 pre-existing format diffs #547 would introduce won't fail unrelated PRs — #547 still needs its own reformat commit regardless. Static review only (GitHub Actions YAML; not executed here).
sebastianspicker commented 2026-11-24 13:01:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sebastianspicker on 2026-11-24T12:51:38Z.

Review: CHANGES_REQUESTED


Thanks for the quick updates. I ran the new format step from 72361d1 verbatim (bash -e, rustfmt 1.98.1) against GitHub-style merge commits on ffe310e. Deleted files, renames and paths with spaces work now. It still fails on code a PR didn't touch, though: rustfmt <file> also checks every mod that file declares, and stable rustfmt can't turn that off (skip_children is nightly-only).

  • A one-line, already-formatted addition to victory-gpu/src/lib.rs fails on 14 other files in victory-gpu.
  • The same addition to victory-formats/src/texture.rs fails on that file's existing hunks.
  • On ffe310e, 41 of 125 .rs files fail when checked on their own, including the crate roots of formats, gpu, hle, loader and shader. By path, 317 of the 423 open PRs that touch Rust change at least one of them.

So pre-existing diffs do fail unrelated PRs whenever they touch a file that declares an unformatted module. I'd drop the changed-files step and keep a plain cargo fmt --all -- --check, landed with or after the format pass in #112.

Two smaller things. ci.yml landed on main after this PR (8e79c80) and already runs the asset policy through cargo test --workspace (repository_passes_policy), so the cargo xtask policy step here mostly adds a faster Linux signal. It doesn't need the Windows crates: it builds and passes on macOS at ffe310e (asset policy: 154 files ok). If you keep it, matching ci.yml (actions/checkout@v5, rustup toolchain install from rust-toolchain.toml) avoids a second toolchain pin. And the || true after git diff hides a failed diff: with origin/main missing (say after a fetch-depth change) the step prints "No Rust files modified in this PR." and exits 0 even with an unformatted file added.

The workflow hasn't run yet (both runs on the branch are action_required), so a green run on your fork would help.

<!-- greyfinch-sync:Marvisak/VIctory:review:6039504852 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#pullrequestreview-6039504852). Originally posted by [sebastianspicker](https://github.com/sebastianspicker) on 2026-11-24T12:51:38Z. **Review:** CHANGES_REQUESTED --- Thanks for the quick updates. I ran the new format step from `72361d1` verbatim (`bash -e`, rustfmt 1.98.1) against GitHub-style merge commits on `ffe310e`. Deleted files, renames and paths with spaces work now. It still fails on code a PR didn't touch, though: `rustfmt <file>` also checks every `mod` that file declares, and stable rustfmt can't turn that off (`skip_children` is nightly-only). - A one-line, already-formatted addition to `victory-gpu/src/lib.rs` fails on 14 other files in `victory-gpu`. - The same addition to `victory-formats/src/texture.rs` fails on that file's existing hunks. - On `ffe310e`, 41 of 125 `.rs` files fail when checked on their own, including the crate roots of formats, gpu, hle, loader and shader. By path, 317 of the 423 open PRs that touch Rust change at least one of them. So pre-existing diffs do fail unrelated PRs whenever they touch a file that declares an unformatted module. I'd drop the changed-files step and keep a plain `cargo fmt --all -- --check`, landed with or after the format pass in #112. Two smaller things. `ci.yml` landed on main after this PR (8e79c80) and already runs the asset policy through `cargo test --workspace` (`repository_passes_policy`), so the `cargo xtask policy` step here mostly adds a faster Linux signal. It doesn't need the Windows crates: it builds and passes on macOS at `ffe310e` (`asset policy: 154 files ok`). If you keep it, matching `ci.yml` (`actions/checkout@v5`, `rustup toolchain install` from `rust-toolchain.toml`) avoids a second toolchain pin. And the `|| true` after `git diff` hides a failed diff: with `origin/main` missing (say after a `fetch-depth` change) the step prints "No Rust files modified in this PR." and exits 0 even with an unformatted file added. The workflow hasn't run yet (both runs on the branch are `action_required`), so a green run on your fork would help.
pushkarreddyy commented 2026-11-24 13:02:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T12:36:04Z.


Thanks @mercuryVM for the sharp edge-case analysis!

You're completely right on all three points:

  1. Deleted files break rustfmt --check without diff filtering.
  2. An unconditional || true on pushes masks the real status and could be misinterpreted as main passing.
  3. Whitespace in paths breaks unquoted xargs.

I've updated the workflow in commit 72361d1:

  • Added --diff-filter=ACMR to ensure deleted files are never passed to rustfmt.
  • Switched to null-terminated stream parsing (git diff -z ... | xargs -0 -r rustfmt --edition 2024 --check) to handle paths with spaces safely and avoid running rustfmt on empty inputs.
  • Split pull requests and pushes into distinct steps: pull requests strictly enforce formatting on modified .rs files, while pushes to main run cargo fmt --all -- --check with continue-on-error: true, preserving the genuine exit code in the step log without faking a clean pass.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7131665182 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7131665182). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-24T12:36:04Z. --- Thanks @mercuryVM for the sharp edge-case analysis! You're completely right on all three points: 1. Deleted files break `rustfmt --check` without diff filtering. 2. An unconditional `|| true` on pushes masks the real status and could be misinterpreted as main passing. 3. Whitespace in paths breaks unquoted `xargs`. I've updated the workflow in commit `72361d1`: - Added `--diff-filter=ACMR` to ensure deleted files are never passed to `rustfmt`. - Switched to null-terminated stream parsing (`git diff -z ... | xargs -0 -r rustfmt --edition 2024 --check`) to handle paths with spaces safely and avoid running rustfmt on empty inputs. - Split pull requests and pushes into distinct steps: pull requests strictly enforce formatting on modified `.rs` files, while pushes to `main` run `cargo fmt --all -- --check` with `continue-on-error: true`, preserving the genuine exit code in the step log without faking a clean pass.
pushkarreddyy commented 2026-11-24 13:02:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T13:00:46Z.


Thank you @catminou4 for the thorough workflow review and approval!

Much appreciated for verifying the least-privilege permissions, concurrency cancellation, and changed-file scoping.

Regarding your notes:

  • Scoping PR formatting checks strictly to changed .rs files ensures new contributors get immediate feedback on their own code without getting blocked by pre-existing repository formatting or waiting for a repository-wide reformat sweep.
  • It pairs naturally with #545's cargo xtask qa as the local pre-push developer gate, while this workflow provides the automated server-side verification gate in GitHub Actions.

Now that PR #540 is approved by @catminou4, it is ready for maintainer merge!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132225394 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7132225394). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-24T13:00:46Z. --- Thank you @catminou4 for the thorough workflow review and approval! Much appreciated for verifying the least-privilege permissions, concurrency cancellation, and changed-file scoping. Regarding your notes: - Scoping PR formatting checks strictly to changed `.rs` files ensures new contributors get immediate feedback on their own code without getting blocked by pre-existing repository formatting or waiting for a repository-wide reformat sweep. - It pairs naturally with #545's `cargo xtask qa` as the local pre-push developer gate, while this workflow provides the automated server-side verification gate in GitHub Actions. Now that PR #540 is approved by @catminou4, it is ready for maintainer merge!
ricarmandoagent commented 2026-11-24 14:04:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ricarmandoagent on 2026-11-24T13:02:35Z.


This overlaps two other PRs before it is reviewed on its own merits: #17 runs the same rustfmt check with less machinery, and #481 already runs cargo xtask policy plus fmt in one workflow. Three workflows for two checks will double the runner time on every PR.

If this one is kept instead of #17/#481, two details: the toolchain is hard-coded to 1.98.1 while rust-toolchain.toml is the single source of truth (it matches today, it will drift on the next bump — rustup toolchain install with no argument reads the file), and dtolnay/rust-toolchain@stable with an explicit toolchain: input ignores the components the file pins unless they are listed again.

cargo xtask policy itself is fine on ubuntu-latest: xtask only depends on anyhow, clap and walkdir.

AI-assisted review.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132267361 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7132267361). Originally posted by [ricarmandoagent](https://github.com/ricarmandoagent) on 2026-11-24T13:02:35Z. --- This overlaps two other PRs before it is reviewed on its own merits: #17 runs the same rustfmt check with less machinery, and #481 already runs `cargo xtask policy` plus fmt in one workflow. Three workflows for two checks will double the runner time on every PR. If this one is kept instead of #17/#481, two details: the toolchain is hard-coded to `1.98.1` while `rust-toolchain.toml` is the single source of truth (it matches today, it will drift on the next bump — `rustup toolchain install` with no argument reads the file), and `dtolnay/rust-toolchain@stable` with an explicit `toolchain:` input ignores the components the file pins unless they are listed again. `cargo xtask policy` itself is fine on `ubuntu-latest`: xtask only depends on anyhow, clap and walkdir. AI-assisted review.
pushkarreddyy commented 2026-11-24 15:03:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T14:12:58Z.


Thanks @ricarmandoagent for the review and perspective!

Regarding PR #540:

  1. Scoping: PR #540 restricts formatting checks to modified .rs files (git diff origin/main...HEAD), which allows pull requests to pass CI cleanly without being blocked by pre-existing formatting differences in untouched files.
  2. Workflow Security & Efficiency: Configured with read-only permissions (contents: read) and concurrency cancellation groups to conserve GitHub runner resources.
  3. Review: Reviewed by @mercuryVM and @sebastianspicker, and approved by @catminou4.

We are very happy to adapt to whichever approach @Marvisak and the maintainers prefer for the repository!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134019202 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7134019202). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-24T14:12:58Z. --- Thanks @ricarmandoagent for the review and perspective! Regarding PR #540: 1. **Scoping**: PR #540 restricts formatting checks to modified .rs files (git diff origin/main...HEAD), which allows pull requests to pass CI cleanly without being blocked by pre-existing formatting differences in untouched files. 2. **Workflow Security & Efficiency**: Configured with read-only permissions (contents: read) and concurrency cancellation groups to conserve GitHub runner resources. 3. **Review**: Reviewed by @mercuryVM and @sebastianspicker, and approved by @catminou4. We are very happy to adapt to whichever approach @Marvisak and the maintainers prefer for the repository!
pushkarreddyy commented 2026-11-24 15:04:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T14:25:17Z.


Updated commit 637452f incorporates @ricarmandoagent's helpful suggestion to omit the explicit oolchain: input so dtolnay/rust-toolchain defers directly to
ust-toolchain.toml as the single source of truth for channel version and pins.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134346220 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7134346220). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-24T14:25:17Z. --- Updated commit 637452f incorporates @ricarmandoagent's helpful suggestion to omit the explicit oolchain: input so dtolnay/rust-toolchain defers directly to ust-toolchain.toml as the single source of truth for channel version and pins.
upstream-sync closed this pull request 2026-11-25 00:05:37 +00:00
Marvisak commented 2026-11-25 00:06:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:04:06Z.


Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

Second workflow for the asset-policy check, which main's ci.yml already runs inside the tests, plus rustfmt on changed files, which fails for any touched file because the workspace is not rustfmt-clean (#502). Installs stable through an unpinned third-party action instead of the pinned toolchain.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148101929 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/540#issuecomment-7148101929). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:04:06Z. --- Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current). Second workflow for the asset-policy check, which main's ci.yml already runs inside the tests, plus rustfmt on changed files, which fails for any touched file because the workspace is not rustfmt-clean (#502). Installs `stable` through an unpinned third-party action instead of the pinned toolchain. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

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
Marvisak/VIctory!540
No description provided.