Skip to content

ci: shadow typecheck/unit/integration jobs on Blacksmith#1744

Open
gantoine wants to merge 3 commits intomainfrom
georges/blacksmith-matrix
Open

ci: shadow typecheck/unit/integration jobs on Blacksmith#1744
gantoine wants to merge 3 commits intomainfrom
georges/blacksmith-matrix

Conversation

@gantoine
Copy link
Copy Markdown
Member

Summary

  • Adds a runner matrix dimension to typecheck, unit-test, and integration-test so each job can run head-to-head on GitHub-hosted and Blacksmith runners for apples-to-apples comparison data. Inspired by PostHog/posthog#54559.
  • Gated behind repo variable BLACKSMITH_SHADOW_ENABLED so shadows can be toggled without a code change. Pairs ubuntu-latestblacksmith-4vcpu-ubuntu-2404 and macos-latestblacksmith-6vcpu-macos-latest.
  • Shadow entries are continue-on-error: true so Blacksmith failures don't block PRs. Cache keys are scoped to matrix.runner to avoid cross-runner poisoning, and the Playwright report only uploads from the macos-latest primary.

Before this is useful

  • Set repo variable BLACKSMITH_SHADOW_ENABLED=true in Settings → Variables → Actions.
  • Install the Blacksmith GitHub App on the repo.
  • Update branch protection: matrix expansion renames required checks (e.g. typechecktypecheck (ubuntu-latest)), and Blacksmith entries should be excluded from required checks.

Test plan

  • Leave BLACKSMITH_SHADOW_ENABLED unset and confirm this PR's CI still runs exactly one entry per job (original behavior).
  • After flipping the flag, confirm both runners pick up jobs and produce paired durations on the same SHA.
  • Confirm the Playwright report artifact uploads only once on failure (from macos-latest).

🤖 Generated with Claude Code

Gated behind repo variable BLACKSMITH_SHADOW_ENABLED so shadow runs can
be toggled without a code change. Pairs ubuntu-latest with
blacksmith-4vcpu-ubuntu-2404 and macos-latest with
blacksmith-6vcpu-macos-latest. Shadow entries are continue-on-error so
Blacksmith failures don't block PRs, cache keys are scoped to
matrix.runner to avoid cross-runner cache poisoning, and the Playwright
report only uploads from the macos-latest primary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 20, 2026

Reviews (1): Last reviewed commit: "ci: shadow typecheck/unit/integration jo..." | Re-trigger Greptile

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds “shadow” CI executions so typecheck/unit/integration jobs can run in parallel on GitHub-hosted vs Blacksmith runners (optionally enabled via BLACKSMITH_SHADOW_ENABLED) to compare performance and reliability without blocking PRs.

Changes:

  • Introduces a runner matrix for typecheck, unit-test, and integration-test, gated by vars.BLACKSMITH_SHADOW_ENABLED.
  • Marks Blacksmith matrix entries as continue-on-error and disables fail-fast for the matrix.
  • Scopes Playwright/Electron cache keys to matrix.runner and restricts Playwright report uploads to the primary macOS runner.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/typecheck.yml Adds runner matrix + shadow execution for typecheck on Blacksmith.
.github/workflows/test.yml Adds runner matrices for unit/integration; adjusts caching and Playwright artifact upload behavior for shadows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/typecheck.yml
Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml
Copy link
Copy Markdown
Member

@charlesvien charlesvien left a comment

Choose a reason for hiding this comment

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

LGTM! TY!

actions/setup-node's built-in pnpm cache keys on runner.os, so
ubuntu-latest and blacksmith-4vcpu-ubuntu-2404 (and the macOS pair)
would share a cache entry and contaminate the shadow comparison.
Replace with an explicit actions/cache keyed by matrix.runner, matching
the Playwright/Electron cache pattern in test.yml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gantoine gantoine requested a review from Copilot April 21, 2026 10:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +57 to +62
strategy:
fail-fast: false
matrix:
runner: ${{ fromJSON(vars.BLACKSMITH_SHADOW_ENABLED == 'true' && '["macos-latest","blacksmith-6vcpu-macos-latest"]' || '["macos-latest"]') }}
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.runner != 'macos-latest' }}
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

Same as for unit-test: without an explicit job name, the matrix-expanded check will typically show up as integration-test (runner: …), not integration-test (macos-latest). Consider adding a name that includes matrix.runner so required check names are clear and match the PR’s guidance.

Copilot uses AI. Check for mistakes.
@gantoine
Copy link
Copy Markdown
Member Author

@copilot why are the 3 pending checks not reporting?

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

@copilot why are the 3 pending checks not reporting?

The root cause is that GitHub's matrix strategy automatically appends (ubuntu-latest) / (macos-latest) to job names — even when there's only a single entry in the matrix (i.e. shadow disabled). Branch protection rules still expect the original names (typecheck, unit-test, integration-test), so those required checks are never satisfied and stay "pending".

Fixed in 760791c by adding an explicit name: to each job that evaluates to the original name for the primary runner and to <job> (<runner>) for Blacksmith shadows:

name: ${{ matrix.runner == 'ubuntu-latest' && 'typecheck' || format('typecheck ({0})', matrix.runner) }}

This keeps required check names stable whether shadow is on or off, and gives shadow entries a distinct name so they don't conflict.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants