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 support for ocischema.DeserializedImageIndex manifest type #618

Merged

Conversation

jessebye
Copy link
Contributor

@jessebye jessebye commented Sep 1, 2023

I botched the commit history in #617 (rebasing is hard :rage1:) and so started a fresh branch/PR. @jannfis I hope this addresses your feedback about code duplication - I refactored most of the common code into a helper function.

@jessebye jessebye force-pushed the ocischema-deserialized-image-index-1 branch from cc7494a to 4c72f73 Compare September 1, 2023 20:08
@codecov-commenter
Copy link

Codecov Report

Merging #618 (cc4a195) into master (d5a8f94) will decrease coverage by 0.29%.
Report is 3 commits behind head on master.
The diff coverage is 20.33%.

@@            Coverage Diff             @@
##           master     #618      +/-   ##
==========================================
- Coverage   65.63%   65.35%   -0.29%     
==========================================
  Files          22       22              
  Lines        2069     2084      +15     
==========================================
+ Hits         1358     1362       +4     
- Misses        577      588      +11     
  Partials      134      134              
Files Changed Coverage Δ
pkg/argocd/git.go 66.82% <0.00%> (ø)
pkg/registry/client.go 12.75% <4.44%> (-0.76%) ⬇️
pkg/argocd/gitcreds.go 76.19% <83.33%> (ø)
pkg/argocd/update.go 66.54% <83.33%> (+0.49%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jannfis
Copy link
Contributor

jannfis commented Sep 7, 2023

Thank you, @jessebye. How would you feel about adding some unit testing here? I know it's much of an ask, because there basically are none for the client right now.

// TagInfoFromReferences is a helper method to retrieve metadata for a given
// list of references. It will return the most recent pushed manifest from the
// list of references.
func TagInfoFromReferences(client *registryClient, opts *options.ManifestOptions, logCtx *log.LogContext, ti *tag.TagInfo, references []distribution.Descriptor) (*tag.TagInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is merely an internal helper, I think it could be better prototyped as:

func (client *registryClient) tagInfoFromReferences(...

to make it a method of registryClient and make it non-exported.

Copy link
Contributor

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM

@jannfis jannfis merged commit 420bd97 into argoproj-labs:master Sep 21, 2023
9 checks passed
@jessebye
Copy link
Contributor Author

@jannfis sorry I didn't get back to you, was off on vacation for a while 😄 thanks for reviewing/merging! Definitely agree on your feedback but don't have time to add unit tests at this point 😞

@jannfis
Copy link
Contributor

jannfis commented Sep 28, 2023

@jessebye No worries, thanks a lot for your contribution! We'll figure it out eventually and add unit testing along the way :)

mcfearsome pushed a commit to mcfearsome/argocd-image-updater that referenced this pull request Oct 5, 2023
…rgoproj-labs#618)

* fix: Add support for ocischema.DeserializedImageIndex manifest type

Signed-off-by: Jesse Bye <[email protected]>

* more informative error logging

Signed-off-by: Jesse Bye <[email protected]>

---------

Signed-off-by: Jesse Bye <[email protected]>
dlactin pushed a commit to dlactin/argocd-image-updater that referenced this pull request May 9, 2024
…rgoproj-labs#618)

* fix: Add support for ocischema.DeserializedImageIndex manifest type

Signed-off-by: Jesse Bye <[email protected]>

* more informative error logging

Signed-off-by: Jesse Bye <[email protected]>

---------

Signed-off-by: Jesse Bye <[email protected]>
sribiere-jellysmack pushed a commit to sribiere-jellysmack/argocd-image-updater that referenced this pull request Aug 13, 2024
…rgoproj-labs#618)

* fix: Add support for ocischema.DeserializedImageIndex manifest type

Signed-off-by: Jesse Bye <[email protected]>

* more informative error logging

Signed-off-by: Jesse Bye <[email protected]>

---------

Signed-off-by: Jesse Bye <[email protected]>
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.

3 participants