Skip to content

refactor: expose a way of ordering explorer query by interval #74

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

Merged
merged 2 commits into from
Mar 15, 2021

Conversation

aaron-steinfeld
Copy link
Contributor

Description

Because the interval field in explorer was first class, the generic ordering argument that accepted a string as key does not support anything beyond the default ordering, which is ascending. Along with hypertrace/gateway-service#82 , this adds support for ordering by interval by passing the name of the interval field intervalStart without otherwise changing the api.

Testing

Added UT. Will test e2e before merging

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@aaron-steinfeld aaron-steinfeld requested a review from a team as a code owner March 15, 2021 02:21
@codecov
Copy link

codecov bot commented Mar 15, 2021

Codecov Report

Merging #74 (cec6452) into main (4e8c9b5) will decrease coverage by 5.32%.
The diff coverage is 84.50%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #74      +/-   ##
============================================
- Coverage     28.02%   22.69%   -5.33%     
- Complexity       48       66      +18     
============================================
  Files            43       64      +21     
  Lines          1092     1586     +494     
  Branches         34       49      +15     
============================================
+ Hits            306      360      +54     
- Misses          780     1219     +439     
- Partials          6        7       +1     
Flag Coverage Δ Complexity Δ
unit 22.69% <84.50%> (-5.33%) 0.00 <18.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...lorer/dao/GatewayServiceExploreRequestBuilder.java 0.00% <ø> (ø) 0.00 <0.00> (?)
...explorer/request/DefaultExploreRequestBuilder.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ce/graphql/spaces/dao/ExplorerBackedSpacesDao.java 90.00% <90.00%> (-0.79%) 7.00 <0.00> (ø)
...o/GatewayServiceExploreOrderArgumentConverter.java 90.32% <90.32%> (ø) 10.00 <10.00> (?)
.../explorer/request/ExploreOrderArgumentBuilder.java 90.90% <90.90%> (ø) 8.00 <8.00> (?)
...graphql/explorer/request/ExploreOrderArgument.java 100.00% <100.00%> (ø) 0.00 <0.00> (?)
.../graphql/explorer/fetcher/ExploreResultMapKey.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...plorer/request/ExploreSelectionRequestBuilder.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...er/dao/GatewayServiceExploreResponseConverter.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...ization/IntervalArgumentDeserializationConfig.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e8c9b5...cec6452. Read the comment docs.

@github-actions

This comment has been minimized.


private Maybe<OrderByExpression> buildAttributeOrderExpression(ExploreOrderArgument argument) {
return Maybe.fromOptional(argument.attribute())
.doOnComplete(() -> log.error("Attribute order argument missing attribute: {} ", argument))
Copy link
Contributor

Choose a reason for hiding this comment

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

RxJava has weird operator names. doOnComplete should ideally have been called doOnEmpty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I had to double check that one - complete == an empty final state, success == a final state with a value.

skjindal93
skjindal93 previously approved these changes Mar 15, 2021
@github-actions

This comment has been minimized.

@aaron-steinfeld aaron-steinfeld merged commit 28b7af5 into main Mar 15, 2021
@aaron-steinfeld aaron-steinfeld deleted the explorer-order-reversal branch March 15, 2021 14:45
@github-actions
Copy link

Unit Test Results

10 files  +2  10 suites  +2   13s ⏱️ ±0s
20 tests +2  20 ✔️ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 28b7af5. ± Comparison against base commit 4e8c9b5.

skjindal93 pushed a commit that referenced this pull request Jun 21, 2024
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.

2 participants