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

add support for intersection & union in search operations #968

Merged
merged 9 commits into from Aug 18, 2022

Conversation

dsa0x
Copy link
Contributor

@dsa0x dsa0x commented Aug 12, 2022

Summary

This PR addresses this enhancement issue #849, which suggested adding support for intersection and union search. The PR adds support for and and or operators.

  • and operation returns a union of values in each list (i.e no duplicates)
  • or returns a list of all values, not minding duplicates.

Release Note

new: support for intersection and union search through the use of and and or operators.

Documentation

Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
@dsa0x dsa0x force-pushed the sams/intersection-union-search branch from 944d14f to befb72d Compare August 12, 2022 08:21
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
@dsa0x dsa0x force-pushed the sams/intersection-union-search branch from e64a153 to ed6c9e3 Compare August 12, 2022 09:41
@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2022

Codecov Report

Merging #968 (f642f5e) into main (5019f3e) will decrease coverage by 7.22%.
The diff coverage is 76.47%.

@@            Coverage Diff             @@
##             main     #968      +/-   ##
==========================================
- Coverage   48.15%   40.93%   -7.23%     
==========================================
  Files          61       69       +8     
  Lines        5401     6491    +1090     
==========================================
+ Hits         2601     2657      +56     
- Misses       2520     3551    +1031     
- Partials      280      283       +3     
Impacted Files Coverage Δ
cmd/rekor-cli/app/search.go 20.58% <50.00%> (+0.89%) ⬆️
pkg/api/index.go 41.44% <76.66%> (ø)
cmd/rekor-cli/app/pflags.go 85.71% <100.00%> (+0.38%) ⬆️
pkg/sharding/ranges.go 46.01% <0.00%> (-1.26%) ⬇️
pkg/types/alpine/v0.0.1/entry.go 54.77% <0.00%> (-1.25%) ⬇️
pkg/api/api.go 0.00% <0.00%> (ø)
pkg/api/public_key.go 0.00% <0.00%> (ø)
pkg/api/trillian_client.go 0.00% <0.00%> (ø)
pkg/api/entries.go 0.00% <0.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
@dsa0x dsa0x marked this pull request as ready for review August 12, 2022 15:01
@dsa0x dsa0x requested a review from a team as a code owner August 12, 2022 15:01
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
@dlorenc
Copy link
Member

dlorenc commented Aug 14, 2022

Oh wow, this is really cool!

Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

Thanks! Quick question on correctness/expectation here.

cmd/rekor-cli/app/search.go Outdated Show resolved Hide resolved
pkg/api/index.go Outdated Show resolved Hide resolved
@dsa0x dsa0x changed the title add support for intersection and union search add support for and & or operations Aug 15, 2022
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
@dsa0x dsa0x force-pushed the sams/intersection-union-search branch from d99c7c3 to 12b38af Compare August 17, 2022 00:58
@dsa0x dsa0x requested a review from asraa August 17, 2022 00:59
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
@dsa0x dsa0x force-pushed the sams/intersection-union-search branch from 357442c to ec6f3e5 Compare August 17, 2022 01:08
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
@dsa0x dsa0x changed the title add support for and & or operations add support for intersection & union in search operations Aug 17, 2022
Signed-off-by: Samsondeen Dare <samsondeen.dare@hashicorp.com>
Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

This looks amazing now! Great work. Good job on the unit tests and testing in e2e.
The implementation was very cool to read.

@dlorenc dlorenc merged commit b874488 into sigstore:main Aug 18, 2022
@github-actions github-actions bot added this to the v1.0.0 milestone Aug 18, 2022
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.

None yet

4 participants