chore(promote): develop → main — fr-gate + advance-deploy-env fixes - #92
Merged
Conversation
…90) * fix(fr-gate): attribute items via commits/pulls, not commit subjects Replaces the commit-subject '(#N)' scrape (both the item list and the attribution vouch) with GitHub's authoritative commit->PR attribution (repos/{repo}/commits/{sha}/pulls). The scrape was unreliable three ways under this org's '<subject> (#issue) (#PR)' convention: 1. it grabbed ISSUE numbers -> pullRequest() NOT_FOUND -> gate failed CLOSED (backend#1228: 16 issue-refs, e.g. #1005); 2. it grabbed bare '#N' MENTIONS of unrelated PRs (#234/#472 style); and 3. it MISSED a commit's real PR when the (#PR) wasn't in the subject (rebase-merges / issue-only squash subjects) -> a naive NOT_FOUND-skip then failed OPEN, since UNATTRIB counts an (#issue) subject as attributed and the real PR is never gated (Bugbot High on the first cut of this PR). commits/{sha}/pulls returns the actual MERGED PR(s) that introduced each commit -- the single source of truth for both PRS and UNATTRIB. One call per commit not already vouched by a PR-merge (M^1..M^2); retry; fail CLOSED on a persistent API error. The --depth=200 base fetch bounds the commit set and the call count. Validated against backend#1228's exact failing range (staging 0e4af47d .. develop 8ddbbef2, 41 non-merge commits): yields 39 real merged PRs, ZERO issue-ref leaks, ZERO false-unattributable, drops the #234/#472 mention-noise, and correctly keeps #1191 (a genuine containing PR). actionlint clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(fr-gate): only true PR-merges vouch (match merge_commit_sha) commits/{sha}/pulls lists EVERY PR whose branch contains a commit, so a sync merge ("Merge develop into feature") was listed for the feature PR. The old non-empty check let that sync merge enter MERGES and mark a direct-push-to-base it happened to pull in as "covered", skipping Pass 2 and reopening the Bugbot #73 fail-open hole. Require merge_commit_sha==sha so only true PR merges vouch; any other merge drops its payload to Pass 2 for individual attribution. Verified on real history: backend sync merge ba80b3a yields no merge_commit_sha match (drops to Pass 2), while every 'Merge pull request #N' matches #N. Addresses Bugbot 'Sync merges reopen attribution hole'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…nd the push (#91) An archived project item cannot be updated -- the mutation errors, and under `set -e` this aborted the whole step, leaving every PR after it in the push un-advanced (this is how promoted items got stranded below Prod). Now: - query isArchived and skip archived cards before mutating (root cause); - wrap the field update so any unexpected per-item error is logged and flagged but does not abort the loop; the run still fails at the end if any item failed. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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 free
to 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.
Promotion hop (merge commit, not squash — per RFC-BACKEND-0008).
Carries to
main(where the reusable workflows are referenced as@main):A back-merge main→develop follows to heal the pre-existing divergence (#88/#89 live only on main).
Note
Medium Risk
Changes affect promotion blocking (fr-gate) and kanban deploy/status updates on push—incorrect attribution or skipped updates could block merges or leave cards stale, though behavior is intentionally stricter and more resilient than before.
Overview
FR gate no longer discovers promotion items by scraping
(#N)from commit subjects. It builds the PR list and unattributed-commit checks from GitHub’scommits/{sha}/pullsAPI (with retries and fail-closed on API failure), using a two-pass flow: true PR merge commits only count whenmerge_commit_shamatches, then remaining commits are attributed or flagged as direct pushes.Advance deploy env skips archived project items before updating fields, and wraps Deploy env / Status GraphQL updates in a shared
update_fieldhelper so one bad item logs a warning and does not abort the loop underset -e; the job still fails at the end if any per-item update failed.Reviewed by Cursor Bugbot for commit 2f6ee2e. Bugbot is set up for automated code reviews on this repo. Configure here.