Skip to content

chore(promote): develop → main — fr-gate + advance-deploy-env fixes - #92

Merged
LukasWodka merged 2 commits into
mainfrom
develop
Jul 27, 2026
Merged

chore(promote): develop → main — fr-gate + advance-deploy-env fixes#92
LukasWodka merged 2 commits into
mainfrom
develop

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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’s commits/{sha}/pulls API (with retries and fail-closed on API failure), using a two-pass flow: true PR merge commits only count when merge_commit_sha matches, 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_field helper so one bad item logs a warning and does not abort the loop under set -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.

LukasWodka and others added 2 commits July 27, 2026 17:48
…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>
@LukasWodka LukasWodka self-assigned this Jul 27, 2026
@LukasWodka
LukasWodka merged commit f88cfed into main Jul 27, 2026
6 checks passed
Sign up for free to 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