Skip to content

fix(fr-gate): attribute rebase-and-merge commits (blocker for #74) - #75

Merged
LukasWodka merged 1 commit into
developfrom
fix/fr-gate-rebase-merge-attribution
Jul 26, 2026
Merged

fix(fr-gate): attribute rebase-and-merge commits (blocker for #74)#75
LukasWodka merged 1 commit into
developfrom
fix/fr-gate-rebase-merge-attribution

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

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 #74
arms fr-gate.yml from @main, every one of the 15 caller repos that uses rebase-and-merge would
have its next promotion blocked on legitimately-merged commits.

allow_rebase_merge is true on 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}/pulls says 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.

  • The fast local checks (subject (#N), merge-vouch M^1..M^2) stay as fast-paths, so the API is
    hit only for the residual — near-zero calls on a squash/merge-commit repo.
  • Retries 3×; fails closed on a persistent API error (an unverifiable commit never passes).
  • Adds 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.

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}/pulls for any remaining bare commits. A commit linked to a merged PR is accepted; only commits with no merged PR stay in UNATTRIB. The step gets GH_TOKEN (PROJECTS_KANBAN_TOKEN) and REPO, retries the API , 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.

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.
@LukasWodkaLukasWodka self-assigned this Jul 26, 2026
@LukasWodka

Copy link
Copy Markdown
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

Copy link
Copy Markdown
ContributorAuthor

bugbot run

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

@LukasWodka
LukasWodka merged commit 72cd3f4 into developJul 26, 2026
5 checks passed
@LukasWodka
LukasWodka deleted the fix/fr-gate-rebase-merge-attribution branch August 1, 2026 21:45
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.

1 participant

@LukasWodka