Uh oh!
There was an error while loading. Please reload this page.
fix(fr-gate): attribute rebase-and-merge commits (blocker for #74) - #75
Merged
Merged
Conversation
Bugbot on #74: GitHub rebase-and-merge REPLAYS a PR's commits unchanged — no (#N) subject, no merge commit — so neither the subject check nor the merge-vouch loop attributes them. They landed in UNATTRIB and would HARD-FAIL the gate for any repo using rebase-and-merge, once fr-gate is armed from @main across all 15 callers. A blocker for #74. Add an authoritative fallback: for a commit the local git heuristics can't place, ask GitHub which PR introduced it (repos/{repo}/commits/{sha}/pulls). A MERGED PR attributes it (covers rebase-merge); a direct push has none and stays flagged. Retries 3x and fails CLOSED on a persistent API error — an unverifiable commit never passes. The local checks stay as fast-paths, so the API is hit only for the residual. Needs a token: added GH_TOKEN (PROJECTS_KANBAN_TOKEN) + REPO to the items step. Decision logic verified with a stubbed gh: merged-PR->attribute, direct-push->flag, API-error->flag(fail-closed). actionlint clean.
LukasWodka
commented
Jul 26, 2026
ContributorAuthor
👋 Heads-up — Code review queue is at 41 / 30 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
LukasWodka
commented
Jul 26, 2026
ContributorAuthor
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 449fce1. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocker for #74 — fixes a fail-closed gate that would break rebase-and-merge repos
Bugbot flagged this on #74. GitHub rebase-and-merge replays a PR's commits unchanged — no
(#N)in the subject, no merge commit. So the gate-the-diff attribution sees neither a subject marker nor a
PR-merge to vouch from, dumps those commits into
UNATTRIB, and hard-fails the gate. Once #74arms
fr-gate.ymlfrom@main, every one of the 15 caller repos that uses rebase-and-merge wouldhave its next promotion blocked on legitimately-merged commits.
allow_rebase_mergeistrueon all repos, so this is reachable, not theoretical.Fix
An authoritative fallback using GitHub's own record: for a commit the local git heuristics can't
place,
repos/{repo}/commits/{sha}/pullssays which PR introduced it. A merged PR attributes it(rebase, squash, or merge); a direct push has none and stays flagged — which is exactly the
defect the gate exists to catch.
(#N), merge-vouchM^1..M^2) stay as fast-paths, so the API ishit only for the residual — near-zero calls on a squash/merge-commit repo.
GH_TOKEN(PROJECTS_KANBAN_TOKEN) +REPOto the items step.Decision logic verified with a stubbed
gh: merged-PR → attribute, direct-push → flag, API-error →flag (fail-closed). actionlint clean.
Once this merges, #74 picks it up automatically (its head is
develop).Note
Medium Risk
Changes promotion-blocking attribution logic and depends on GitHub API availability; fail-closed behavior avoids silent bypass but could block promotions on API outages.
Overview
Fixes false FR gate failures when promotions include commits from rebase-and-merge PRs, which replay unchanged commits (no
(#N)subject, no merge commit) and were incorrectly treated as unattributable direct pushes.After the existing subject and merge-vouch checks, the Discover items step now calls
repos/{repo}/commits/{sha}/pullsfor any remaining bare commits. A commit linked to a merged PR is accepted; only commits with no merged PR stay inUNATTRIB. The step getsGH_TOKEN(PROJECTS_KANBAN_TOKEN) andREPO, retries the API 3×, and fails closed (flags the commit) if verification never succeeds.Reviewed by Cursor Bugbot for commit 449fce1. Bugbot is set up for automated code reviews on this repo. Configure here.