From cf4813230c293c831907d5afed21505a58266b5e Mon Sep 17 00:00:00 2001 From: user Date: Fri, 28 Aug 2026 21:24:27 +0800 Subject: [PATCH] fix(ci): pass --format-version 1 to remaining cargo metadata checks PR #2577 added `--format-version 1` to the `cargo metadata` validation steps in ci.yml so the pipeline consumes explicit JSON v1 output instead of relying on the default format. The same bare invocations were still present in linux-binaries.yml (Verify committed/projected Cargo metadata) and nightly-artifacts.yml (Verify committed/projected Cargo metadata), leaving those four checks on the implicit default format. Append `--format-version 1` to those four steps and sync the expected command strings in scripts/check-github-config.test.mjs (the nightly expectation and the two linux-binaries assertions) so the config tests keep pinning the exact validation commands. Assisted-by: AI agent (Claude) --- .github/workflows/linux-binaries.yml | 4 ++-- .github/workflows/nightly-artifacts.yml | 4 ++-- scripts/check-github-config.test.mjs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linux-binaries.yml b/.github/workflows/linux-binaries.yml index af21924880..b10974561b 100644 --- a/.github/workflows/linux-binaries.yml +++ b/.github/workflows/linux-binaries.yml @@ -126,7 +126,7 @@ jobs: cache-on-failure: ${{ inputs.cache_write && github.event_name != 'pull_request' }} - name: Verify committed Cargo metadata - run: cargo metadata --locked --no-deps + run: cargo metadata --locked --no-deps --format-version 1 - name: Patch build version shell: bash @@ -143,7 +143,7 @@ jobs: node scripts/set-build-version.mjs --version "$ASSET_VERSION" - name: Verify projected Cargo metadata - run: cargo metadata --locked --no-deps + run: cargo metadata --locked --no-deps --format-version 1 - name: Build CLI and Relay Server shell: bash diff --git a/.github/workflows/nightly-artifacts.yml b/.github/workflows/nightly-artifacts.yml index 62dda2c5aa..15ee36ac90 100644 --- a/.github/workflows/nightly-artifacts.yml +++ b/.github/workflows/nightly-artifacts.yml @@ -158,7 +158,7 @@ jobs: cache-on-failure: ${{ inputs.cache_write && github.event_name != 'pull_request' }} - name: Verify committed Cargo metadata - run: cargo metadata --locked --no-deps + run: cargo metadata --locked --no-deps --format-version 1 - name: Install dependencies run: pnpm install --frozen-lockfile @@ -204,7 +204,7 @@ jobs: echo "Cargo.toml version: $(grep 'x-release-please-version' Cargo.toml)" - name: Verify projected Cargo metadata - run: cargo metadata --locked --no-deps + run: cargo metadata --locked --no-deps --format-version 1 - name: Run Windows CLI terminal contracts if: runner.os == 'Windows' diff --git a/scripts/check-github-config.test.mjs b/scripts/check-github-config.test.mjs index b2d9bddae6..4957d9d6d8 100644 --- a/scripts/check-github-config.test.mjs +++ b/scripts/check-github-config.test.mjs @@ -702,7 +702,7 @@ test('nightly validates generated inputs and projected lockfiles before packagin metadataIndex < buildIndex, 'nightly must verify the projected lockfile before nested locked build hooks run', ); - const expectedMetadata = 'cargo metadata --locked --no-deps'; + const expectedMetadata = 'cargo metadata --locked --no-deps --format-version 1'; assert.equal(steps[committedMetadataIndex].run, expectedMetadata); assert.equal(steps[metadataIndex].run, expectedMetadata); assert.equal(steps[installerI18nIndex].if, "runner.os == 'Windows'"); @@ -798,8 +798,8 @@ test('Linux binary packaging uses the shared locked version projection contract' ); assert.match(steps[patchIndex].run, /node scripts\/set-build-version\.mjs/); assert.doesNotMatch(steps[patchIndex].run, /sed -i/); - assert.equal(steps[committedIndex].run, 'cargo metadata --locked --no-deps'); - assert.equal(steps[projectedIndex].run, 'cargo metadata --locked --no-deps'); + assert.equal(steps[committedIndex].run, 'cargo metadata --locked --no-deps --format-version 1'); + assert.equal(steps[projectedIndex].run, 'cargo metadata --locked --no-deps --format-version 1'); assert.match(steps[buildIndex].run, /cargo build --locked --release/); const rustCache = steps.find((step) => step.uses?.startsWith('swatinem/rust-cache@'));