Skip to content

fix(seer): Hide autofix review cards without a valid PR [will revert soon] - #120506

Merged
NicoHinderling merged 1 commit into
masterfrom
fix/autofix-overview-hide-missing-pr-cards
Jul 23, 2026
Merged

fix(seer): Hide autofix review cards without a valid PR [will revert soon]#120506
NicoHinderling merged 1 commit into
masterfrom
fix/autofix-overview-hide-missing-pr-cards

Conversation

@NicoHinderling

Copy link
Copy Markdown
Contributor

Warning

Temporary mitigation — intended to be rolled back. This papers over runs in the review bucket that have no PR behind them while the root cause (PR creation not completing for some runs) is investigated. Once that's fixed at the source, revert this.

Description

On /issues/autofix/overview, some cards in the Awaiting your review section have no valid pull request behind them: the run's repo_pr_states never reached a completed PR with a URL, so the "Review PR" button silently falls back to linking the issue page instead of GitHub.

Until the underlying cause is fixed, this filters those cards out of the section:

  • New useValidPrIssues hook eagerly fetches each review-bucket issue's autofix state (/issues/$id/autofix/?mode=explorer) and keeps only issues with a completed PR URL — the same extractPr condition the Review PR button uses (via a new hasValidPr helper), so the filter and the button can't disagree. The queries share cache keys with the cards' own enrichment, so nothing is fetched twice.
  • The section's badge now counts the cards that actually render instead of the server's X-Hits total, showing until the state queries settle. Other sections keep their server counts.

Trade-offs, accepted for a stopgap: the review section fires its per-issue state requests upfront rather than lazily on scroll, and if the section ever exceeds the 100-issue fetch limit the badge reflects only the fetched page (no 100+ for this section).

Cards in the Awaiting your review section sometimes have no pull
request behind them: the run's PR creation never completed, so the
Review PR button falls back to linking the issue page instead of a
GitHub PR. Until the root cause is understood, filter those cards out
of the section and make the header badge count only the cards that
actually render.

The section now eagerly fetches each issue's autofix state to decide
validity; these queries share cache keys with the cards' own
enrichment, so nothing is fetched twice.

This is a temporary mitigation and should be rolled back once the
missing-PR runs are fixed at the source.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 23, 2026
Comment on lines +56 to +59
// Cards in the review bucket sometimes have no PR behind them (the run's
// PR creation never completed). Hide those and count only what's left; the
// per-issue state queries here share cache keys with the cards' own
// enrichment, so nothing is fetched twice.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The allSectionsEmpty check uses the unfiltered section.issues list, causing an incorrect empty state when all review_pr issues are filtered out on the client.
Severity: LOW

Suggested Fix

Modify the allSectionsEmpty calculation to account for the client-side filtering. When checking the review_pr section, it should use the length of the filtered validIssues list instead of the raw section.issues list. This will ensure the global empty state is shown correctly when there are no visible issues across all sections.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/seerWorkflows/overview/sectionList.tsx#L56-L59

Potential issue: The `allSectionsEmpty` check determines whether to show a global empty
state by checking `section.issues.length`. However, for the `review_pr` section, the
rendered issues are filtered by the `useValidPrIssues` hook. If all issues in the
`review_pr` section are filtered out because they lack a valid pull request,
`allSectionsEmpty` will incorrectly evaluate to `false` because it is based on the
original, unfiltered issue count. This prevents the global empty state from rendering.
Instead, the user sees the `review_pr` section header with an individual "No issues"
message, which is a degraded user experience.

Did we get this right? 👍 / 👎 to inform future reviews.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 94.02% 94.02% ±0%
Typed 136,294 136,313 🟢 +19
Untyped 8,667 8,668 🔴 +1
🔍 1 new type safety issue introduced

Non-null assertions (!) (1 new)

File Line Detail
static/app/views/seerWorkflows/overview/useValidPrIssues.tsx 36 results[index]!

This is informational only and does not block the PR.

@NicoHinderling
NicoHinderling merged commit 2c9c5fd into master Jul 23, 2026
72 checks passed
@NicoHinderling
NicoHinderling deleted the fix/autofix-overview-hide-missing-pr-cards branch July 23, 2026 20:58
@NicoHinderling NicoHinderling changed the title fix(seer): Hide autofix review cards without a valid PR fix(seer): Hide autofix review cards without a valid PR [will revert soon] Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants