Skip to content

ci(bugbot): skip bot-authored PRs in bugbot-gate-caller (backend#2647) - #146

Merged
saqlainsyed007 merged 1 commit into
developfrom
fix/2647-bugbot-caller-skip-bots
Aug 27, 2026
Merged

ci(bugbot): skip bot-authored PRs in bugbot-gate-caller (backend#2647)#146
saqlainsyed007 merged 1 commit into
developfrom
fix/2647-bugbot-caller-skip-bots

Conversation

@saqlainsyed007

@saqlainsyed007saqlainsyed007 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

The bugbot job in .github/workflows/bugbot-gate-caller.yml had no if: guard, so it ran on PRs Bugbot never produces a verdict for. On those PRs the reusable callee just polls until wait-seconds and the advisory bugbot / review check stays red forever with no route to green.

Add an if: that skips the two measured classes:

if: github.event.pull_request.user.type != 'Bot' && !startsWith(github.head_ref, 'release-train/')
  • Dependabot PRs are authored by a Bot account (user.type == 'Bot') — the learned Bugbot rule "bugbot-gate-caller must skip bot-authored PRs".
  • Release-train promotions ride release-train/to-staging / to-main. These are authored by a human (LukasWodka, user.type == 'User'), so the head_ref — not the author — is what identifies them. Their commits already passed Bugbot on the source PR; Bugbot does not re-review.

Why this is safe

bugbot / review is advisory, not a required status context (per this caller's own header: step 3 is deliberately not taken). A skipped caller job emits no bugbot / review check, and an absent advisory check blocks nothing — so a Dependabot / promotion PR no longer hangs on a never-arriving verdict. If step 3 ever arms this context as required, that follow-up must make the skip terminate in success (an absent required check would park the PR at "Expected — waiting for status").

Not skipped: hotfix branches

hotfix/* PRs (e.g. backend#778/#779) are human-authored real code that Bugbot does review, so they are deliberately not skipped — suppressing that advice would lose a genuine verdict, and they are not a class that hangs.

Class, not instance

bugbot-gate-caller.yml exists in docs, backend, model-zoo and tracebloc-engine; all four had the same gap and are fixed in sibling PRs.

Evidence

  • python3 -c "import yaml; yaml.safe_load(open(...))" → passes on the edited file.
  • Trigger is pull_request only, so github.event.pull_request and github.head_ref are always in context.
  • actionlint is not installed in this environment (noted, not run).

Closes tracebloc/backend#2647

🤖 Generated with Claude Code


Note

Low Risk
Workflow-only change to an advisory CI job; no application code, auth, or data paths. Main follow-up risk is future branch-protection arming without changing skip semantics.

Overview
Adds an if: guard on the bugbot job so it no longer invokes the reusable bugbot-gate workflow for PRs where Cursor Bugbot never posts a verdict. Those runs previously polled until timeout and left the advisory bugbot / review check stuck red with no way to go green.

The condition skips bot-authored PRs (user.type == 'Bot', e.g. Dependabot) and PRs whose head branch starts with release-train/ (promotion trains whose commits were already reviewed on the source PR). Hotfix and other human-authored branches are not skipped so real Bugbot feedback still runs.

Inline comments document why skipping is safe today because the check is advisory, and note that if bugbot / review becomes a required context, skipped jobs must end in success rather than absent status.

Reviewed by Cursor Bugbot for commit 192f8a1. Bugbot is set up for automated code reviews on this repo. Configure here.

Bugbot never reviews Dependabot PRs and does not re-review release-train
promotion PRs, so the caller polled the callee's wait-seconds and left the
advisory bugbot / review check red forever with no route to a verdict.
Add an if: to the bugbot job skipping Dependabot (user.type == Bot) and
release-train/* promotion branches. The check is advisory, so a skipped
caller job (no bugbot / review context) blocks nothing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@saadqbalsaadqbal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I contributed the bot-author measurement this rests on, and then had to correct it, so the distinction here is worth spelling out because you got it right and it would have been easy not to.

The forward claim — bot-authored PRs never get a Bugbot verdict — is the one that survived. What did not survive is its converse: .github#356 measured 6 of 9 human-authored PRs getting no check at all, and backend#2114 closed with "no discriminator survives the data". So "Bugbot reviews human PRs" is false, and any skip justified by author type alone would be resting on that.

This doesn't. Promotions are identified by head_ref, explicitly because their author is human"authored by a HUMAN (LukasWodka — user.type is 'User', so the head_ref, not the author…)". That's the correct discriminator for that class, and it means the two skips have two independent justifications rather than one over-general one.

The safety argument is the part I'd have probed and it's already exact.bugbot / review is advisory, so an absent check blocks nothing — and then: "If step 3 ever arms this context as required, that follow-up must make the skip terminate in success (an absent required check would park the PR at 'Expected — waiting for status')." That's the required-check trap this org has hit six times in a week, anticipated as a precondition on future work rather than discovered by it. Recording the constraint that would make today's safe change unsafe is the whole difference between a fix and a trap laid for someone else.

Verified the expression is safe given the trigger: the workflow is pull_request:-only, so github.event.pull_request.user.type and github.head_ref are both always populated — no empty-head_ref path where !startsWith('', 'release-train/') would let the job run by accident.

Keeping hotfix/* unskipped is the right narrowing, and the criterion is the right one: "human-authored real code that Bugbot does review… and they are not a class that hangs." The skip is scoped to classes that cannot converge, not classes that are inconvenient — which is what stops this becoming a general-purpose way to silence the gate.

Class fix across docs, backend, model-zoo and tracebloc-engine in sibling PRs. Green, no threads. 👍

@saqlainsyed007
saqlainsyed007 merged commit 7ec4849 into developAug 27, 2026
13 checks passed
@saqlainsyed007
saqlainsyed007 deleted the fix/2647-bugbot-caller-skip-bots branch August 27, 2026 13:38
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@saqlainsyed007@saadqbal@LukasWodka