bencher: Clone thresholds from main (#38220)

When running bencher on pull requests or try, we want to clone any
thresholds we setup for main to detect regressions.
Note: The thresholds we are actually interested in are defined on the
production profile, while in PRs we currently test release. Probably we
should reconsider that, but perhaps that could be a different PR with
seperate discussion.

Testing: ./mach try
([ohos](https://github.com/servo/servo/actions/runs/16779272577))

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Jonathan Schwender 2025-08-06 19:34:40 +02:00 committed by GitHub
parent e31dcc95f9
commit 0233ad5e40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 4 deletions

View file

@ -116,6 +116,7 @@ jobs:
--branch-start-point ${{ github.base_ref }} \ --branch-start-point ${{ github.base_ref }} \
--branch-start-point-hash ${{ github.event.pull_request.base.sha }} \ --branch-start-point-hash ${{ github.event.pull_request.base.sha }} \
--branch-reset \ --branch-reset \
--start-point-clone-thresholds \
--github-actions ${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV" --github-actions ${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
- name: Set bencher opts for main - name: Set bencher opts for main
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
@ -132,6 +133,7 @@ jobs:
--hash $(git rev-parse HEAD~1) \ --hash $(git rev-parse HEAD~1) \
--branch-start-point main \ --branch-start-point main \
--branch-start-point-hash $(git merge-base upstream/main HEAD) \ --branch-start-point-hash $(git merge-base upstream/main HEAD) \
--start-point-clone-thresholds \
--branch-reset" >> "$GITHUB_ENV" --branch-reset" >> "$GITHUB_ENV"
# we join results and send all data once to have it all in one report # we join results and send all data once to have it all in one report
- name: Send results - name: Send results

View file

@ -269,14 +269,14 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
if: github.event_name != 'pull_request_target' if: github.event_name != 'pull_request_target'
with: with:
fetch-depth: 2 fetch-depth: 0
# This is necessary to checkout the pull request if this run was triggered via a # This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event. # `pull_request_target` event.
- uses: actions/checkout@v4 - uses: actions/checkout@v4
if: github.event_name == 'pull_request_target' if: github.event_name == 'pull_request_target'
with: with:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2 fetch-depth: 0
- name: Setup Python - name: Setup Python
uses: ./.github/actions/setup-python uses: ./.github/actions/setup-python
- name: Getting hitrace-bench version - name: Getting hitrace-bench version
@ -301,15 +301,41 @@ jobs:
- name: Combining bencher files - name: Combining bencher files
run: jq --compact-output --slurp add speedometer.json bench.json > combined-bencher.json run: jq --compact-output --slurp add speedometer.json bench.json > combined-bencher.json
- uses: bencherdev/bencher@main - uses: bencherdev/bencher@main
# set options
- name: Set bencher opts for PRs (label try run)
if: github.event_name == 'pull_request_target'
run: |
echo "RUN_BENCHER_OPTIONS=--branch ${{ github.event.number }}/PR \
--branch-start-point ${{ github.base_ref }} \
--branch-start-point-hash ${{ github.event.pull_request.base.sha }} \
--branch-reset \
--start-point-clone-thresholds" >> "$GITHUB_ENV"
- name: Set bencher opts for main
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
run: |
echo "RUN_BENCHER_OPTIONS=--branch main" >> "$GITHUB_ENV"
- name: Set bencher opts for try branch
if: ${{ github.event_name == 'push' && github.ref_name == 'try' }}
run: |
git remote add upstream https://github.com/servo/servo
git fetch upstream main
echo "RUN_BENCHER_OPTIONS=--branch try \
--hash $(git rev-parse HEAD~1) \
--branch-start-point main \
--branch-start-point-hash $(git merge-base upstream/main HEAD) \
--start-point-clone-thresholds \
--branch-reset" >> "$GITHUB_ENV"
- name: Uploading to bencher.dev - name: Uploading to bencher.dev
# Note: That e.g. `--start-point` is ignored if it is an empty string,
# which should be the case on e.g. normal push workflows on main.
run: | run: |
bencher run --adapter json \ bencher run --adapter json \
--file combined-bencher.json \ --file combined-bencher.json \
--project '${{ env.BENCHER_PROJECT }}' \ --project '${{ env.BENCHER_PROJECT }}' \
--hash '${{ github.sha }}' \
--token '${{ secrets.BENCHER_API_TOKEN }}' \ --token '${{ secrets.BENCHER_API_TOKEN }}' \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \
--testbed="$MODEL_NAME" --testbed="$MODEL_NAME" \
$RUN_BENCHER_OPTIONS
- name: Success - name: Success
if: ${{ !contains(steps.*.outcome, 'failure') && !contains(steps.*.outcome, 'cancelled') }} if: ${{ !contains(steps.*.outcome, 'failure') && !contains(steps.*.outcome, 'cancelled') }}
run: exit 0 run: exit 0