From 15b3d19f38133e33d75fcd40f6cf302d595f6cca Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 14 Apr 2026 19:32:45 +0000 Subject: [PATCH] fix: prevent false-positive backport failure notifications The backport workflow was reporting cherry-pick conflicts when the cherry-pick actually succeeded but update-pr-body.sh failed afterward. With set -euo pipefail (from ci3/source_options), the post-processing failure caused the whole script to exit non-zero, triggering a false 'cherry-pick conflicts' notification and dispatching ClaudeBox unnecessarily. Changes: - Make update-pr-body.sh non-fatal in backport script (the backport itself already succeeded at that point) - Skip merge-train and backport-staging PRs explicitly in backport.yml (they were already filtered by label check, but this avoids running the label_checker job unnecessarily) --- .github/workflows/backport.yml | 6 +++++- scripts/backport_to_staging.sh | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index fa7d2a8cc52d..68b4454d1aa8 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -25,7 +25,11 @@ jobs: backport: needs: [label_checker] name: Backport PR - if: github.event.pull_request.merged == true && needs.label_checker.outputs.state == 'success' + if: >- + github.event.pull_request.merged == true + && needs.label_checker.outputs.state == 'success' + && !startsWith(github.event.pull_request.head.ref, 'merge-train/') + && !startsWith(github.event.pull_request.head.ref, 'backport-to-') runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/scripts/backport_to_staging.sh b/scripts/backport_to_staging.sh index b0f4459a8d77..e43839569277 100755 --- a/scripts/backport_to_staging.sh +++ b/scripts/backport_to_staging.sh @@ -204,8 +204,9 @@ else echo "PR already exists (#$EXISTING_PR)" fi -# Update PR body with commit override markers (same mechanism as merge-trains) +# Update PR body with commit override markers (same mechanism as merge-trains). +# Non-fatal: the backport itself already succeeded at this point. echo "Updating PR body with commit list..." -do_or_dryrun "$root/scripts/merge-train/update-pr-body.sh" "$STAGING_BRANCH" +do_or_dryrun "$root/scripts/merge-train/update-pr-body.sh" "$STAGING_BRANCH" || echo "Warning: Failed to update PR body (non-fatal)" do_or_dryrun echo "Successfully backported PR #$PR_NUMBER to $STAGING_BRANCH"