-
Notifications
You must be signed in to change notification settings - Fork 5
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
ENG-48446: Implementation for new Filter condition and filter conversion #228
Conversation
config-service-impl/src/main/java/org/hypertrace/config/service/store/FilterBuilder.java
Outdated
Show resolved
Hide resolved
// reject create config with condition | ||
if (optionalPreviousConfig.isEmpty() && request.hasUpsertCondition()) { | ||
throw Status.INVALID_ARGUMENT | ||
.withDescription("No upsert condition required for creating config") |
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.
We should probably treat this the same as an update operation where the condition doesn't hold. At least the same status, even if a specific message.
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.
So given the latest change, that'd be a failed precondition
config-service-impl/src/main/java/org/hypertrace/config/service/store/DocumentConfigStore.java
Outdated
Show resolved
Hide resolved
config-service-impl/src/main/java/org/hypertrace/config/service/store/FilterBuilder.java
Outdated
Show resolved
Hide resolved
config-service-impl/src/main/java/org/hypertrace/config/service/store/FilterBuilder.java
Outdated
Show resolved
Hide resolved
Test Results127 tests +5 127 ✅ +5 55s ⏱️ -3s Results for commit cdbd390. ± Comparison against base commit 7a59a85. This pull request removes 1 and adds 6 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #228 +/- ##
============================================
- Coverage 79.92% 79.52% -0.40%
+ Complexity 488 407 -81
============================================
Files 54 56 +2
Lines 2416 2496 +80
Branches 106 110 +4
============================================
+ Hits 1931 1985 +54
- Misses 425 446 +21
- Partials 60 65 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
// reject create config with condition | ||
if (optionalPreviousConfig.isEmpty() && request.hasUpsertCondition()) { | ||
throw Status.INVALID_ARGUMENT | ||
.withDescription("No upsert condition required for creating config") |
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.
So given the latest change, that'd be a failed precondition
config-service-impl/src/main/java/org/hypertrace/config/service/store/DocumentConfigStore.java
Show resolved
Hide resolved
@@ -262,7 +285,7 @@ private Filter buildConfigResourceContextsFilter( | |||
.map(this::getConfigResourceFieldContextFilter) | |||
.collect(Collectors.toUnmodifiableList()); | |||
Filter configResourceFieldContextFilter = new Filter(); | |||
configResourceFieldContextFilter.setOp(Filter.Op.OR); | |||
configResourceFieldContextFilter.setOp(OR); |
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.
In this PR or another - it'd be good to move this filter building into the filter builder class now that there's a dedicated class for it.
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.
ok making those refactor in a different PR
Description
Please include a summary of the change, motivation and context.
Testing
Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.
Checklist:
Documentation
Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.