Skip to content

ci: run TS and Rust test jobs on Blacksmith runners - #12969

Merged
zkochan merged 4 commits into
mainfrom
use-blacksmith
Jul 13, 2026
Merged

zkochan merged 4 commits into
mainfrom
use-blacksmith

Conversation

@zkochan

@zkochan zkochan commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves the unit and e2e test jobs of both CI workflows onto Blacksmith runners. The lint/detect/ancillary jobs already ran on Blacksmith (blacksmith-4vcpu-ubuntu-2404); only the test jobs were still on GitHub-hosted runners.

  • TS CI (ci.yml): test-smoke and the test / test-windows matrices now pass blacksmith-8vcpu-ubuntu-2404 / blacksmith-8vcpu-windows-2022 into the reusable test.yml.
  • Rust CI (pacquet-ci.yml): the test matrix ubuntu/windows legs move to the same Blacksmith labels. The macOS leg stays on macos-latest — Blacksmith offers no macOS runners.

The Bencher upload workflow validates testbed names against strict ubuntu|windows|macos regexes, and both test workflows derived that slug by stripping -latest from the runner label — which no longer works for Blacksmith labels. Fixed by mapping *ubuntu*/*windows* labels to the bare slug in test.yml, and deriving the slug (and artifact name) from matrix.os_label in the Rust test job.

Bundled test fix: stale_pin_dedupe coarse-mtime robustness

Migrating the Rust test job to Blacksmith surfaced a deterministic failure in the three stale_pin_dedupe tests. Each runs two back-to-back installs, rewriting package.json between them, and asserts the second install re-resolves the bumped version. pnpm and pacquet both gate their incremental-install fast path (optimistic_repeat_install) on a manifest's mtime being newer than the previous install. The two installs run a few hundred ms apart, so on Blacksmith's coarse-granularity (≥1s) filesystem the rewritten manifest lands in the same mtime tick as the first install — the edit isn't seen as newer, re-resolution is skipped, and the lockfile keeps the stale version.

This is not a pacquet-vs-pnpm divergence (the fast path behaves the same in both stacks; forcing the second manifest's mtime equal to the lockfile's reproduces it locally regardless of baseline). The fix pushes the rewritten manifest's mtime past the lockfile's so the install reads a genuine later edit. It's bundled here rather than in a separate PR because the failure only reproduces on Blacksmith, so it can only be validated in this PR's CI.

Note

Requires Blacksmith Windows runners to be enabled for the org — otherwise the Windows legs will sit queued. macOS is untouched.

Squash Commit Body

Move the unit and e2e test jobs that were still on GitHub-hosted runners
onto Blacksmith 8vcpu runners, matching the Blacksmith runners the
lint/detect/ancillary jobs already use.

- TS CI (ci.yml): test-smoke and the test/test-windows matrices now pass
  blacksmith-8vcpu-ubuntu-2404 / blacksmith-8vcpu-windows-2022 into the
  reusable test.yml.
- Rust CI (pacquet-ci.yml): the test matrix ubuntu/windows legs move to the
  same Blacksmith labels. The macOS leg stays on macos-latest because
  Blacksmith offers no macOS runners.

The Bencher upload workflow validates testbed names against strict
ubuntu/windows/macos regexes, and both test workflows derived that slug by
stripping "-latest" from the runner label, which no longer works for
Blacksmith labels. test.yml now maps *ubuntu*/*windows* labels to the bare
slug, and the Rust test job derives the slug (and its artifact name) from
matrix.os_label instead.

Also harden the three stale_pin_dedupe tests, which run two back-to-back
installs and fail on Blacksmith's coarse-granularity (>=1s) mtime
filesystem: the incremental-install fast path (shared with pnpm) treats
the same-tick manifest rewrite as unchanged and skips re-resolution. Push
the rewritten manifest's mtime past the lockfile's so the second install
reads a genuine later edit.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust pnpm/ port, or the description notes what still needs porting. (CI config touches both stacks; the test fix is Rust-only test robustness — production fast path unchanged and already matches pnpm.)
  • Added a changeset if this PR changes any published package. (N/A — CI + test-only, no published package affected.)
  • Added or updated tests. (Hardens the three stale_pin_dedupe tests.)
  • Updated the documentation if needed. (N/A.)

Written by an agent (Claude Code, claude-opus-4-8).

Summary by CodeRabbit

  • CI Improvements
    • Updated TypeScript CI to run Ubuntu smoke and sharded tests on dedicated Blacksmith Ubuntu runners, using a single Ubuntu chunk.
    • Updated TypeScript Windows CI to use dedicated Blacksmith Windows runners for sharded execution while preserving the 3-shard structure.
    • Switched Pacquet/Bencher test duration staging to derive OS labels directly from the run matrix.
    • Improved the reusable test workflow’s OS matching logic for duration staging and error messaging.
  • Tests
    • Strengthened pnpm stale pin refresh coverage by adjusting manifest modification times to avoid timestamp granularity flakiness.

Copilot AI review requested due to automatic review settings July 13, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@zkochan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f11d43e-ec31-4c81-a917-681cd24adaa5

📥 Commits

Reviewing files that changed from the base of the PR and between ca08258 and 085a71c.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
📝 Walkthrough

Walkthrough

CI workflows switch Ubuntu and Windows jobs to pinned Blacksmith runners, define explicit Windows shards, and update Bencher platform handling. Stale-pin tests now control manifest timestamps to deterministically exercise incremental resolution.

Changes

CI runner migration

Layer / File(s) Summary
Pinned CI runner matrices
.github/workflows/ci.yml, .github/workflows/pacquet-ci.yml
TypeScript smoke, sharded, and Rust jobs use pinned Blacksmith runners with explicit Windows shard metadata; macOS remains GitHub-hosted.
Bencher platform metadata
.github/workflows/pacquet-ci.yml
Bencher testbed metadata and artifact names use matrix.os_label.
Reusable workflow platform detection
.github/workflows/test.yml
Platform slugs are derived from runner labels containing ubuntu or windows, with updated unsupported-platform validation.

Stale-pin test determinism

Layer / File(s) Summary
Deterministic manifest timestamps
pnpm/crates/cli/tests/stale_pin_dedupe.rs
A helper advances package.json mtime beyond the lockfile, and stale-pin tests invoke it before their second installation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#12404: Related Bencher duration tracking and platform_slug handling.
  • pnpm/pnpm#12472: Related stale transitive-pin refresh tests and deterministic incremental-resolution behavior.
  • pnpm/pnpm#12612: Related chunk-aware reusable test workflow inputs and runner platform labels.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch use-blacksmith

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

CI: Move TS/Rust test jobs to Blacksmith runners and fix Bencher OS slugs

⚙️ Configuration changes 🐞 Bug fix 🕐 20-40 Minutes

Grey Divider

AI Description

• Run TS and Rust test matrices on Blacksmith 8vCPU Ubuntu/Windows runners.
• Keep Rust macOS tests on GitHub-hosted runners due to runner availability.
• Normalize Bencher testbed OS slugs/artifact names so Blacksmith labels validate.
Diagram

graph TD
  TS["TS CI (ci.yml)"] --> TESTWF["Reusable tests (test.yml)"] --> BENCH["Bencher artifacts"]
  TESTWF --> BS_U["Blacksmith Ubuntu"] & BS_W["Blacksmith Windows"]
  RUST["Rust CI (pacquet-ci.yml)"] --> RTEST["Rust test matrix"] --> BENCH
  RTEST --> BS_U & BS_W & GH_MAC["GitHub macOS"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pass an explicit OS slug into test.yml
  • ➕ Avoids parsing runner labels (GitHub-hosted vs Blacksmith) in bash
  • ➕ Makes Bencher testbed naming a stable, versioned workflow input
  • ➖ Requires updating all callers to provide the new input consistently
  • ➖ Slightly more verbose matrices (must keep runner label and slug in sync)
2. Derive OS slug from runner context instead of label strings
  • ➕ Reduces dependence on runner label naming conventions
  • ➕ Potentially more robust if runner labels change again
  • ➖ runner.os yields Linux/Windows/macOS, still needs mapping to ubuntu/windows/macos
  • ➖ Doesn’t help when you need the distro-level distinction elsewhere

Recommendation: Current approach is reasonable: it keeps the runner selection in matrices while fixing Bencher compatibility with a minimal, localized mapping. If additional runner providers/labels are expected, consider the explicit OS slug input to make the reusable workflow fully decoupled from runner naming.

Files changed (3) +21 / -16

Bug fix (1) +8 / -5
test.ymlMap runner labels to Bencher-compatible OS slugs +8/-5

Map runner labels to Bencher-compatible OS slugs

• Replaces the prior "strip -latest" logic with a pattern-based mapping from runner labels to ubuntu/windows slugs. This keeps Bencher testbed names valid when the workflow runs on either GitHub-hosted or Blacksmith runners.

.github/workflows/test.yml

Other (2) +13 / -11
ci.ymlRun TS test jobs on Blacksmith 8vCPU runners +6/-6

Run TS test jobs on Blacksmith 8vCPU runners

• Updates the TS smoke test and Linux/Windows test matrices to use Blacksmith runner labels instead of ubuntu-latest/windows-latest. This moves remaining test execution onto Blacksmith while keeping existing reusable workflow wiring intact.

.github/workflows/ci.yml

pacquet-ci.ymlMove Rust test matrix to Blacksmith and stabilize Bencher OS naming +7/-5

Move Rust test matrix to Blacksmith and stabilize Bencher OS naming

• Switches the Rust test matrix Ubuntu/Windows legs to Blacksmith runner labels while leaving macOS on macos-latest. Fixes Bencher metadata and artifact naming by using matrix.os_label (ubuntu/windows/macos) rather than parsing matrix.os.

.github/workflows/pacquet-ci.yml

@greptile-apps

greptile-apps Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This is a CI-only change with no impact on published packages or application logic. The runner label substitutions and the Bencher slug-mapping fix are all consistent and correct.

All three workflow files are updated cohesively: runner labels are swapped to Blacksmith, the Bencher testbed slug derivation in test.yml is generalized via glob patterns to handle any runner label format, and the Rust CI correctly uses matrix.os_label instead of the full runner label string. macOS is correctly left on macos-latest. No logic errors or regressions are present.

No files require special attention. All changes are consistent and internally correct.

Reviews (2): Last reviewed commit: "ci: run TS and Rust test jobs on Blacksm..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/test.yml (1)

279-279: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Artifact name uses full Blacksmith runner label, unlike Rust CI.

The TS CI artifact name at line 279 uses ${{ inputs.platform }} (e.g., blacksmith-8vcpu-ubuntu-2404), while pacquet-ci.yml line 210 switched to ${{ matrix.os_label }} (e.g., ubuntu) for cleaner names. The Bencher metadata inside both artifacts uses the correct short slug, so downstream Bencher processing is unaffected. Consider deriving a short slug for the artifact name for consistency, though this is non-blocking.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yml at line 279, Update the TypeScript CI artifact
name in the workflow step using the `name` expression to use the short
platform/OS slug, matching the `matrix.os_label` convention in Rust CI, instead
of the full `${{ inputs.platform }}` Blacksmith runner label; preserve the
existing node and test-chunk components.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/test.yml:
- Line 279: Update the TypeScript CI artifact name in the workflow step using
the `name` expression to use the short platform/OS slug, matching the
`matrix.os_label` convention in Rust CI, instead of the full `${{
inputs.platform }}` Blacksmith runner label; preserve the existing node and
test-chunk components.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dd057c2b-0ddc-4393-b3b6-0f3b858893fc

📥 Commits

Reviewing files that changed from the base of the PR and between 1adc62c and b40402c.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • .github/workflows/pacquet-ci.yml
  • .github/workflows/test.yml

@qodo-code-review

qodo-code-review Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Remediation recommended

1. Cache key too coarse 🐞 Bug ☼ Reliability ⭐ New
Description
After switching pnpr builds to Blacksmith runner labels, the reusable build workflow still caches
binaries under a key that only includes runner.os (Linux/Windows), so caches from different runner
images within the same OS family can be reused. This can skip rebuilding on the new Blacksmith image
and upload binaries produced on a different environment, making CI behavior image-dependent and
harder to debug.
Code

.github/workflows/ci.yml[R113-121]

+      os: blacksmith-8vcpu-ubuntu-2404

  build-pnpr-windows:
    needs: changes
    if: ${{ !cancelled() && needs.changes.outputs.ts == 'true' }}
    name: TS CI / Build pnpr
    uses: ./.github/workflows/build-pnpr.yml
    with:
-      os: windows-latest
+      os: blacksmith-8vcpu-windows-2025
Evidence
The build jobs now pass Blacksmith labels into the reusable workflow, but the reusable workflow’s
cache key does not include that label and the build is skipped on cache hit; the uploaded artifact
is later downloaded/executed by tests, so reusing a cache built on a different image can affect
downstream jobs.

.github/workflows/ci.yml[107-121]
.github/workflows/build-pnpr.yml[42-56]
.github/workflows/build-pnpr.yml[72-76]
.github/workflows/test.yml[104-117]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`ci.yml` now builds pnpr on Blacksmith labels, but `.github/workflows/build-pnpr.yml` caches pnpr binaries with a key scoped only by `${{ runner.os }}`. Because `runner.os` stays `Linux`/`Windows` across runner images, the cache namespace doesn’t change when moving from GitHub-hosted to Blacksmith labels, so a cache hit can skip rebuilding and reuse binaries from a different runner image.

## Issue Context
This is most likely to show up during/after the migration when caches created on the old runner image still exist for the same Rust source hash.

## Fix Focus Areas
- .github/workflows/ci.yml[107-121]
- .github/workflows/build-pnpr.yml[42-56]
- .github/workflows/build-pnpr.yml[72-76]

## Suggested fix
- Change the cache key in `build-pnpr.yml` to include a stable identifier for the runner image/label (e.g., `${{ inputs.os }}`), or bump/namespace the key (e.g., `pnpr-bins-v2-...`) to force a one-time rebuild on the new images.
- (Optional) If you include `${{ inputs.os }}` in the cache key, consider whether you also want to version/namespace the artifact name similarly; if not, keep artifact names as-is but at least isolate caches so the build step actually runs on the intended image during migration.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Overbroad OS slug match 🐞 Bug ◔ Observability
Description
test.yml now maps the Bencher platform_slug by substring-matching *ubuntu*/*windows* on
inputs.platform, so unexpected runner labels that merely contain those substrings will be treated
as supported. This weakens the prior strict allowlist behavior and can misattribute or allow
performance artifacts from a misconfigured runner label to pass Bencher’s strict
ubuntu|windows|macos testbed validation.
Code

.github/workflows/test.yml[R238-245]

+        case "$PLATFORM" in
+          *ubuntu*) platform_slug=ubuntu ;;
+          *windows*) platform_slug=windows ;;
          *)
-            echo "::error::Unsupported platform '$platform_slug' for pnpm benchmarks; expected ubuntu or windows"
+            echo "::error::Unsupported platform '$PLATFORM' for pnpm benchmarks; expected an ubuntu or windows runner"
            exit 1
            ;;
        esac
Evidence
The TS reusable workflow now assigns platform_slug based on substring matching of the runner label
and uses it to generate the Bencher testbed value, while the upload workflow only accepts strict
OS slugs in testbed names; broad matching increases the chance of misclassification and reduces the
safeguard against unintended labels.

.github/workflows/test.yml[235-273]
.github/workflows/ci-performance-bencher-upload.yml[193-201]
.github/workflows/ci.yml[123-161]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.github/workflows/test.yml` derives `platform_slug` using substring matches (`*ubuntu*`, `*windows*`). This is less strict than the prior `PLATFORM%-latest` + exact `ubuntu|windows` check, and it can silently accept unintended runner labels and generate metadata that passes Bencher upload validation.

## Issue Context
Bencher upload validates testbeds against strict OS regexes (`ubuntu|windows|macos`). The TS workflow generates testbed names using `platform_slug`, so widening slug derivation broadens what can be treated as a supported testbed.

## Fix Focus Areas
- .github/workflows/test.yml[235-245]

## Suggested fix
Replace substring matching with an explicit allowlist (e.g., `ubuntu-latest` and the specific Blacksmith Ubuntu label map to `ubuntu`; same for Windows), or pass an explicit `os_label`/`platform_slug` input from the calling workflow (like the Rust workflow does) and validate it strictly (`ubuntu|windows`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Secret on Blacksmith runner 🐞 Bug ⛨ Security
Description
test-smoke still receives GARNET_API_TOKEN but now runs on blacksmith-8vcpu-ubuntu-2404,
expanding that secret’s trust boundary from GitHub-hosted runners to the Blacksmith runner
environment. If the runner environment is compromised/misconfigured, the token can be read during
the job (it is provided to garnet-org/action).
Code

.github/workflows/ci.yml[R130-133]

+      platform: blacksmith-8vcpu-ubuntu-2404
      garnet: true
    secrets:
      GARNET_API_TOKEN: ${{ secrets.GARNET_API_TOKEN }}
Evidence
ci.yml now runs test-smoke on a Blacksmith label while still passing GARNET_API_TOKEN;
test.yml uses runs-on: ${{ inputs.platform }} and passes that secret to garnet-org/action, so
the token is consumed on the Blacksmith runner environment.

.github/workflows/ci.yml[123-133]
.github/workflows/test.yml[35-66]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`GARNET_API_TOKEN` is now used in a job that runs on a Blacksmith runner label. This is a trust-boundary change for a secret and should be an explicit decision.

### Issue Context
- `test-smoke` passes `GARNET_API_TOKEN` into the reusable `test.yml` workflow.
- `test.yml` runs on `inputs.platform` and forwards the secret to `garnet-org/action`.

### Fix Focus Areas
- .github/workflows/ci.yml[123-133]
- .github/workflows/test.yml[35-66]

### Suggested fix
- If you want to keep Blacksmith for most tests but avoid running secret-bearing steps there, run the `test-smoke` job on a GitHub-hosted runner (e.g. `ubuntu-latest` / `ubuntu-24.04`) while keeping the other non-secret test matrix legs on Blacksmith.
- Alternatively, gate the Garnet step/token usage to only the events/branches where it’s truly needed (so fewer runs ever receive the token), or switch to a lower-privilege CI-only token if available.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
4. Build/test image drift risk ✓ Resolved 🐞 Bug ☼ Reliability
Description
pnpr binaries are built on floating ubuntu-latest/windows-latest but the test jobs now execute
them on pinned Blacksmith images (blacksmith-8vcpu-ubuntu-2404 / blacksmith-8vcpu-windows-2022).
If the *-latest build images drift (especially Windows), the produced binaries may no longer match
the runtime environment the tests execute in, causing flaky or hard-to-diagnose CI failures.
Code

.github/workflows/ci.yml[R174-187]

+            platform: blacksmith-8vcpu-windows-2022
            platform_label: windows 1/3
            test_chunk: '1'
            test_chunk_total: '3'
          - node: '22.13.0'
            node_major: '22'
-            platform: windows-latest
+            platform: blacksmith-8vcpu-windows-2022
            platform_label: windows 2/3
            test_chunk: '2'
            test_chunk_total: '3'
          - node: '22.13.0'
            node_major: '22'
-            platform: windows-latest
+            platform: blacksmith-8vcpu-windows-2022
            platform_label: windows 3/3
Evidence
ci.yml still builds pnpr on ubuntu-latest/windows-latest, while test matrices now run on
pinned Blacksmith labels. build-pnpr.yml uploads OS-generic artifacts (`pnpr-bins-${{ runner.os
}}) that test.yml downloads by runner.os, so the artifacts built on *-latest` are executed in
the Blacksmith test environments.

.github/workflows/ci.yml[107-122]
.github/workflows/ci.yml[165-187]
.github/workflows/build-pnpr.yml[24-76]
.github/workflows/test.yml[97-108]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The pnpr artifacts are built on `*-latest` images but executed in tests on pinned Blacksmith images. This increases the chance of future OS/toolchain drift between build and runtime.

### Issue Context
- `build-pnpr.yml` runs on `inputs.os` and uploads `pnpr-bins-${{ runner.os }}`.
- `test.yml` downloads `pnpr-bins-${{ runner.os }}` and executes those binaries.
- After this PR, Windows/Linux tests run on Blacksmith labels, but the build jobs in `ci.yml` still pass `ubuntu-latest` / `windows-latest`.

### Fix Focus Areas
- .github/workflows/ci.yml[107-122]
- .github/workflows/ci.yml[165-197]

### Suggested fix
- Pin the build jobs to the same effective OS versions as the tests.
 - Option A (preferred for consistency): run `build-pnpr-linux` and `build-pnpr-windows` on the same Blacksmith labels used by the tests.
 - Option B: pin the GitHub-hosted builds to explicit versions (`ubuntu-24.04`, `windows-2022`) to match the Blacksmith test legs.
This keeps the build/test environment aligned and reduces drift risk over time.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 085a71c

Results up to commit b40402c


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Secret on Blacksmith runner 🐞 Bug ⛨ Security
Description
test-smoke still receives GARNET_API_TOKEN but now runs on blacksmith-8vcpu-ubuntu-2404,
expanding that secret’s trust boundary from GitHub-hosted runners to the Blacksmith runner
environment. If the runner environment is compromised/misconfigured, the token can be read during
the job (it is provided to garnet-org/action).
Code

.github/workflows/ci.yml[R130-133]

+      platform: blacksmith-8vcpu-ubuntu-2404
      garnet: true
    secrets:
      GARNET_API_TOKEN: ${{ secrets.GARNET_API_TOKEN }}
Evidence
ci.yml now runs test-smoke on a Blacksmith label while still passing GARNET_API_TOKEN;
test.yml uses runs-on: ${{ inputs.platform }} and passes that secret to garnet-org/action, so
the token is consumed on the Blacksmith runner environment.

.github/workflows/ci.yml[123-133]
.github/workflows/test.yml[35-66]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`GARNET_API_TOKEN` is now used in a job that runs on a Blacksmith runner label. This is a trust-boundary change for a secret and should be an explicit decision.

### Issue Context
- `test-smoke` passes `GARNET_API_TOKEN` into the reusable `test.yml` workflow.
- `test.yml` runs on `inputs.platform` and forwards the secret to `garnet-org/action`.

### Fix Focus Areas
- .github/workflows/ci.yml[123-133]
- .github/workflows/test.yml[35-66]

### Suggested fix
- If you want to keep Blacksmith for most tests but avoid running secret-bearing steps there, run the `test-smoke` job on a GitHub-hosted runner (e.g. `ubuntu-latest` / `ubuntu-24.04`) while keeping the other non-secret test matrix legs on Blacksmith.
- Alternatively, gate the Garnet step/token usage to only the events/branches where it’s truly needed (so fewer runs ever receive the token), or switch to a lower-privilege CI-only token if available.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Build/test image drift risk ✓ Resolved 🐞 Bug ☼ Reliability
Description
pnpr binaries are built on floating ubuntu-latest/windows-latest but the test jobs now execute
them on pinned Blacksmith images (blacksmith-8vcpu-ubuntu-2404 / blacksmith-8vcpu-windows-2022).
If the *-latest build images drift (especially Windows), the produced binaries may no longer match
the runtime environment the tests execute in, causing flaky or hard-to-diagnose CI failures.
Code

.github/workflows/ci.yml[R174-187]

+            platform: blacksmith-8vcpu-windows-2022
            platform_label: windows 1/3
            test_chunk: '1'
            test_chunk_total: '3'
          - node: '22.13.0'
            node_major: '22'
-            platform: windows-latest
+            platform: blacksmith-8vcpu-windows-2022
            platform_label: windows 2/3
            test_chunk: '2'
            test_chunk_total: '3'
          - node: '22.13.0'
            node_major: '22'
-            platform: windows-latest
+            platform: blacksmith-8vcpu-windows-2022
            platform_label: windows 3/3
Evidence
ci.yml still builds pnpr on ubuntu-latest/windows-latest, while test matrices now run on
pinned Blacksmith labels. build-pnpr.yml uploads OS-generic artifacts (`pnpr-bins-${{ runner.os
}}) that test.yml downloads by runner.os, so the artifacts built on *-latest` are executed in
the Blacksmith test environments.

.github/workflows/ci.yml[107-122]
.github/workflows/ci.yml[165-187]
.github/workflows/build-pnpr.yml[24-76]
.github/workflows/test.yml[97-108]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The pnpr artifacts are built on `*-latest` images but executed in tests on pinned Blacksmith images. This increases the chance of future OS/toolchain drift between build and runtime.

### Issue Context
- `build-pnpr.yml` runs on `inputs.os` and uploads `pnpr-bins-${{ runner.os }}`.
- `test.yml` downloads `pnpr-bins-${{ runner.os }}` and executes those binaries.
- After this PR, Windows/Linux tests run on Blacksmith labels, but the build jobs in `ci.yml` still pass `ubuntu-latest` / `windows-latest`.

### Fix Focus Areas
- .github/workflows/ci.yml[107-122]
- .github/workflows/ci.yml[165-197]

### Suggested fix
- Pin the build jobs to the same effective OS versions as the tests.
 - Option A (preferred for consistency): run `build-pnpr-linux` and `build-pnpr-windows` on the same Blacksmith labels used by the tests.
 - Option B: pin the GitHub-hosted builds to explicit versions (`ubuntu-24.04`, `windows-2022`) to match the Blacksmith test legs.
This keeps the build/test environment aligned and reduces drift risk over time.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 97696f3


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Overbroad OS slug match 🐞 Bug ◔ Observability
Description
test.yml now maps the Bencher platform_slug by substring-matching *ubuntu*/*windows* on
inputs.platform, so unexpected runner labels that merely contain those substrings will be treated
as supported. This weakens the prior strict allowlist behavior and can misattribute or allow
performance artifacts from a misconfigured runner label to pass Bencher’s strict
ubuntu|windows|macos testbed validation.
Code

.github/workflows/test.yml[R238-245]

+        case "$PLATFORM" in
+          *ubuntu*) platform_slug=ubuntu ;;
+          *windows*) platform_slug=windows ;;
          *)
-            echo "::error::Unsupported platform '$platform_slug' for pnpm benchmarks; expected ubuntu or windows"
+            echo "::error::Unsupported platform '$PLATFORM' for pnpm benchmarks; expected an ubuntu or windows runner"
            exit 1
            ;;
        esac
Evidence
The TS reusable workflow now assigns platform_slug based on substring matching of the runner label
and uses it to generate the Bencher testbed value, while the upload workflow only accepts strict
OS slugs in testbed names; broad matching increases the chance of misclassification and reduces the
safeguard against unintended labels.

.github/workflows/test.yml[235-273]
.github/workflows/ci-performance-bencher-upload.yml[193-201]
.github/workflows/ci.yml[123-161]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.github/workflows/test.yml` derives `platform_slug` using substring matches (`*ubuntu*`, `*windows*`). This is less strict than the prior `PLATFORM%-latest` + exact `ubuntu|windows` check, and it can silently accept unintended runner labels and generate metadata that passes Bencher upload validation.

## Issue Context
Bencher upload validates testbeds against strict OS regexes (`ubuntu|windows|macos`). The TS workflow generates testbed names using `platform_slug`, so widening slug derivation broadens what can be treated as a supported testbed.

## Fix Focus Areas
- .github/workflows/test.yml[235-245]

## Suggested fix
Replace substring matching with an explicit allowlist (e.g., `ubuntu-latest` and the specific Blacksmith Ubuntu label map to `ubuntu`; same for Windows), or pass an explicit `os_label`/`platform_slug` input from the calling workflow (like the Rust workflow does) and validate it strictly (`ubuntu|windows`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Make runner matching more precise

Require a hyphen in the platform glob patterns.

.github/workflows/test.yml [238-245]

 case "$PLATFORM" in
-  *ubuntu*) platform_slug=ubuntu ;;
-  *windows*) platform_slug=windows ;;
+  *ubuntu-*) platform_slug=ubuntu ;;
+  *windows-*) platform_slug=windows ;;
   *)
     echo "::error::Unsupported platform '$PLATFORM' for pnpm benchmarks; expected an ubuntu or windows runner"
     exit 1
     ;;
 esac
  • Apply / Chat
Suggestion importance[1-10]: 1

__

Why: Tightening the glob pattern is unnecessary since the PLATFORM variable is strictly controlled by the workflow matrix, and this change could break valid future inputs if they are exact strings like ubuntu.

Low
  • More

Copilot AI review requested due to automatic review settings July 13, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 97696f3

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

zkochan added 2 commits July 13, 2026 16:42
Move the unit and e2e test jobs that were still on GitHub-hosted runners
onto Blacksmith 8vcpu runners, matching the Blacksmith runners the
lint/detect/ancillary jobs already use.

- TS CI (ci.yml): test-smoke and the test/test-windows matrices now pass
  blacksmith-8vcpu-ubuntu-2404 / blacksmith-8vcpu-windows-2022 into the
  reusable test.yml.
- Rust CI (pacquet-ci.yml): the test matrix ubuntu/windows legs move to the
  same Blacksmith labels. The macOS leg stays on macos-latest because
  Blacksmith offers no macOS runners.

The Bencher upload workflow validates testbed names against strict
ubuntu/windows/macos regexes, and both test workflows derived that slug by
stripping "-latest" from the runner label, which no longer works for
Blacksmith labels. test.yml now maps *ubuntu*/*windows* labels to the bare
slug, and the Rust test job derives the slug (and its artifact name) from
matrix.os_label instead.
The three stale_pin_dedupe tests each run two back-to-back installs,
rewriting package.json between them, and assert the second install
re-resolves the bumped version. pnpm and pacquet both gate their
incremental-install fast path on a manifest's mtime being newer than the
previous install (optimistic_repeat_install). The two installs run a few
hundred milliseconds apart, so on a filesystem whose mtime granularity is
coarser than that gap the rewritten manifest lands in the same mtime tick
as the first install, the edit is not seen as newer, re-resolution is
skipped, and the lockfile keeps the stale version.

This surfaced on CI runners whose filesystem has second-granularity
mtimes: the tests pass on ext4-backed runners and local dev but fail
deterministically there. It is not a pacquet-vs-pnpm divergence — the
mtime fast path behaves the same in both stacks, and forcing the second
manifest's mtime equal to the lockfile's reproduces the failure locally
regardless of which baseline (wall clock or lockfile mtime) the gate
uses.

Model the intended scenario explicitly: push the rewritten manifest's
mtime well past the lockfile's so the second install reads it as a
genuine later edit, matching what a user editing the manifest at a later
time would produce. The assertions still exercise the real
stale-pin-refresh behavior.
Copilot AI review requested due to automatic review settings July 13, 2026 14:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zkochan has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit de70242

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

Blacksmith's Windows runners run Windows Server 2025; the valid labels
are blacksmith-<N>vcpu-windows-2025. The windows-2022 label matches no
runner, so the Windows test legs would queue forever. Point them at the
windows-2025 label instead.
Copilot AI review requested due to automatic review settings July 13, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zkochan has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit ca08258

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

The two build-pnpr legs compile the pnpr binaries the TS test jobs
consume; they gate those tests but were still on GitHub-hosted runners.
Move them onto the same Blacksmith 8vcpu labels as the test jobs
(ubuntu-2404 / windows-2025). build-pnpr.yml keys its disk-cleanup gate,
cache, and artifact name off `runner.os`, which is unaffected by the
label change.
Copilot AI review requested due to automatic review settings July 13, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zkochan has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 085a71c

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.54%. Comparing base (d3e1383) to head (085a71c).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12969      +/-   ##
==========================================
+ Coverage   85.26%   85.54%   +0.28%     
==========================================
  Files         486      494       +8     
  Lines       77280    78828    +1548     
==========================================
+ Hits        65890    67432    +1542     
- Misses      11390    11396       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zkochan
zkochan merged commit 81cbd50 into main Jul 13, 2026
28 of 29 checks passed
@zkochan
zkochan deleted the use-blacksmith branch July 13, 2026 15:09
@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.01     23.5±2.15ms    15.9 MB/sec    1.00     23.2±0.76ms    16.1 MB/sec
packument/parse                1.00     79.4±1.19µs   835.2 MB/sec    1.00     79.4±1.13µs   835.0 MB/sec
tarball/download_dependency    1.00      6.6±0.13ms   658.6 KB/sec    1.01      6.6±0.13ms   653.4 KB/sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants