fix: status indicator now reflects unresolved incidents#7744
fix: status indicator now reflects unresolved incidents#7744ArthurGamby merged 4 commits intomainfrom
Conversation
The status indicator only checked /api/v2/status.json which reflects aggregate component health. During incident monitoring phases, components get marked operational again while the incident remains unresolved — causing the indicator to show "All Systems Operational" despite an active incident visible on prisma-status.com. Now also fetches /api/v2/incidents/unresolved.json and uses the higher severity between the summary and worst unresolved incident. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughBoth status components now fetch Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/ui/src/components/pdp-status.tsx (1)
22-30:⚠️ Potential issue | 🟠 Major
majorcan now surface here, but it still looks healthy.This effect now promotes
status.indicatorto the worst unresolved incident. In this component,"major"is still styled with the success tokens, so a major active incident would render as a green footer state. Please align that mapping before shipping.Also applies to: 39-60
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ui/src/components/pdp-status.tsx` around lines 22 - 30, The indicatorStatus mapping in pdp-status.tsx incorrectly maps the "major" key to success tokens, so status.indicator === "major" renders as healthy; update the indicatorStatus Record (the "major" entry) to use the appropriate non-success tokens (e.g., error/warning tokens consistent with critical/major semantics) so a major unresolved incident shows the correct color; ensure you also update the same mapping occurrences noted (the other block around lines 39-60) so both uses of indicatorStatus treat "major" consistently.
🧹 Nitpick comments (1)
apps/docs/src/components/status-indicator.tsx (1)
15-35: Consider centralizing the status resolution helper.
Incident,IncidentsResponse,SEVERITY, and the merge rule now live in both this component andpackages/ui/src/components/pdp-status.tsx. A small shared helper would keep the sidebar and footer aligned and give you one place to test the precedence rules.Also applies to: 44-69
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/src/components/status-indicator.tsx` around lines 15 - 35, The same types and status-resolution logic (Incident, IncidentsResponse, dotColors, SEVERITY and the merge/precedence rule) are duplicated in this file and packages/ui/src/components/pdp-status.tsx; extract them into a single shared helper module (e.g., a new status-utils or pdp-status helper) and import it from both places so the sidebar and footer use the identical logic; move the type definitions (Incident, IncidentsResponse), the mapping (dotColors), the severity map (SEVERITY) and the merge/precedence function into that module, export them, and update this component to import and use the shared symbols rather than redefining them.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/docs/src/components/status-indicator.tsx`:
- Around line 44-70: The current Promise.all makes the incidents fetch a hard
dependency so any failure clears the widget; change the logic to treat incidents
as optional by using Promise.allSettled (or fetch the two endpoints separately
and handle errors independently) so that when the incidents request fails you
still use statusData.status; specifically locate the Promise.all block that
fetches status.json and incidents/unresolved.json, keep using statusData.status
and setStatus(statusData.status) as the fallback, only computing
worstIncidentIndicator and overriding the status when the incidents fetch
succeeded and produced a non-empty incidents array (refer to symbols:
Promise.all/Promise.allSettled, statusData, incidentsData,
worstIncidentIndicator, SEVERITY, setStatus).
---
Outside diff comments:
In `@packages/ui/src/components/pdp-status.tsx`:
- Around line 22-30: The indicatorStatus mapping in pdp-status.tsx incorrectly
maps the "major" key to success tokens, so status.indicator === "major" renders
as healthy; update the indicatorStatus Record (the "major" entry) to use the
appropriate non-success tokens (e.g., error/warning tokens consistent with
critical/major semantics) so a major unresolved incident shows the correct
color; ensure you also update the same mapping occurrences noted (the other
block around lines 39-60) so both uses of indicatorStatus treat "major"
consistently.
---
Nitpick comments:
In `@apps/docs/src/components/status-indicator.tsx`:
- Around line 15-35: The same types and status-resolution logic (Incident,
IncidentsResponse, dotColors, SEVERITY and the merge/precedence rule) are
duplicated in this file and packages/ui/src/components/pdp-status.tsx; extract
them into a single shared helper module (e.g., a new status-utils or pdp-status
helper) and import it from both places so the sidebar and footer use the
identical logic; move the type definitions (Incident, IncidentsResponse), the
mapping (dotColors), the severity map (SEVERITY) and the merge/precedence
function into that module, export them, and update this component to import and
use the shared symbols rather than redefining them.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d7fa9ed1-695a-4c27-96a2-fa0da01253ec
📒 Files selected for processing (2)
apps/docs/src/components/status-indicator.tsxpackages/ui/src/components/pdp-status.tsx
Use Promise.allSettled so a failing incidents endpoint doesn't hide the widget. The status summary is still shown when incidents/unresolved.json is unavailable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
carlagn
left a comment
There was a problem hiding this comment.
LGTM! :) thanks for updating the ui package as well 🥳
Summary
/api/v2/status.json, which reflects aggregate component health — not unresolved incidentsStatusIndicator(docs sidebar) andPDPStatus(footer) also fetch/api/v2/incidents/unresolved.jsonand use the higher severity between the summary and worst unresolved incidentTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes