Repository navigation
Dispatch typecheck benchmark workflow directly - #11674
Conversation
|
🔒 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 |
There was a problem hiding this comment.
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.
|
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. |
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
|
Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. |
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:
/benchmarkcomment, which causes a trusted workflow to dispatch the benchmark workflow with explicit PR details, rather than toggling a label. This removes the need for therun-typecheck-benchmarklabel and associated label management logic. (.github/workflows/typecheck_benchmark_trigger.yml,build/benchmark/README.md) [1] [2]actions: writeis now explicitly granted, and unnecessary write permissions forissuesandpull-requestshave been removed. (.github/workflows/typecheck_benchmark_trigger.yml)Benchmark Workflow Refactoring:
typecheck_benchmark_pr.yml) is now only triggered viaworkflow_dispatchwith 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].github/workflows/typecheck_benchmark_pr.yml)Benchmark Result Commenting:
.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.