Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: be/unified uptime query #1533

Merged
merged 11 commits into from
Jan 8, 2025
Merged

Conversation

ajhollid
Copy link
Collaborator

@ajhollid ajhollid commented Jan 8, 2025

This PR unifies two separate queries that were made in order to fetch monitors. Previously, one query was made for a summary of monitors, one query made for a list of monitors with checks. Now one query is made using the aggregate pipeline and facets in order to get all the data in one go.

  • Combine two separate queries in to one
  • Update queries to remove unnecessary params
  • Update validation

In order to make use of these queries some changes were requried on the FE. There is no need to store these monitors in the redux state any longer, so fetching has been moved to the component. Unnecessary redux thunks are removed and loading managed locally.

  • Refactor all pages that make use of the getMonitorsById and getMonitorsSummary methods to use the new unified method.
  • Remove unused redux thunks
  • Handle loading locally

@ajhollid ajhollid merged commit b909210 into develop Jan 8, 2025
1 of 2 checks passed
@ajhollid ajhollid deleted the feat/be/unified-uptime-query branch January 8, 2025 21:53
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

Large PR Notification

Dear contributor,

Thank you for your substantial contribution to this project. LlamaPReview has detected that this Pull Request contains a large volume of changes, which exceeds our current processing capacity.

Details:

  • PR and related contents total size: Approximately 65,199 characters
  • Current limit: 50,000 characters

Next steps:

  1. Consider breaking this PR into smaller, more focused changes if possible.
  2. For manual review, please reach out to your team members or maintainers.

We appreciate your understanding and commitment to improving this project. Your contributions are valuable, and we want to ensure they receive the attention they deserve.

LlamaPReview is continuously evolving to better serve the community. Share your thoughts on handling large PRs in our GitHub Discussions - your feedback helps us improve and expand our capabilities.

If you have any questions or need assistance, our community and support team are here to help.

Best regards,
LlamaPReview Team

Copy link

coderabbitai bot commented Jan 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces significant changes to the monitoring system's data retrieval and state management across both client and server components. The modifications primarily focus on streamlining monitor data fetching, removing Redux-based actions, and implementing more direct API interactions. The changes affect multiple files in the client and server repositories, restructuring how monitor data is retrieved, validated, and displayed.

Changes

File Change Summary
Client/src/Features/UptimeMonitors/uptimeMonitorsSlice.js Removed async thunks getUptimeSummaryByTeamId and getUptimeMonitorsByTeamId
Client/src/Pages/Infrastructure/index.jsx, Client/src/Pages/PageSpeed/index.jsx, Client/src/Pages/Uptime/Home/index.jsx Refactored state management, replaced Redux data fetching with direct API calls
Client/src/Utils/NetworkService.js Simplified getMonitorsByTeamId method by removing unnecessary parameters
Server/controllers/monitorController.js, Server/routes/monitorRoute.js Removed summary-related methods, updated routes for monitor retrieval

Sequence Diagram

sequenceDiagram
    participant Client
    participant NetworkService
    participant Server
    participant Database

    Client->>NetworkService: Request monitors by team ID
    NetworkService->>Server: GET /team/:teamId
    Server->>Database: Aggregate monitor data
    Database-->>Server: Return monitors and summary
    Server-->>NetworkService: Respond with data
    NetworkService-->>Client: Update local state with monitors
Loading

Possibly Related PRs

Suggested Reviewers

  • marcelluscaio
  • jennifer-gan

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61ee7a1 and de3a8be.

📒 Files selected for processing (13)
  • Client/src/Features/PageSpeedMonitor/pageSpeedMonitorSlice.js (2 hunks)
  • Client/src/Features/UptimeMonitors/uptimeMonitorsSlice.js (0 hunks)
  • Client/src/Pages/Infrastructure/index.jsx (6 hunks)
  • Client/src/Pages/PageSpeed/card.jsx (1 hunks)
  • Client/src/Pages/PageSpeed/index.jsx (4 hunks)
  • Client/src/Pages/Uptime/Home/UptimeDataTable/index.jsx (5 hunks)
  • Client/src/Pages/Uptime/Home/actionsMenu.jsx (3 hunks)
  • Client/src/Pages/Uptime/Home/index.jsx (6 hunks)
  • Client/src/Utils/NetworkService.js (1 hunks)
  • Server/controllers/monitorController.js (2 hunks)
  • Server/db/mongo/modules/monitorModule.js (2 hunks)
  • Server/routes/monitorRoute.js (2 hunks)
  • Server/validation/joi.js (2 hunks)

Finishing Touches

  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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.

Documentation and Community

  • 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.

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