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

feat: Order alias target #3217

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

nasdf
Copy link
Member

@nasdf nasdf commented Nov 7, 2024

Relevant issue(s)

Resolves #3196

Description

This PR adds alias targeting to query orderings.

Aggregate targets are not included in this PR as they require more changes.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

Added integration tests.

Specify the platform(s) on which this was tested:

  • MacOS

@nasdf nasdf added the feature New feature or request label Nov 7, 2024
@nasdf nasdf added this to the DefraDB v0.15 milestone Nov 7, 2024
@nasdf nasdf self-assigned this Nov 7, 2024
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 86.04651% with 12 lines in your changes missing coverage. Please review.

Project coverage is 77.58%. Comparing base (a89524a) to head (8800a79).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
internal/planner/mapper/mapper.go 88.46% 4 Missing and 2 partials ⚠️
internal/request/graphql/parser/order.go 77.78% 4 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3217      +/-   ##
===========================================
+ Coverage    77.41%   77.58%   +0.16%     
===========================================
  Files          382      382              
  Lines        35178    35236      +58     
===========================================
+ Hits         27233    27335     +102     
+ Misses        6311     6279      -32     
+ Partials      1634     1622      -12     
Flag Coverage Δ
all-tests 77.58% <86.05%> (+0.16%) ⬆️

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

Files with missing lines Coverage Δ
internal/planner/mapper/targetable.go 75.24% <100.00%> (ø)
internal/request/graphql/parser/filter.go 60.00% <100.00%> (ø)
internal/request/graphql/schema/generate.go 86.98% <100.00%> (+0.05%) ⬆️
internal/planner/mapper/mapper.go 87.17% <88.46%> (-0.18%) ⬇️
internal/request/graphql/parser/order.go 83.75% <77.78%> (+6.96%) ⬆️

... and 15 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@nasdf nasdf requested a review from a team November 7, 2024 19:36
},
testUtils.Request{
Request: `query {
Users(order: {_alias: {Age: ASC}}) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

thought: It would be nice to see a test with a compound order query that includes an alias.

Copy link
Member Author

Choose a reason for hiding this comment

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

added a compound test

Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

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

LGTM! Just one thought (non-blocking).

@nasdf nasdf merged commit dae2820 into sourcenetwork:develop Nov 11, 2024
42 of 43 checks passed
islamaliev pushed a commit to islamaliev/defradb that referenced this pull request Nov 13, 2024
## Relevant issue(s)

Resolves sourcenetwork#3196

## Description

This PR adds alias targeting to query orderings.

**Aggregate targets are not included in this PR as they require more
changes.**

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

Added integration tests.

Specify the platform(s) on which this was tested:
- MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order alias targeting
2 participants