From 3cd9ce12aad606c078b6551ae0f4c7f84047f447 Mon Sep 17 00:00:00 2001 From: CleverThis Date: Wed, 29 Apr 2026 22:13:23 +0000 Subject: [PATCH] fix(ci): restore benchmark-regression trigger to pull_request events in master.yml The benchmark-regression job was missing from master.yml entirely. Since master.yml triggers on both push and pull_request events, adding the job here with the guard if: forgejo.event_name == 'pull_request' ensures it runs on PRs. The job syncs prior ASV results from S3 (gracefully skips if credentials are not configured), runs nox -s benchmark_regression, and uploads the log as an artifact. It is intentionally NOT added to status-check's required needs list so that benchmark regressions are informational and do not block PR merges. ISSUES CLOSED: #10716 --- .forgejo/workflows/master.yml | 53 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 8 ++++++ 2 files changed, 61 insertions(+) diff --git a/.forgejo/workflows/master.yml b/.forgejo/workflows/master.yml index 17d94b728..522496ddd 100644 --- a/.forgejo/workflows/master.yml +++ b/.forgejo/workflows/master.yml @@ -71,3 +71,56 @@ jobs: name: asv-results-pr path: /tmp/asv-results.tar retention-days: 30 + + benchmark-regression: + # Runs benchmark regression on pull requests to detect performance regressions. + # This job is informational only — it is NOT listed in status-check's required + # needs, so a benchmark regression does not block PR merges. + if: forgejo.event_name == 'pull_request' + runs-on: docker-benchmark + container: ${{vars.docker_prefix}}python:3.13-slim + steps: + - name: Install system dependencies (nodejs for checkout, git for ASV) + run: | + apt-get update && apt-get install -y -qq nodejs git curl && rm -rf /var/lib/apt/lists/* + + - name: Checkout full history + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install asv virtualenv uv=${{ env.UV_VERSION }} nox + + - name: Sync prior benchmark results from S3 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + ASV_S3_BUCKET: ${{ secrets.ASV_S3_BUCKET }} + run: | + if [ -n "${AWS_ACCESS_KEY_ID}" ] && [ -n "${ASV_S3_BUCKET}" ]; then + python -m pip install awscli + mkdir -p build/asv/results + aws s3 sync "s3://${ASV_S3_BUCKET}/asv/results/" build/asv/results/ || echo "No existing results to sync" + else + echo "Skipping S3 sync - AWS credentials not configured" + fi + + - name: Run benchmark regression via nox + env: + NOX_DEFAULT_VENV_BACKEND: uv + ASV_BASE_SHA: master + run: | + mkdir -p build + nox -s benchmark_regression 2>&1 | tee build/nox-benchmark-regression-output.log + + - name: Upload benchmark regression log artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: benchmark-regression-logs + path: build/nox-benchmark-regression-output.log + retention-days: 30 diff --git a/CHANGELOG.md b/CHANGELOG.md index 93920ae18..4e10c52da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +### Changed + +- Restored `benchmark-regression` CI job to `master.yml` with `pull_request` trigger guard + (`if: forgejo.event_name == 'pull_request'`). The job was previously absent from + `master.yml`, causing benchmark regression testing to never run on PRs. The job is + informational only and is not in `status-check`'s required needs list. (Closes #10716) + + ### Changed - **CI coverage job now waits for unit_tests** (#10714): Added `unit_tests` to the -- 2.52.0