From 1836feda3908c8c345da11871106c77b763e8f1f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:29:33 +0000 Subject: [PATCH 1/5] Initial plan From 3375235ae730c3b9906b4ad2e44742f54a3ae528 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:31:47 +0000 Subject: [PATCH 2/5] Add skip-performance-check label support for PRs and merge groups Co-authored-by: Haydnspass <16120273+Haydnspass@users.noreply.github.com> --- .github/workflows/performance.yml | 50 +++++++++++++++++++++++++++++++ README.md | 14 +++++++++ 2 files changed, 64 insertions(+) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 35cfa18..272b750 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -11,6 +11,7 @@ on: permissions: contents: read + pull-requests: read jobs: compute-baseline: @@ -84,6 +85,48 @@ jobs: if: always() && (github.event_name == 'pull_request' || github.event_name == 'merge_group') && needs.compute-baseline.result == 'success' steps: + - name: Check for skip-performance-check label + id: check-label + env: + GH_TOKEN: ${{ github.token }} + run: | + SKIP_EVAL="false" + + if [ "${{ github.event_name }}" == "pull_request" ]; then + # For pull_request events, check labels directly + LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}' + if echo "$LABELS" | grep -q "skip-performance-check"; then + echo "Label 'skip-performance-check' found on PR" + SKIP_EVAL="true" + fi + elif [ "${{ github.event_name }}" == "merge_group" ]; then + # For merge_group events, extract PR number from head_ref and check its labels + # head_ref format is typically: refs/heads/gh-readonly-queue/{base_branch}/pr-{number}-{sha} + HEAD_REF="${{ github.event.merge_group.head_ref }}" + echo "Merge group head_ref: $HEAD_REF" + + # Extract PR number from the head_ref + if [[ "$HEAD_REF" =~ pr-([0-9]+)- ]]; then + PR_NUMBER="${BASH_REMATCH[1]}" + echo "Extracted PR number: $PR_NUMBER" + + # Use GitHub CLI to fetch PR labels + PR_LABELS=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name' 2>/dev/null || echo "") + + if echo "$PR_LABELS" | grep -q "skip-performance-check"; then + echo "Label 'skip-performance-check' found on PR #$PR_NUMBER (from merge group)" + SKIP_EVAL="true" + else + echo "Label 'skip-performance-check' not found on PR #$PR_NUMBER" + fi + else + echo "Could not extract PR number from head_ref: $HEAD_REF" + fi + fi + + echo "skip_eval=$SKIP_EVAL" >> $GITHUB_OUTPUT + echo "Skip evaluation: $SKIP_EVAL" + - name: Checkout code uses: actions/checkout@v5 @@ -110,4 +153,11 @@ jobs: path: ./baseline - name: Evaluate performance + if: steps.check-label.outputs.skip_eval != 'true' run: evaluate ./baseline/performance_result.json ./candidate/performance_result.json + + - name: Skip evaluation (label present) + if: steps.check-label.outputs.skip_eval == 'true' + run: | + echo "⚠️ Performance evaluation skipped due to 'skip-performance-check' label" + echo "The evaluation step was bypassed and will not block merging" diff --git a/README.md b/README.md index fe7d6f5..b927913 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,20 @@ The repository includes a GitHub Actions workflow (`.github/workflows/performanc - Runs `compute` on the PR branch (candidate) - Runs `compute` on the main branch (baseline) - Runs `evaluate` to compare candidate vs baseline +3. **On Merge Queue**: Runs the same evaluation as pull requests + +#### Skipping Performance Evaluation + +You can skip the performance evaluation for a specific PR by adding the `skip-performance-check` label to the PR. This is useful when: +- You know the performance regression is expected and acceptable +- You're making changes that don't affect performance (e.g., documentation) +- The performance test is flaky or not relevant for the change + +**How it works:** +- **For Pull Requests**: Add the `skip-performance-check` label to the PR. The evaluation step will be skipped and will not block merging. +- **For Merge Queue**: The label must be present on the PR before it enters the merge queue. The workflow will check the PR's labels even when running in the merge group context. + +When the label is present, the evaluation job still runs but skips the actual performance comparison, allowing the PR to merge even if performance has regressed. ### Installation From 93980e34e991b993ebb4d166021a549cabac0268 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:32:34 +0000 Subject: [PATCH 3/5] Fix gh pr view command and checkout order for proper repository context Co-authored-by: Haydnspass <16120273+Haydnspass@users.noreply.github.com> --- .github/workflows/performance.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 272b750..fad4eed 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -85,6 +85,9 @@ jobs: if: always() && (github.event_name == 'pull_request' || github.event_name == 'merge_group') && needs.compute-baseline.result == 'success' steps: + - name: Checkout code + uses: actions/checkout@v5 + - name: Check for skip-performance-check label id: check-label env: @@ -111,7 +114,7 @@ jobs: echo "Extracted PR number: $PR_NUMBER" # Use GitHub CLI to fetch PR labels - PR_LABELS=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name' 2>/dev/null || echo "") + PR_LABELS=$(gh pr view "$PR_NUMBER" --repo ${{ github.repository }} --json labels --jq '.labels[].name' 2>/dev/null || echo "") if echo "$PR_LABELS" | grep -q "skip-performance-check"; then echo "Label 'skip-performance-check' found on PR #$PR_NUMBER (from merge group)" @@ -127,9 +130,6 @@ jobs: echo "skip_eval=$SKIP_EVAL" >> $GITHUB_OUTPUT echo "Skip evaluation: $SKIP_EVAL" - - name: Checkout code - uses: actions/checkout@v5 - - name: Set up Python uses: actions/setup-python@v5 with: From 952f99df26187eacc64f197dabce8ac39e79efc6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:33:25 +0000 Subject: [PATCH 4/5] Fix label extraction syntax and improve error handling for gh pr view Co-authored-by: Haydnspass <16120273+Haydnspass@users.noreply.github.com> --- .github/workflows/performance.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index fad4eed..b193018 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -97,7 +97,7 @@ jobs: if [ "${{ github.event_name }}" == "pull_request" ]; then # For pull_request events, check labels directly - LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}' + LABELS='${{ toJSON(github.event.pull_request.labels[*].name) }}' if echo "$LABELS" | grep -q "skip-performance-check"; then echo "Label 'skip-performance-check' found on PR" SKIP_EVAL="true" @@ -114,13 +114,15 @@ jobs: echo "Extracted PR number: $PR_NUMBER" # Use GitHub CLI to fetch PR labels - PR_LABELS=$(gh pr view "$PR_NUMBER" --repo ${{ github.repository }} --json labels --jq '.labels[].name' 2>/dev/null || echo "") - - if echo "$PR_LABELS" | grep -q "skip-performance-check"; then - echo "Label 'skip-performance-check' found on PR #$PR_NUMBER (from merge group)" - SKIP_EVAL="true" + if PR_LABELS=$(gh pr view "$PR_NUMBER" --repo ${{ github.repository }} --json labels --jq '.labels[].name' 2>&1); then + if echo "$PR_LABELS" | grep -q "skip-performance-check"; then + echo "Label 'skip-performance-check' found on PR #$PR_NUMBER (from merge group)" + SKIP_EVAL="true" + else + echo "Label 'skip-performance-check' not found on PR #$PR_NUMBER" + fi else - echo "Label 'skip-performance-check' not found on PR #$PR_NUMBER" + echo "Warning: Could not fetch PR labels for PR #$PR_NUMBER: $PR_LABELS" fi else echo "Could not extract PR number from head_ref: $HEAD_REF" From ea2bbd1979202c019e0c950b21b1705aa3b81e2b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:34:06 +0000 Subject: [PATCH 5/5] Improve label parsing and error handling with proper stderr separation Co-authored-by: Haydnspass <16120273+Haydnspass@users.noreply.github.com> --- .github/workflows/performance.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index b193018..d646040 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -97,8 +97,9 @@ jobs: if [ "${{ github.event_name }}" == "pull_request" ]; then # For pull_request events, check labels directly - LABELS='${{ toJSON(github.event.pull_request.labels[*].name) }}' - if echo "$LABELS" | grep -q "skip-performance-check"; then + # Convert labels array to JSON and extract names + LABELS='${{ toJSON(github.event.pull_request.labels) }}' + if echo "$LABELS" | jq -r '.[].name' | grep -q "skip-performance-check"; then echo "Label 'skip-performance-check' found on PR" SKIP_EVAL="true" fi @@ -114,7 +115,12 @@ jobs: echo "Extracted PR number: $PR_NUMBER" # Use GitHub CLI to fetch PR labels - if PR_LABELS=$(gh pr view "$PR_NUMBER" --repo ${{ github.repository }} --json labels --jq '.labels[].name' 2>&1); then + set +e # Don't exit on error + PR_LABELS=$(gh pr view "$PR_NUMBER" --repo ${{ github.repository }} --json labels --jq '.labels[].name' 2>/tmp/gh_error.log) + GH_EXIT_CODE=$? + set -e # Re-enable exit on error + + if [ $GH_EXIT_CODE -eq 0 ]; then if echo "$PR_LABELS" | grep -q "skip-performance-check"; then echo "Label 'skip-performance-check' found on PR #$PR_NUMBER (from merge group)" SKIP_EVAL="true" @@ -122,7 +128,11 @@ jobs: echo "Label 'skip-performance-check' not found on PR #$PR_NUMBER" fi else - echo "Warning: Could not fetch PR labels for PR #$PR_NUMBER: $PR_LABELS" + echo "Warning: Could not fetch PR labels for PR #$PR_NUMBER (exit code: $GH_EXIT_CODE)" + if [ -s /tmp/gh_error.log ]; then + echo "Error details:" + cat /tmp/gh_error.log + fi fi else echo "Could not extract PR number from head_ref: $HEAD_REF"