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

[RHCLOUD-30839] Use Events to trigger aggregations #2699

Conversation

g-duval
Copy link
Contributor

@g-duval g-duval commented May 6, 2024

  • The new aggregation command is compatible with the legacy way to aggregate data.
  • We have some feature flags on aggregator and engine to be able to test aggregator first, then engine.
  • Even it the new way is enable on engine, we will still record data on email_aggragation table, until we validate it entirely on prod

Exec plan details about new queries are available in linked Jira ticket.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 62.96296% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 69.00%. Comparing base (1ae18be) to head (8716616).
Report is 2 commits behind head on master.

Files Patch % Lines
.../cloud/notifications/DailyEmailAggregationJob.java 38.46% 5 Missing and 3 partials ⚠️
...t/cloud/notifications/config/AggregatorConfig.java 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2699      +/-   ##
============================================
- Coverage     69.02%   69.00%   -0.03%     
- Complexity     1800     1805       +5     
============================================
  Files           385      385              
  Lines          7975     7998      +23     
  Branches        686      689       +3     
============================================
+ Hits           5505     5519      +14     
- Misses         2185     2191       +6     
- Partials        285      288       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch from 8716616 to 6679ef0 Compare May 10, 2024 13:06
@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch 2 times, most recently from 0bde785 to 74e151e Compare May 31, 2024 12:00
@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch 4 times, most recently from fbbdc92 to 4678417 Compare July 4, 2024 09:06
result.putAll(emailAggregator.getAggregated(application.getId(), aggregationKey, DAILY, LocalDateTime.now(ZoneOffset.UTC).minusMinutes(1), LocalDateTime.now(ZoneOffset.UTC).plusMinutes(1)));
return result;
}

@CacheInvalidate(cacheName = "recipients-resolver-results")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CacheInvalidate will perform an asynchronous cache cleaning, but we need this cleanup to by sychonous in tests

Copy link
Member

Choose a reason for hiding this comment

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

Unless something changed in quarkus-cache, the old code should be synchronous because the method returns void and not Uni<Void>. Anyway, the new code is fine so please don't change anything!

@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch from b88152b to 83fbff2 Compare July 4, 2024 14:05
@g-duval g-duval marked this pull request as ready for review July 5, 2024 13:16
@g-duval g-duval changed the title WIP [RHCLOUD-30839] Use Events to trigger aggregations [RHCLOUD-30839] Use Events to trigger aggregations Jul 5, 2024
@MikelAlejoBR MikelAlejoBR self-requested a review July 10, 2024 06:22
Copy link
Member

@MikelAlejoBR MikelAlejoBR left a comment

Choose a reason for hiding this comment

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

Nice work! It's nice that we're using the "Event" table directly now...

@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch 2 times, most recently from 75e7ed6 to eba0e36 Compare July 19, 2024 11:42
@g-duval
Copy link
Contributor Author

g-duval commented Jul 19, 2024

/retest

@gwenneg
Copy link
Member

gwenneg commented Sep 16, 2024

@g-duval I'll take a look at this PR this week. Could you please rebase it and fix the conflicts?

@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch from eba0e36 to 97d6dd1 Compare September 16, 2024 13:39
@gwenneg gwenneg self-assigned this Sep 23, 2024
@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch 2 times, most recently from 5c356ee to a4f9a13 Compare November 19, 2024 09:15
@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch from 65360d6 to 03d24d4 Compare November 21, 2024 09:46
@g-duval
Copy link
Contributor Author

g-duval commented Nov 25, 2024

/retest

1 similar comment
@g-duval
Copy link
Contributor Author

g-duval commented Nov 25, 2024

/retest

@g-duval g-duval force-pushed the RHCLOUD-30839_useEventsToTriggerAggregations branch from a020cf1 to b02dd64 Compare November 26, 2024 09:08
result.putAll(emailAggregator.getAggregated(application.getId(), aggregationKey, DAILY, LocalDateTime.now(ZoneOffset.UTC).minusMinutes(1), LocalDateTime.now(ZoneOffset.UTC).plusMinutes(1)));
return result;
}

@CacheInvalidate(cacheName = "recipients-resolver-results")
Copy link
Member

Choose a reason for hiding this comment

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

Unless something changed in quarkus-cache, the old code should be synchronous because the method returns void and not Uni<Void>. Anyway, the new code is fine so please don't change anything!

g-duval and others added 2 commits November 26, 2024 14:55
…ilAggregationRepository.java

Co-authored-by: Gwenneg Lepage <[email protected]>
…/email/EmailAggregator.java

Co-authored-by: Gwenneg Lepage <[email protected]>
Copy link
Member

@gwenneg gwenneg left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@g-duval g-duval merged commit d4eceb6 into RedHatInsights:master Nov 26, 2024
32 of 33 checks passed
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.

4 participants