From 992ee22f839b93c813c32b997ae71db024da76ac Mon Sep 17 00:00:00 2001 From: Alexander Mills Date: Tue, 4 Aug 2026 07:22:14 -0500 Subject: [PATCH 1/3] ci(DEN-1592): emit exact Nix bundle rustfmt evidence --- .../workflows/nix-bundle-rustfmt-evidence.yml | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/nix-bundle-rustfmt-evidence.yml diff --git a/.github/workflows/nix-bundle-rustfmt-evidence.yml b/.github/workflows/nix-bundle-rustfmt-evidence.yml new file mode 100644 index 00000000..66b564b0 --- /dev/null +++ b/.github/workflows/nix-bundle-rustfmt-evidence.yml @@ -0,0 +1,107 @@ +name: external Nix bundle rustfmt evidence + +on: + pull_request: + paths: + - ".github/workflows/nix-bundle-rustfmt-evidence.yml" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: external-nix-bundle-rustfmt-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + evidence: + name: format exact production Nix bundle files + runs-on: ubuntu-24.04 + timeout-minutes: 25 + steps: + - name: Check out evidence workflow + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: harness + persist-credentials: false + show-progress: false + + - name: Check out exact production commit + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: zed-pkg/zed-cli + ref: 1b282b94efc994bb9352b572c9652d5a078787f2 + path: zed-cli + persist-credentials: false + show-progress: false + + - name: Install pinned rustfmt + uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 + with: + toolchain: stable + components: rustfmt + + - name: Produce constrained exact bytes + working-directory: zed-cli + shell: bash + run: | + set -euo pipefail + test "$(git rev-parse HEAD)" = 1b282b94efc994bb9352b572c9652d5a078787f2 + cargo fmt --all + + python3 - <<'PY' + import subprocess + + expected = { + 'src/nix_bundle_write.rs', + 'tests/nix_bundle_write_boundaries.rs', + 'tests/nix_bundle_write_cli.rs', + } + changed = { + line.strip() + for line in subprocess.check_output( + ['git', 'diff', '--name-only'], text=True + ).splitlines() + if line.strip() + } + if changed != expected: + raise SystemExit( + 'expected exactly the three reviewed files; got: ' + + ', '.join(sorted(changed)) + ) + PY + + cargo fmt --all --check + cargo test --locked --test nix_bundle_write_cli --no-run + cargo test --locked --test nix_bundle_write_boundaries --no-run + + mkdir -p "$RUNNER_TEMP/nix-bundle-rustfmt/src" \ + "$RUNNER_TEMP/nix-bundle-rustfmt/tests" + cp src/nix_bundle_write.rs \ + "$RUNNER_TEMP/nix-bundle-rustfmt/src/nix_bundle_write.rs" + cp tests/nix_bundle_write_boundaries.rs \ + "$RUNNER_TEMP/nix-bundle-rustfmt/tests/nix_bundle_write_boundaries.rs" + cp tests/nix_bundle_write_cli.rs \ + "$RUNNER_TEMP/nix-bundle-rustfmt/tests/nix_bundle_write_cli.rs" + git diff --binary -- \ + src/nix_bundle_write.rs \ + tests/nix_bundle_write_boundaries.rs \ + tests/nix_bundle_write_cli.rs \ + > "$RUNNER_TEMP/nix-bundle-rustfmt/rustfmt.patch" + test -s "$RUNNER_TEMP/nix-bundle-rustfmt/rustfmt.patch" + sha256sum \ + "$RUNNER_TEMP/nix-bundle-rustfmt/src/nix_bundle_write.rs" \ + "$RUNNER_TEMP/nix-bundle-rustfmt/tests/nix_bundle_write_boundaries.rs" \ + "$RUNNER_TEMP/nix-bundle-rustfmt/tests/nix_bundle_write_cli.rs" \ + "$RUNNER_TEMP/nix-bundle-rustfmt/rustfmt.patch" \ + > "$RUNNER_TEMP/nix-bundle-rustfmt/SHA256SUMS" + git diff --check + + - name: Upload exact formatted files + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: nix-bundle-rustfmt-production-${{ github.run_id }} + path: ${{ runner.temp }}/nix-bundle-rustfmt + if-no-files-found: error + retention-days: 1 + include-hidden-files: false From 454a5bf6ea0164b225225a586ad0531bdcae739e Mon Sep 17 00:00:00 2001 From: Alexander Mills Date: Tue, 4 Aug 2026 07:27:52 -0500 Subject: [PATCH 2/3] ci(DEN-1592): use unsaturated rustfmt runner pool --- .github/workflows/nix-bundle-rustfmt-evidence.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nix-bundle-rustfmt-evidence.yml b/.github/workflows/nix-bundle-rustfmt-evidence.yml index 66b564b0..a4e482a7 100644 --- a/.github/workflows/nix-bundle-rustfmt-evidence.yml +++ b/.github/workflows/nix-bundle-rustfmt-evidence.yml @@ -16,7 +16,7 @@ concurrency: jobs: evidence: name: format exact production Nix bundle files - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 timeout-minutes: 25 steps: - name: Check out evidence workflow From c16e45f4b330a4b5453037f05109fe63cd4aa9a0 Mon Sep 17 00:00:00 2001 From: Alexander Mills Date: Tue, 4 Aug 2026 07:28:41 -0500 Subject: [PATCH 3/3] ci(DEN-1592): fan out rustfmt evidence pools --- .github/workflows/nix-bundle-rustfmt-evidence.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nix-bundle-rustfmt-evidence.yml b/.github/workflows/nix-bundle-rustfmt-evidence.yml index a4e482a7..d0cdbb38 100644 --- a/.github/workflows/nix-bundle-rustfmt-evidence.yml +++ b/.github/workflows/nix-bundle-rustfmt-evidence.yml @@ -15,9 +15,13 @@ concurrency: jobs: evidence: - name: format exact production Nix bundle files - runs-on: ubuntu-22.04 - timeout-minutes: 25 + name: format exact production Nix bundle files / ${{ matrix.os }} + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, windows-2022, macos-13] steps: - name: Check out evidence workflow uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -100,7 +104,7 @@ jobs: - name: Upload exact formatted files uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: - name: nix-bundle-rustfmt-production-${{ github.run_id }} + name: nix-bundle-rustfmt-production-${{ runner.os }}-${{ github.run_id }} path: ${{ runner.temp }}/nix-bundle-rustfmt if-no-files-found: error retention-days: 1