-
Notifications
You must be signed in to change notification settings - Fork 222
Implement data clean-up functionality #3209
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
Conversation
Summary of ChangesHello @candemiralp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a robust data cleanup mechanism for analytics events. It establishes a new cron job that periodically purges events that are either older than 45 days or have already been processed, thereby optimizing database performance and storage by removing stale data. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a data clean-up functionality for analytics events, which is a great addition for maintaining the database. The implementation includes a new cron job, resource model methods for deletion, and collection filtering. The accompanying unit tests are thorough and cover various scenarios.
My review includes a few suggestions to improve performance and maintainability:
- Optimizing the database query in the cron job to avoid an unnecessary
COUNTquery. - Refactoring the delete method in the resource model for better readability and simplicity.
- Replacing a hardcoded value with a constant to improve maintainability.
|
* [ECP-9414] Generate event dispatcher/observer mechanism for reliability events * [ECP-9413] Create CheckoutAnalytics helper class * [ECP-9750] Implement configuration field for metrics data collection (#3023) * [ECP-9745] Update the DB schema and refactor related classes (#3024) * [ECP-9745] Update the DB schema and refactor related classes * [ECP-9745] Update argument type declarations * [ECP-9745] Update example event handlers * [ECP-9745] Fix model argument * [ECP-9746] Refactoring Checkout Analytics event requests (#3079) * [ECP-9751] Implement a cronjob to submit pending events (#3087) * [ECP-9751] Implement a cronjob to submit pending events * [ECP-9751] Enable main workflow on the feature branch * [ECP-9751] Write unit tests * [ECP-9751] Update tests * [ECP-9417] Implement event dispatchers (#3113) * [ECP-9417] Implement analytics event dispatchers * [ECP-9417] Add try-catch block * [ECP-9727] Implement an event dispatcher for plugin installation event (#3114) * [ECP-9727] Implement an event dispatcher for plugin installation event * [ECP-9727] Add missing module setup end flag * [ECP-9835] Add the version field to the adyen_analytics_event entity (#3138) * [ECP-9835] Add version field to the dbschema and entity definition * [ECP-9835] Dispatch events only for Adyen namespace * [ECP-9835] Group entities by version and submit them separately * [ECP-9835] Put the feature behind a config flag * Update SubmitAnalyticsEvents.php * Add unit tests (#3207) * Optimize rest events to intercept * Write unit tests * Enable workflows * Fix static code issues * Fix several issues * Remove unexpectedEnd event from the info event batch * Truncate the topic if necessary * Implement data clean-up functionality (#3209) * Implement clean up functionality * Prevent the duplicate db query * Update .github/workflows/e2e-test.yml * Update .github/workflows/main.yml * Update .github/workflows/main.yml * Reformat the message in case of errors --------- Co-authored-by: khushboos <[email protected]>



Description
This PR implements the data clean-up functionality for already submitted events or events older than 45 days.