Skip to content

ci(ai-validation): skip prepare on Mergify-authored PRs (backport #2043)#2044

Merged
andamasov merged 1 commit into
circinusfrom
mergify/bp/circinus/pr-2043
May 14, 2026
Merged

ci(ai-validation): skip prepare on Mergify-authored PRs (backport #2043)#2044
andamasov merged 1 commit into
circinusfrom
mergify/bp/circinus/pr-2043

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented May 14, 2026

Summary

  • Lifts the existing Mergify-author short-circuit to a job-level `if:` on `prepare`, so the whole AI Validation pipeline skips for Mergify backport/queue PRs.
  • Fixes the `fatal: FETCH_HEAD...HEAD: no merge base` crash that occurs when a backport's merge ref shares no shallow ancestor with the (advanced) base branch — concrete example: run 25842928620 on vyos-documentation#2042 (sagitta backport of vyos-documentation#2023).

The validate-level skip in vyos-documentation@0e8a2956 was correct for the upstream `claude-code-action` rejecting bot-initiated runs, but fires too late — `prepare` has already run and crashed before validate's `if: needs.prepare.outputs.has_md_changes == 'true'` even evaluates.

Backport

  • circinus
  • sagitta

Test plan

  • Once merged + auto-backported, re-run AI Validation on vyos-documentation#2042; prepare + validate should both show as skipped, no red check.
  • Next Mergify backport on any branch shows `prepare` and `validate` skipped (not failing).
  • Human-authored PR on rolling still triggers prepare + validate normally.

🤖 Generated by robots


This is an automatic backport of pull request #2043 done by Mergify.

Lifts the existing Mergify-author short-circuit (today inside validate's
`secrets-check` step) to a job-level `if:` on `prepare`, so the whole
pipeline skips for backport/queue PRs.

Why now: every Mergify backport whose merge ref shares no shallow
ancestor with the (advanced) base branch fails the prepare step at

  git diff "$BASE...HEAD" --name-only ...
  fatal: FETCH_HEAD...HEAD: no merge base

(because base is `git fetch --no-tags --depth=1` and the merge ref is
`fetch-depth: 2`). Proximate symptom: run 25842928620 on PR #2042
(sagitta backport of #2023). AI Validation isn't a required check so
the queue isn't blocked, but every Mergify backport is left with a red
"prepare" check that adds noise to PR review.

The validate-level skip in commit 0e8a295 was correct for the
"claude-code-action rejects bot-initiated runs" failure mode but
fires too late — prepare has already run and crashed before validate's
`if: needs.prepare.outputs.has_md_changes == 'true'` even evaluates.

Implementation: single job-level `if:` on prepare. validate's
`needs: [prepare]` cascades the skip naturally (skipped needs make
the dependent's expression-based `if:` evaluate against empty outputs).
The in-step author check in validate stays as defense-in-depth.

🤖 Generated by [robots](https://vyos.io)

(cherry picked from commit 7d94d61)
@andamasov andamasov merged commit 132ff0e into circinus May 14, 2026
7 of 8 checks passed
@andamasov andamasov deleted the mergify/bp/circinus/pr-2043 branch May 14, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant