-
Notifications
You must be signed in to change notification settings - Fork 72
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
[RHCLOUD-30839] Use Events to trigger aggregations #2699
Conversation
Codecov ReportAttention: Patch coverage is
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. |
8716616
to
6679ef0
Compare
0bde785
to
74e151e
Compare
fbbdc92
to
4678417
Compare
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") |
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.
@CacheInvalidate will perform an asynchronous cache cleaning, but we need this cleanup to by sychonous in tests
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.
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!
b88152b
to
83fbff2
Compare
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.
Nice work! It's nice that we're using the "Event" table directly now...
aggregator/src/main/java/com/redhat/cloud/notifications/DailyEmailAggregationJob.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/DailyEmailAggregationJob.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/db/AggregationOrgConfigRepository.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/config/AggregatorConfig.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/redhat/cloud/notifications/config/EngineConfig.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/redhat/cloud/notifications/config/EngineConfig.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/redhat/cloud/notifications/processors/email/EmailAggregator.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/DailyEmailAggregationJob.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/db/AggregationOrgConfigRepository.java
Outdated
Show resolved
Hide resolved
aggregator/src/test/java/com/redhat/cloud/notifications/DailyEventAggregationJobTest.java
Outdated
Show resolved
Hide resolved
75e7ed6
to
eba0e36
Compare
/retest |
@g-duval I'll take a look at this PR this week. Could you please rebase it and fix the conflicts? |
eba0e36
to
97d6dd1
Compare
5c356ee
to
a4f9a13
Compare
aggregator/src/main/java/com/redhat/cloud/notifications/db/EmailAggregationRepository.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/redhat/cloud/notifications/models/EventAggregationCommand.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/config/AggregatorConfig.java
Show resolved
Hide resolved
engine/src/main/java/com/redhat/cloud/notifications/processors/email/EmailAggregator.java
Show resolved
Hide resolved
engine/src/main/java/com/redhat/cloud/notifications/processors/email/EmailAggregator.java
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/db/AggregationOrgConfigRepository.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/DailyEmailAggregationJob.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/DailyEmailAggregationJob.java
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/db/EmailAggregationRepository.java
Outdated
Show resolved
Hide resolved
aggregator/src/test/java/com/redhat/cloud/notifications/DailyEventAggregationJobTest.java
Outdated
Show resolved
Hide resolved
aggregator/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
Show resolved
Hide resolved
aggregator/src/test/java/com/redhat/cloud/notifications/helpers/ResourceHelpers.java
Show resolved
Hide resolved
65360d6
to
03d24d4
Compare
/retest |
1 similar comment
/retest |
common-unleash/src/main/java/com/redhat/cloud/notifications/unleash/UnleashConfigSource.java
Outdated
Show resolved
Hide resolved
...m/redhat/cloud/notifications/db/repositories/EmailAggregationRepositoryBasedOnEventTest.java
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/DailyEmailAggregationJob.java
Outdated
Show resolved
Hide resolved
aggregator/src/main/java/com/redhat/cloud/notifications/db/EmailAggregationRepository.java
Outdated
Show resolved
Hide resolved
a020cf1
to
b02dd64
Compare
aggregator/src/main/java/com/redhat/cloud/notifications/db/EmailAggregationRepository.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/com/redhat/cloud/notifications/processors/email/EmailAggregator.java
Outdated
Show resolved
Hide resolved
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") |
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.
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!
…ilAggregationRepository.java Co-authored-by: Gwenneg Lepage <[email protected]>
…/email/EmailAggregator.java Co-authored-by: Gwenneg Lepage <[email protected]>
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.
LGTM 🎉
Exec plan details about new queries are available in linked Jira ticket.