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

support filtering on annotation with regex #259

Merged
merged 6 commits into from
Aug 5, 2022
Merged

support filtering on annotation with regex #259

merged 6 commits into from
Aug 5, 2022

Conversation

wangxiaoxuan273
Copy link
Contributor

Signed-off-by: wangxiaoxuan273 [email protected]

Resolves issue #203

@wangxiaoxuan273
Copy link
Contributor Author

As annotation has the structure of map[string]string, my implementation of the filtering has 2 arguments: key and regex. The function will first call the map with key, and then match the returned value with regex.

extendedcopy.go Outdated Show resolved Hide resolved
extendedcopy.go Show resolved Hide resolved
extendedcopy.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2022

Codecov Report

Merging #259 (2a7fceb) into main (da314f8) will decrease coverage by 0.07%.
The diff coverage is 60.86%.

@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
- Coverage   70.57%   70.50%   -0.08%     
==========================================
  Files          35       35              
  Lines        3055     3078      +23     
==========================================
+ Hits         2156     2170      +14     
- Misses        669      675       +6     
- Partials      230      233       +3     
Impacted Files Coverage Δ
extendedcopy.go 66.66% <60.86%> (-1.76%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

Instead of FilterAnnotation, I am thinking if FilterPredecessors might be more appropriate.

extendedcopy.go Outdated Show resolved Hide resolved
extendedcopy.go Outdated Show resolved Hide resolved
extendedcopy.go Outdated Show resolved Hide resolved
extendedcopy.go Outdated Show resolved Hide resolved
Signed-off-by: wangxiaoxuan273 <[email protected]>
Signed-off-by: wangxiaoxuan273 <[email protected]>
Signed-off-by: wangxiaoxuan273 <[email protected]>
Signed-off-by: wangxiaoxuan273 <[email protected]>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@shizhMSFT shizhMSFT merged commit bdbf6a9 into oras-project:main Aug 5, 2022
@wangxiaoxuan273 wangxiaoxuan273 deleted the annotation-filter branch August 5, 2022 06:10
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.

4 participants