Revert "MUL-5180: fix(github): surface CI status on PR cards (#5811)" (#5855)

This reverts commit 139cc89200.

Co-authored-by: Bohan-J <bohan@devv.ai>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
Bohan Jiang
2026-07-24 02:52:22 +08:00
committed by GitHub
parent bce0c05856
commit 8d18d3a9ec
15 changed files with 72 additions and 607 deletions

View File

@@ -496,7 +496,6 @@ per_app_latest AS (
FROM github_pull_request_check_suite cs
JOIN issue_prs ip ON ip.id = cs.pr_id
WHERE cs.head_sha = ip.head_sha AND ip.head_sha <> ''
AND cs.status = 'completed'
ORDER BY cs.pr_id, cs.app_id, cs.updated_at DESC
),
checks AS (
@@ -573,19 +572,6 @@ type ListPullRequestsByIssueRow struct {
// pending view. reference_only links (a PR that merely mentions the issue
// identifier in its body, with no closing keyword and no title/branch
// reference) are filtered out — they are not working PRs for this issue.
// Only `completed` suites are eligible. The webhook handler already refuses
// to record anything else (MUL-5180), but this filter is what makes the card
// correct for rows that predate that gate: an installation holding Checks
// write accumulated `queued` suites GitHub had opened for Multica itself,
// and nothing will ever move them to `completed`. Counting them keeps the PR
// pinned to "checks running" — `checks_pending` outranks `checks_passed` in
// derivePullRequestStatusKind — for as long as the head SHA stands.
//
// Filtering here rather than deleting the rows makes the recovery automatic
// and source-agnostic: it holds for legacy rows, for stash rows replayed by
// replayPendingCheckSuitesForPR, and for any future writer that forgets the
// gate. The DISTINCT ON runs after the filter, so an app whose newest suite
// is a stuck `queued` still reports its most recent completed verdict.
func (q *Queries) ListPullRequestsByIssue(ctx context.Context, issueID pgtype.UUID) ([]ListPullRequestsByIssueRow, error) {
rows, err := q.db.Query(ctx, listPullRequestsByIssue, issueID)
if err != nil {