From 36358f4447be5ace9ec8b4d4d6f8a7c247f500da Mon Sep 17 00:00:00 2001 From: Weston Pace Date: Fri, 19 Dec 2025 05:54:10 -0800 Subject: [PATCH 1/2] Add workflow to listen to comments for benchmark requests --- .../workflows/benchmark-comment-trigger.yml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/benchmark-comment-trigger.yml diff --git a/.github/workflows/benchmark-comment-trigger.yml b/.github/workflows/benchmark-comment-trigger.yml new file mode 100644 index 00000000000..3f2cbd9c1e0 --- /dev/null +++ b/.github/workflows/benchmark-comment-trigger.yml @@ -0,0 +1,51 @@ +# This workflow is used to trigger benchmarks on a PR when a specific comment is added +# to the PR. The workflow runs on all PR comments containing the string 'benchmark' +# and the string '@bench-bot'. The workflow collects some information about the PR +# and then forwards the information to the lance-bench workflow. +# +# The lance-bench repository is a public repository in the lancedb organization which +# runs benchmarks against the Lance repository on a regular basis and stores the results +# in a historical database. + +name: Benchmark Comment Trigger + +on: + issue_comment: + types: [created] + +jobs: + forward-to-bench: + # Only process comments on PRs that mention @bench-bot and contain 'benchmark' + if: | + github.event.issue.pull_request != null && + contains(github.event.comment.body, '@bench-bot') && + contains(github.event.comment.body, 'benchmark') + runs-on: ubuntu-latest + steps: + - name: Get PR details + id: pr + uses: actions/github-script@v7 + with: + script: | + const pr = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }); + + core.setOutput('head_sha', pr.data.head.sha); + + - name: Forward to lance-bench + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.LANCE_BENCH_DISPATCH_TOKEN }} + repository: westonpace/lance-bench + event-type: pr-comment + client-payload: | + { + "comment_body": ${{ toJson(github.event.comment.body) }}, + "comment_user": "${{ github.event.comment.user.login }}", + "pr_number": ${{ github.event.issue.number }}, + "pr_head_sha": "${{ steps.pr.outputs.head_sha }}", + "repository": "${{ github.repository }}" + } From ae726c443055081163680597d05a700975e75d99 Mon Sep 17 00:00:00 2001 From: Weston Pace Date: Fri, 19 Dec 2025 06:01:28 -0800 Subject: [PATCH 2/2] Use correct repo --- .github/workflows/benchmark-comment-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark-comment-trigger.yml b/.github/workflows/benchmark-comment-trigger.yml index 3f2cbd9c1e0..1259f4faa05 100644 --- a/.github/workflows/benchmark-comment-trigger.yml +++ b/.github/workflows/benchmark-comment-trigger.yml @@ -39,7 +39,7 @@ jobs: uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.LANCE_BENCH_DISPATCH_TOKEN }} - repository: westonpace/lance-bench + repository: lancedb/lance-bench event-type: pr-comment client-payload: | {