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

fix: add nil checks for some functions #327

Merged
merged 11 commits into from
Sep 22, 2022

Conversation

jasminetMSFT
Copy link
Contributor

Add nil checks for functions oras.WithTargetPlatform, oras.FilterAnnotation and oras.FilterArtifactType.

Resolves #318
Signed-off-by: JasmineTang jasminetang@microsoft.com

Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2022

Codecov Report

Merging #327 (9fecd8a) into main (bedc4c4) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #327      +/-   ##
==========================================
+ Coverage   72.42%   72.46%   +0.04%     
==========================================
  Files          38       38              
  Lines        3615     3621       +6     
==========================================
+ Hits         2618     2624       +6     
  Misses        738      738              
  Partials      259      259              
Impacted Files Coverage Δ
copy.go 60.82% <100.00%> (+0.54%) ⬆️
extendedcopy.go 68.96% <100.00%> (+0.54%) ⬆️

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: JasmineTang <jasminetang@microsoft.com>
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
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

Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Signed-off-by: JasmineTang <jasminetang@microsoft.com>
Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM

extendedcopy.go Outdated
Comment on lines 181 to 186
// - If key is available in the predecessor's annotation and regex is not nil,
// return the predecessor if the annotation value matches the regex.
// - If key is available in the predecessor's annotation and regex is nil,
// return the predecessor.
// - If key is unavailable in the predecessor's annotation, the predecessor
// will not be returned.
Copy link
Contributor

@shizhMSFT shizhMSFT Sep 22, 2022

Choose a reason for hiding this comment

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

A predecessor is kept if the key is in its annotation and matches the regex if present.

Signed-off-by: JasmineTang <jasminetang@microsoft.com>
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 3f9653f into oras-project:main Sep 22, 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.

Missing nil checks
5 participants