@@ -28,8 +28,10 @@ A custom Git command for managing pull requests. You can run it as
2828 - [ Usage] ( #usage )
2929 - [ ` git node status ` ] ( #git-node-status )
3030 - [ Example] ( #example-2 )
31- - [ ` git node wpt ` ] ( #git-node-wpt )
31+ - [ ` git node benchmark ` ] ( #git-node-benchmark )
3232 - [ Example] ( #example-3 )
33+ - [ ` git node wpt ` ] ( #git-node-wpt )
34+ - [ Example] ( #example-4 )
3335
3436## ` git node land `
3537
@@ -568,6 +570,66 @@ Upstream: upstream
568570Branch: main
569571```
570572
573+ ## ` git node benchmark `
574+
575+ Trigger the [ ` benchmark.yml ` ] [ ] GitHub Actions workflow on a pull request. The
576+ command fetches the PR, then prompts you to pick which benchmark categories to
577+ run (the folders in [ ` benchmark/ ` ] [ ] at the PR head). Categories whose files are
578+ touched by the PR are checked by default; if the PR touches no benchmark file,
579+ the pre-selection is guessed from the PR's subsystem labels. You are then prompted for an optional
580+ filter substring; if the PR touches a single benchmark file and only that file's
581+ category is selected, the filter is pre-filled with that file's name. Finally you
582+ are asked whether the workflow should post the results as a comment on the PR. It
583+ then dispatches the workflow with the PR number and its head commit.
584+
585+ ```
586+ git-node benchmark <identifier>
587+
588+ Trigger the benchmark GitHub Actions workflow for a pull request
589+
590+ Positionals:
591+ identifier ID or URL of the pull request; a commit URL
592+ (…/pull/<id>/commits/<sha>) benchmarks that commit [string] [required]
593+
594+ Options:
595+ --version Show version number [boolean]
596+ --help Show help [boolean]
597+ --owner, -o GitHub owner of the PR repository [string] [default: "nodejs"]
598+ --repo, -r GitHub repository of the PR [string] [default: "node"]
599+ --workflow-owner GitHub owner of the repository hosting the benchmark workflow
600+ (defaults to the PR owner) [string]
601+ --workflow-repo GitHub repository hosting the benchmark workflow (defaults to the PR
602+ repository) [string]
603+ --workflow The workflow file to dispatch [string] [default: "benchmark.yml"]
604+ --ref The git ref of the workflow repository to run the workflow from
605+ [string] [default: "main"]
606+ --runs How many times to repeat each benchmark [number]
607+ ```
608+
609+ The workflow is dispatched on the PR's repository by default. When the workflow
610+ lives in a different repository (for example a fork that hosts ` benchmark.yml ` ),
611+ pass ` --workflow-owner ` /` --workflow-repo ` , and the PR repository is forwarded to
612+ the workflow so it fetches the PR from the right place.
613+
614+ ### Example
615+
616+ ``` bash
617+ # Interactively pick benchmark categories to run on nodejs/node#12344
618+ # (categories touched by the PR are pre-selected)
619+ $ git node benchmark 12344
620+ # is equivalent to
621+ $ git node benchmark https://github.com/nodejs/node/pull/12344
622+
623+ # Repeat each benchmark 10 times (the filter is asked interactively)
624+ $ git node benchmark 12344 --runs 10
625+
626+ # Dispatch the workflow hosted on a fork for a nodejs/node PR
627+ $ git node benchmark 12344 --workflow-owner my-user --workflow-repo node
628+
629+ # Benchmark a specific PR commit instead of the current PR head
630+ $ git node benchmark https://github.com/nodejs/node/pull/12344/commits/abc1234
631+ ```
632+
571633## ` git node wpt `
572634
573635Update or patch the Web Platform Tests in core.
@@ -603,3 +665,5 @@ $ git node wpt url --commit=43feb7f612fe9160639e09a47933a29834904d69
603665
604666[ node.js abi version registry ] : https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
605667[ Security Release Process ] : https://github.com/nodejs/node/blob/main/doc/contributing/security-release-process.md
668+ [ `benchmark.yml` ] : https://github.com/nodejs/node/blob/main/.github/workflows/benchmark.yml
669+ [ `benchmark/` ] : https://github.com/nodejs/node/tree/main/benchmark
0 commit comments