Skip to content

Conversation

gorkem-bwl
Copy link
Contributor

@gorkem-bwl gorkem-bwl commented Aug 31, 2025

Add a prominent banner to status pages that displays when monitors are under maintenance. The banner shows which specific services are affected and explains that no alerts will be generated during maintenance periods.

Summary by CodeRabbit

  • New Features

    • Added a maintenance banner to the Status page showing a warning title, bolded list of affected services, and a note that no alerts will be generated during maintenance.
    • Banner supports localization, hides when no services are affected, and shows a demo caption when no real data is present.
  • Chores

    • Added English translation strings for maintenance title, affected-services label, and no-alerts notice.

- Create MaintenanceBanner component to display affected services
- Show banner when any monitors on status page are in maintenance
- Add translation keys for maintenance banner messages
- Position banner prominently after header on status pages
- Banner lists all affected monitor names and explains no alerts during maintenance
Copy link

coderabbitai bot commented Aug 31, 2025

Warning

Rate limit exceeded

@gorkem-bwl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0092800 and a18753b.

📒 Files selected for processing (8)
  • CHECKMATE_PORTS.md (1 hunks)
  • CLAUDE.md (1 hunks)
  • client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (1 hunks)
  • client/src/Pages/StatusPage/Status/index.jsx (3 hunks)
  • server/src/db/models/Monitor.js (1 hunks)
  • server/src/db/mongo/modules/statusPageModule.js (1 hunks)
  • server/src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueue.js (1 hunks)
  • server/src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.js (1 hunks)

Walkthrough

Adds a MaintenanceBanner React component (with demo fallback) to the Status page, computes monitorsInMaintenance by filtering monitors with isMaintenance, renders the banner after ControlsHeader, and adds three English i18n strings for maintenance messaging.

Changes

Cohort / File(s) Summary of changes
Maintenance banner component
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx
New default-exported React component that renders a Material UI warning Alert (larger icon) using useTheme and useTranslation. Accepts affectedMonitors; when null/undefined/empty enters demo mode (hardcoded monitors, “(DEMO)” suffix, extra caption). Builds a bold, comma-separated monitor list and shows AlertTitle with wrench emoji and several translated text lines.
Status page integration
client/src/Pages/StatusPage/Status/index.jsx
Imports MaintenanceBanner, computes monitorsInMaintenance by filtering monitors for isMaintenance === true (safe default to []), and renders MaintenanceBanner with affectedMonitors={monitorsInMaintenance} after ControlsHeader.
Localization (en)
client/src/locales/en.json
Adds three keys under maintenance: maintenanceInProgress, maintenanceAffectedServices, and maintenanceNoAlertsGenerated.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant SP as StatusPage
  participant MB as MaintenanceBanner
  Note over SP: Render PublicStatus

  U->>SP: Load page
  SP->>SP: Fetch monitors (existing flow)
  SP->>SP: Filter isMaintenance === true -> monitorsInMaintenance
  alt monitorsInMaintenance is non-empty
    SP->>MB: Render with affectedMonitors
    MB-->>U: Show warning Alert (maintenance in progress)
  else monitorsInMaintenance empty or undefined
    SP->>MB: Render in demo mode (hardcoded monitors)
    MB-->>U: Show demo warning Alert (includes “(DEMO)” and caption)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

P.S. Canadians apologize for the maintenance; Americans just call it "feature rollout."

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/status-page-maintenance-banner

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

- Show example banner with 'Web Server, API Gateway' when no real maintenance
- Add '(DEMO)' indicator to title
- Include explanatory text for demo purposes
- Allows testing banner appearance without setting up real maintenance windows
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (6)
client/src/Pages/StatusPage/Status/index.jsx (1)

145-147: Memoize maintenance filter and fix formatting

  • Backend confirms isMaintenance is present (statusPageModule.js:237), so the filter works.
  • Wrap the filter in useMemo to avoid re-running on every render.
  • Address Prettier warnings by running
    npx prettier --write client/src/Pages/StatusPage/Status/index.jsx
 import React from "react";
+import { useMemo } from "react";
 
-// Filter monitors that are in maintenance
-const monitorsInMaintenance = monitors?.filter(monitor => monitor.isMaintenance) || [];
+// Filter monitors that are in maintenance
+const monitorsInMaintenance = useMemo(
+  () => (monitors || []).filter(m => m.isMaintenance === true),
+  [monitors]
+);
client/src/locales/en.json (1)

305-305: Put punctuation inside the translatable string (optional)

Move the trailing colon into the translation so languages with different punctuation rules can localize it.

Change here:

-"maintenanceAffectedServices": "The following services are currently under maintenance",
+"maintenanceAffectedServices": "The following services are currently under maintenance:",

And in the banner component, remove the hardcoded colon (see related comment there).

client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (4)

5-8: Expose i18n for locale-aware list formatting (prep for next change)

You can pull i18n from useTranslation to format lists per locale.

-const { t } = useTranslation();
+const { t, i18n } = useTranslation();

13-14: Locale-aware, robust monitor name list

  • Use Intl.ListFormat for proper punctuation per locale (and “A, B, and C” vs “A, B y C”, etc.).
  • Guard against missing names.
-const monitorNames = affectedMonitors.map(monitor => monitor.name).join(", ");
+const names = affectedMonitors
+  .map(m => m?.name)
+  .filter(Boolean);
+const monitorNames = new Intl.ListFormat(i18n?.language || "en", {
+  style: "long",
+  type: "conjunction",
+}).format(names);

25-27: Minor a11y: hide emoji from screen readers

Screen readers can read “wrench” redundantly. Mark it decorative.

-<AlertTitle sx={{ fontWeight: 600, mb: theme.spacing(5) }}>
-  🔧 {t("maintenanceInProgress")}
-</AlertTitle>
+<AlertTitle sx={{ fontWeight: 600, mb: theme.spacing(5) }}>
+  <span aria-hidden="true" style={{ marginRight: 4 }}>🔧</span>
+  {t("maintenanceInProgress")}
+</AlertTitle>

29-29: Translation owns punctuation (only if you applied the i18n change)

Remove the hardcoded colon and let the string include it (see en.json suggestion).

-{t("maintenanceAffectedServices")}: <strong>{monitorNames}</strong>
+{t("maintenanceAffectedServices")} <strong>{monitorNames}</strong>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b73b97b and bf70d4d.

📒 Files selected for processing (3)
  • client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (1 hunks)
  • client/src/Pages/StatusPage/Status/index.jsx (3 hunks)
  • client/src/locales/en.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
client/src/Pages/StatusPage/Status/index.jsx (1)
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (1)
  • MaintenanceBanner (5-36)
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (2)
client/src/Pages/StatusPage/Status/index.jsx (2)
  • theme (25-25)
  • useTranslation (26-26)
client/src/Components/Alert/index.jsx (1)
  • Alert (32-109)
🪛 GitHub Actions: Format Check (Client & Server)
client/src/Pages/StatusPage/Status/index.jsx

[warning] 1-1: Prettier formatting issue detected in this file. Run 'prettier --write' to fix.

client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx

[warning] 1-1: Prettier formatting issue detected in this file. Run 'prettier --write' to fix.

🔇 Additional comments (4)
client/src/Pages/StatusPage/Status/index.jsx (2)

9-9: Import looks good

Import path resolves to the folder index; no issues.


159-159: Render placement is sensible

Rendering unconditionally is fine since the component returns null when empty.

client/src/locales/en.json (1)

303-306: New strings LGTM

Keys are clear and match component usage.

client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (1)

9-11: Early return is perfect

Avoids empty chrome when no monitors are affected.

Comment on lines 1 to 4
import { Alert, AlertTitle, Typography } from "@mui/material";
import { useTheme } from "@emotion/react";
import { useTranslation } from "react-i18next";

Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Consider using the app’s Alert for visual consistency; also fix Prettier

  • The repo has a custom Alert component (client/src/Components/Alert). If the design system prefers it, consider switching for consistent theming. If MUI Alert is the new standard, ignore this.
  • Prettier is failing on this file; please run the formatter.

Verify formatting:

Americans love shiny new components; Canadians just want them all to look friendly together. Pick your vibe. 😉


🏁 Script executed:

#!/bin/bash
npx prettier --check client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx

Length of output: 284


🏁 Script executed:

#!/bin/bash
# Search for custom Alert component in client/src/Components
echo "Files matching 'Alert' under client/src/Components:"
fd -t f "client/src/Components" | grep -E "Alert(\.jsx?$|/index\.jsx?$)" || echo "No Alert files found"
echo ""
# Inspect export definitions in those files
for file in $(fd -t f "client/src/Components" | grep -E "Alert(\.jsx?$|/index\.jsx?$)"); do
  echo "--- $file ---"
  rg -n "export .*Alert" "$file" || echo "  No export of Alert found in $file"
done

Length of output: 1108


🏁 Script executed:

#!/bin/bash
# Locate any custom Alert component files under client/src/Components
echo "Custom Alert component candidates:"
fd -i 'Alert(\.jsx?$|/index\.jsx?$)' client/src/Components || echo "No matching files"

# Inspect export definitions in each candidate
for file in $(fd -i 'Alert(\.jsx?$|/index\.jsx?$)' client/src/Components); do
  echo -e "\n--- $file ---"
  rg -nP 'export\s+(default\s+)?Alert' "$file" || echo "  No Alert export found"
done

Length of output: 201


🏁 Script executed:

#!/bin/bash
# Locate all directories named components (case-insensitive) under client/src
echo "Components directories found:"
find client/src -type d -iname '*components*'
echo ""

# List contents of each Components directory
for dir in $(find client/src -type d -iname '*components*'); do
  echo "Contents of $dir:"
  ls -1 "$dir"
  echo ""
done

# Find any files or directories with 'Alert' in the name under client/src
echo "Files or directories matching 'Alert' under client/src:"
find client/src -iname '*Alert*'

Length of output: 7931


Use internal Alert and fix formatting

  • Import Alert from client/src/Components/Alert instead of MUI for consistent theming.
  • Run npx prettier --write client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx to resolve style warnings.

Americans love shiny new components; Canadians just want them all to look friendly together. 😉

🧰 Tools
🪛 GitHub Actions: Format Check (Client & Server)

[warning] 1-1: Prettier formatting issue detected in this file. Run 'prettier --write' to fix.

🤖 Prompt for AI Agents
In client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx
lines 1-4, the component currently imports Alert from MUI which breaks
consistent theming; replace the Alert import to import Alert from
"client/src/Components/Alert" (keep AlertTitle and Typography imports as
needed), then run npx prettier --write
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx to fix
formatting/style warnings.

Copy link

@llamapreview llamapreview bot left a comment

Choose a reason for hiding this comment

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

Auto Pull Request Review from LlamaPReview

🎯 TL;DR & Recommendation

Recommendation: Approve with suggestions
This PR adds a useful maintenance banner feature but includes minor suggestions to improve robustness, accessibility, and internationalization.

🌟 Strengths

  • Adds a clear and user-friendly banner for maintenance visibility.
  • Well-integrated with existing status page components and translations.
Priority File Category Impact Summary Anchors
P2 client/src/Pages/StatusPage/Status/index.jsx Correctness Assumes isMaintenance property, may fail silently.
P2 client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx Robustness Risk of TypeError if monitor name is missing.
P2 client/src/locales/en.json Maintainability Missing translations in other languages.
P2 client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx Accessibility Emoji may not be accessible for screen readers.

🔍 Notable Themes

  • Data Validation: Multiple suggestions to add defensive checks for object properties to prevent silent failures or runtime errors.
  • Internationalization: Ensure all new UI strings are translated across supported languages for a consistent user experience.
⚠️ **Unanchored Suggestions (Manual Review Recommended)**

The following suggestions could not be precisely anchored to a specific line in the diff. This can happen if the code is outside the changed lines, has been significantly refactored, or if the suggestion is a general observation. Please review them carefully in the context of the full file.


📁 File: client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx

If any monitor in affectedMonitors lacks a name property, this will throw a TypeError ("Cannot read properties of undefined"), breaking the entire status page render. This is particularly risky since the component already checks for array existence but not individual element structure.

Suggestion:

const monitorNames = affectedMonitors.map(monitor => monitor?.name).filter(Boolean).join(", ");

Related Code:

const monitorNames = affectedMonitors.map(monitor => monitor.name).join(", ");


💡 LlamaPReview Community
Have feedback on this AI Code review tool? Join our GitHub Discussions to share your thoughts and help shape the future of LlamaPReview.

"uptimeCreateJsonPath": "This expression will be evaluated against the reponse JSON data and the result will be used to match against the expected value. See",
"uptimeCreateJsonPathQuery": "for query language documentation.",
"maintenanceTableActionMenuDialogTitle": "Do you really want to remove this maintenance window?",
"maintenanceInProgress": "Maintenance in Progress",
Copy link

Choose a reason for hiding this comment

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

P2 | Confidence: High

Speculative: The translations are added only to English (en.json). If the application supports multiple languages, these keys must be added to all locale files to avoid missing translations in other languages, which would degrade the user experience for non-English speakers.

);
}

// Filter monitors that are in maintenance
Copy link

Choose a reason for hiding this comment

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

P2 | Confidence: Medium

Speculative: The code assumes monitor objects contain an isMaintenance property, but this property is not visible in the current changes. If the backend doesn't provide this field or uses a different naming convention (e.g., maintenance), the filter will silently fail, and the banner won't display when expected. This could lead to user confusion during actual maintenance periods.

Suggested change
// Filter monitors that are in maintenance
const monitorsInMaintenance = monitors?.filter(monitor => monitor?.isMaintenance) || [];

}

return (
<Alert
Copy link

Choose a reason for hiding this comment

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

P2 | Confidence: Medium

The alert uses a text-based emoji (🔧) which may not be properly announced by screen readers. While the visual meaning is clear, assistive technologies might read this as "wrench" or fail to convey the maintenance context, reducing accessibility for visually impaired users.

Code Suggestion:

<AlertTitle sx={{ fontWeight: 600, mb: theme.spacing(5) }} aria-label="Maintenance in progress">
  <Icon>build</Icon> {t("maintenanceInProgress")}
</AlertTitle>

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (2)

1-1: Use design-system Alert for consistency (or confirm MUI is the new standard).

Repo reportedly has a custom Alert. Prefer it for theming consistency; otherwise confirm MUI is now canonical.

Option if design-system is desired (adjust path to your aliasing):

-import { Alert, AlertTitle, Typography } from "@mui/material";
+import Alert from "client/src/Components/Alert";
+import { AlertTitle, Typography } from "@mui/material";

Americans love loud banners; Canadians prefer polite notices—pick your vibe. 🇺🇸🇨🇦


1-52: Fix Prettier warnings to unblock the pipeline.

Run the formatter on this file.

#!/bin/bash
npx prettier --write client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx
🧹 Nitpick comments (3)
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (3)

2-2: Prefer MUI’s useTheme import for typings and consistency.

If the app standardizes on MUI theme, import from @mui/material/styles.

-import { useTheme } from "@emotion/react";
+import { useTheme } from "@mui/material/styles";

Run a quick check across client code to confirm the prevailing pattern before changing.


34-36: Localize the title completely (emoji/text), not just the words.

Move the emoji/title into i18n to allow translators full control. If you keep emoji inline, at least make the string a single key.

Example:

-			<AlertTitle sx={{ fontWeight: 600, mb: theme.spacing(5) }}>
-				🔧 {t("maintenanceInProgress")}
-			</AlertTitle>
+			<AlertTitle sx={{ fontWeight: 600, mb: theme.spacing(5) }}>
+				{t("maintenanceTitle", { defaultValue: "🔧 Maintenance in Progress" })}
+			</AlertTitle>

25-33: Spacing nit: 80px bottom margin feels heavy for banners.

Consider spacing(3–6) and a slightly smaller icon for denser status pages.

-			sx={{ 
-				mb: theme.spacing(10),
-				'& .MuiAlert-icon': {
-					fontSize: '1.5rem'
-				}
-			}}
+			sx={{
+				mb: theme.spacing(4),
+				'& .MuiAlert-icon': { fontSize: '1.25rem' }
+			}}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bf70d4d and 0092800.

📒 Files selected for processing (1)
  • client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (1)
client/src/Pages/StatusPage/Status/index.jsx (2)
  • theme (25-25)
  • useTranslation (26-26)
🪛 GitHub Actions: Format Check (Client & Server)
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx

[warning] 1-1: Code style issues found in file. Run Prettier with --write to fix.

🔇 Additional comments (1)
client/src/Pages/StatusPage/Status/Components/MaintenanceBanner/index.jsx (1)

37-42: Translation keys confirmed in locales; keys present in client/src/locales/en.json (lines 303–305). All set—no moose tracks left behind, eh?

- Add MaintenanceBanner component for status pages showing active maintenance windows
- Fix status page layout with 800px centered container while keeping breadcrumbs full-width
- Update maintenance window detection to support repeating maintenance windows
- Remove demo content and focus on real maintenance data display
- Remove database-level isMaintenance calculation from statusPageModule aggregation
- Add isInMaintenance property to Monitor model schema
- Update SuperSimpleQueueHelper to set Monitor.isInMaintenance when checking maintenance windows
- Add maintenance service methods for bulk maintenance status updates
- Add periodic maintenance job to update all monitors every 5 minutes
- Maintain support for both one-time and repeating maintenance windows
- Clean architecture: maintenance status is now properly stored on Monitor model
- Remove periodic maintenance job from scheduler (every 5 minutes)
- Remove getMaintenanceJob() method from SuperSimpleQueueHelper
- Remove bulk maintenance update methods from maintenanceWindowService
- Maintenance status updates only when monitors are actually processed
- Simpler, more efficient architecture
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