Skip to content

Dispatch typecheck benchmark workflow directly - #11674

Merged
Bill Schnurr (bschnurr) merged 3 commits into
mainfrom
fix-benchmark-workflow-dispatch
Aug 24, 2026
Merged

Bill Schnurr (bschnurr) merged 3 commits into
mainfrom
fix-benchmark-workflow-dispatch

Conversation

@bschnurr

Copy link
Copy Markdown
Member

This pull request refactors the type checker benchmark GitHub Actions workflows to improve security and reliability. The main change is to replace the label-based trigger for running benchmarks with a workflow dispatch model, where a trusted workflow dispatches the benchmark run with explicit inputs. This ensures that only authorized users can trigger benchmarks and that the correct commits are benchmarked and reported.

Key changes include:

Workflow Triggering and Permissions:

  • The benchmark is now triggered by a /benchmark comment, which causes a trusted workflow to dispatch the benchmark workflow with explicit PR details, rather than toggling a label. This removes the need for the run-typecheck-benchmark label and associated label management logic. (.github/workflows/typecheck_benchmark_trigger.yml, build/benchmark/README.md) [1] [2]
  • Permissions on the trigger workflow have been tightened: actions: write is now explicitly granted, and unnecessary write permissions for issues and pull-requests have been removed. (.github/workflows/typecheck_benchmark_trigger.yml)

Benchmark Workflow Refactoring:

  • The benchmark workflow (typecheck_benchmark_pr.yml) is now only triggered via workflow_dispatch with required inputs for PR number, head SHA, base SHA, and head repository, instead of responding to label events. The workflow checks out the correct PR and baseline commits using these inputs. (.github/workflows/typecheck_benchmark_pr.yml) [1] [2]
  • Artifact names now include the PR number and head SHA to uniquely identify benchmark results per commit. (.github/workflows/typecheck_benchmark_pr.yml)

Benchmark Result Commenting:

  • The workflow that comments benchmark results has been updated to support both PR and workflow dispatch events, and to correctly locate the relevant artifact and PR for each case. (.github/workflows/typecheck_benchmark_comment.yml) [1] [2]

These changes collectively make the benchmark process more robust, auditable, and secure by ensuring only trusted users can dispatch benchmarks and by tightly coupling benchmark runs to specific PR commits.

@rchiodo

Copy link
Copy Markdown
Collaborator

🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR.

ref: ${{ inputs.base_sha }}
path: benchmark-baseline
sparse-checkout: build/benchmark/baselines
persist-credentials: false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Warning · Non-blocking recommendation

Manual workflow dispatch can provide a base SHA unrelated to the PR, while the result consumer validates only the head SHA. Include baseline provenance and validate it against the PR before publishing the comparison so a direct dispatch cannot post a misleading baseline comparison.

@rchiodo

Copy link
Copy Markdown
Collaborator

Update the existing workflow tests that still assert the removed label trigger and dependency caches.

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved via Review Center.

@rchiodo Rich Chiodo (rchiodo) added the review-auto:approved Automated review: no blocking findings (approval posted). label Aug 24, 2026
@rchiodo

Copy link
Copy Markdown
Collaborator

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

@bschnurr
Bill Schnurr (bschnurr) merged commit 99854b7 into main Aug 24, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants