Skip to content

Conversation

@pavan-traceable
Copy link
Contributor

Description

Add support for Filtering, pagination and sorting in Config Service GetAllConfigsAPI

@pavan-traceable pavan-traceable requested a review from a team as a code owner April 14, 2025 11:24

// optional - pagination parameters to limit and offset the result set.
// Useful for retrieving configs in pages when total count is large.
Pagination pagination = 5;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed total_count for now, will add it later if required

@github-actions
Copy link

github-actions bot commented Apr 14, 2025

Test Results

135 tests  +1   135 ✅ +1   1m 5s ⏱️ +11s
 31 suites ±0     0 💤 ±0 
 31 files   ±0     0 ❌ ±0 

Results for commit 6a3bdaa. ± Comparison against base commit e8186d0.

♻️ This comment has been updated with latest results.

return ConstantExpression.of(value.getBoolValue());
case LIST_VALUE:
List<Value> values = value.getListValue().getValuesList();
// Infer and cast list element types (assumes homogeneous list)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than assume it and leave a comment we can easily validate this. e.g. collect kinds to set and ensure == 1. Or really <= 1, why not support empty list? Seems trivial to do and there are reasonable use cases (e.g. my_array_field EQ [])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it


case STRUCT_VALUE:
throw new UnsupportedOperationException("Struct not supported directly in this context");
case NULL_VALUE:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't compare to null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not able to find support Null values in ConstantExpression. Thats why marked as unsupported for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, we should add that at some point. For now, the main use case is probably eq/neq NULL which would represent in doc store as a EXISTS or NOT_EXISTS. So we could consider doing that translation if we need it rather than introducing those extra operators.

@codecov
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 21.49533% with 84 lines in your changes missing coverage. Please review.

Project coverage is 76.92%. Comparing base (7a59a85) to head (ddcdf31).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
.../config/service/store/FilterExpressionBuilder.java 2.38% 41 Missing ⚠️
...fig/service/store/ConstantExpressionConverter.java 0.00% 25 Missing ⚠️
...race/config/service/store/DocumentConfigStore.java 50.00% 12 Missing and 6 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #286      +/-   ##
============================================
- Coverage     79.93%   76.92%   -3.02%     
- Complexity      496      556      +60     
============================================
  Files            55       62       +7     
  Lines          2432     2795     +363     
  Branches        108      131      +23     
============================================
+ Hits           1944     2150     +206     
- Misses          427      563     +136     
- Partials         61       82      +21     
Flag Coverage Δ
integration 76.92% <21.49%> (-3.02%) ⬇️
unit 74.77% <21.49%> (-3.71%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return ConstantExpression.ofStrings(List.of());
}

// Infer and cast list element types (assumes homogeneous list)
Copy link
Contributor

@aaron-steinfeld aaron-steinfeld Apr 15, 2025

Choose a reason for hiding this comment

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

See earlier comment. We can easily validate this assumption and throw rather than translate something different than the caller intended

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it. Please check.

@pavan-traceable pavan-traceable merged commit e693d99 into main Apr 15, 2025
9 checks passed
@pavan-traceable pavan-traceable deleted the filtering-pagination-support-impl branch April 15, 2025 16:00
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.

3 participants