Skip to content

change: [M3-8450] - Lower Events historical data fetching to 7 days #10899

Merged
abailly-akamai merged 7 commits intolinode:developfrom
abailly-akamai:M3-8450-2
Sep 9, 2024
Merged

change: [M3-8450] - Lower Events historical data fetching to 7 days #10899
abailly-akamai merged 7 commits intolinode:developfrom
abailly-akamai:M3-8450-2

Conversation

@abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Sep 6, 2024

This PR is a replacement for #10785 which had become difficult to rebase.

It is essentially the same PR including fixes and cleanup for the new e2e tests.

Description 📝

This change optimizes Cloud Manager's event querying by reducing the historical data range.

Specifically, it limits the event query timeframe from the current 90 days to a more focused 7-day period.

  • This is true for the default Cloud Manager query that also populates the Notification Center
  • The /events page still queries 90 day and isn't affected by this PR

This adjustment aims to improve query performance and reduce unnecessary data retrieval while still providing relevant recent event information.

Changes 🔄

  • Previously we fetched the first 100 events but returned almost 500 results/records. These events pull from the last 90 days. Now we're returning events from the last 7 days.

Target release date 🗓️

Next Release: 9/16/2024

How to test 🧪

Note

We are working to have this fully covered via E2E tests in an upcoming PR cc: @jdamore-linode

Prerequisites

  • Checkout branch and observe you network tab

Verification steps

  • Go to http://localhost:3000/events
  • Observe that initial load returns at most 25 events
  • As you scroll observe subsequent queries fetch next 25
  • Ensure there aren't any redundant events
  • Ensure you're able to reach the end of your events list (90 days worth of events)

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@abailly-akamai abailly-akamai self-assigned this Sep 6, 2024
@abailly-akamai abailly-akamai changed the title change: [M3-8450] - Lower Notification Center Events historical data fetching to 7 days change: [M3-8450] - Lower Events historical data fetching to 7 days Sep 6, 2024
@abailly-akamai abailly-akamai marked this pull request as ready for review September 6, 2024 03:55
@abailly-akamai abailly-akamai requested review from a team as code owners September 6, 2024 03:55
@abailly-akamai abailly-akamai requested review from bnussman-akamai, cpathipa and jdamore-linode and removed request for a team September 6, 2024 03:55
cy.wait('@getEventsPoll');
cy.get('@getEventsPoll.all').should('have.length', 1);
});
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jdamore-linode I would appreciate a second pair of 👀 on both the tests since I had to make some changes to them - thx!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jdamore-linode The 2s & 16s polling tests are the ones failing in the CI and i have no idea why. It's passing fine locally, but can't see what CY failure details

Copy link
Contributor

@jdamore-linode jdamore-linode Sep 6, 2024

Choose a reason for hiding this comment

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

Checking this out now! Kinda have to refresh my memory on how all this works/what the error was/etc. I'm not super confident in these tests to begin seeing as I had to lean on some kinda unusual (and probably hacky) patterns, so I may take a second pass and try to spruce them up while I'm at it.

@github-actions
Copy link

github-actions bot commented Sep 6, 2024

Coverage Report:
Base Coverage: 86.4%
Current Coverage: 86.4%

});

/**
* - Confirms that Cloud Manager polls the events endpoint 16 times per second.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* - Confirms that Cloud Manager polls the events endpoint 16 times per second.
* - Confirms that Cloud Manager polls the events endpoint every 16 seconds.

});

/**
* - Confirms that Cloud Manager polls the events endpoint 2 times per second when there are in-progress events.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* - Confirms that Cloud Manager polls the events endpoint 2 times per second when there are in-progress events.
* - Confirms that Cloud Manager polls the events endpoint every 2 seconds when there are in-progress events.

@jaalah-akamai
Copy link
Contributor

@jdamore-linode is it worth adding an assertion to verify that the in-progress event is actually included in the response, to ensure that the increased polling rate is indeed triggered by the presence of an in-progress event? May not be necessary, but wanted to check

@jdamore-linode
Copy link
Contributor

@jdamore-linode is it worth adding an assertion to verify that the in-progress event is actually included in the response, to ensure that the increased polling rate is indeed triggered by the presence of an in-progress event? May not be necessary, but wanted to check

@jaalah-akamai If these were end-to-end tests using real events we'd definitely do that, but we're already implicitly doing this since we're defining the mocked responses, and setting them up not to contain an in-progress event in one test and to contain an in-progress event in the other (which, iirc, is basically the only real difference between the two tests -- I think I literally copy/pasted them when I wrote them since we were in such a rush at the time, but in reality it might make sense to parameterize them or something since that might kind of highlight at a glance what the difference between the two flows is)

@abailly-akamai
Copy link
Contributor Author

@jdamore-linode How do you feel about moving forward with either skipping the test for now until we have a better handle on it. We now have very few days for this to sit in dev and the only test issue seems irrelevant to the purpose of this PR

@abailly-akamai abailly-akamai merged commit 9e2a990 into linode:develop Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants