Skip to content

feat: add type for failure during deleting dangling referrer index#482

Merged
Wwwsylvia merged 19 commits into
oras-project:mainfrom
qweeah:dangling
Apr 27, 2023
Merged

feat: add type for failure during deleting dangling referrer index#482
Wwwsylvia merged 19 commits into
oras-project:mainfrom
qweeah:dangling

Conversation

@qweeah

@qweeah qweeah commented Apr 11, 2023

Copy link
Copy Markdown
Contributor

Resolves #479

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@codecov-commenter

codecov-commenter commented Apr 11, 2023

Copy link
Copy Markdown

Codecov Report

Merging #482 (be342e1) into main (e8225cb) will increase coverage by 0.08%.
The diff coverage is 63.63%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #482      +/-   ##
==========================================
+ Coverage   72.84%   72.92%   +0.08%     
==========================================
  Files          49       49              
  Lines        4518     4528      +10     
==========================================
+ Hits         3291     3302      +11     
  Misses        919      919              
+ Partials      308      307       -1     
Impacted Files Coverage Δ
registry/remote/referrers.go 92.04% <33.33%> (-4.30%) ⬇️
registry/remote/repository.go 68.87% <100.00%> (+0.64%) ⬆️

Comment thread registry/remote/referrers.go Outdated
Comment thread registry/remote/referrers.go Outdated
Comment thread registry/remote/referrers.go Outdated
qweeah added 2 commits April 11, 2023 17:13
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@sajayantony

Copy link
Copy Markdown
Contributor

Is the digest of the manifest that failed to be deleted included in the errro?

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Although please answer Sajay's question. Digest appears to be included to me.

Comment thread registry/remote/referrers.go Outdated
@SteveLasker

Copy link
Copy Markdown
Contributor

I'm struggling to understand why we'd delete content for the user: #479 (comment)

@qweeah

qweeah commented Apr 12, 2023

Copy link
Copy Markdown
Contributor Author

Is the digest of the manifest that failed to be deleted included in the error?

It implicitly implied in the ReferrersTag, will add subject descriptor so caller don't need to do reversed conversion for referrers tag schema.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we may have more specific errors in the future. It would be better if we can introduce a generic error to avoid error type blow up.

A sample error can be

type ReferrersError struct {
    Op      string
    Subject ocispec.Descriptor
    Err     error
}

Other examples can be found by

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah

qweeah commented Apr 12, 2023

Copy link
Copy Markdown
Contributor Author
type ReferrersError struct {
    Op      string
    Subject ocispec.Descriptor
    Err     error
}

Updated, made it more generic to a remote.IgnorableError, not only for referrers.

@sajayantony

Copy link
Copy Markdown
Contributor

Ignorable is confusing to me. It’s up to the caller to decide that IMHO.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Comment thread registry/remote/errop/errors.go Outdated
Comment thread registry/remote/referrers.go Outdated
Comment thread registry/remote/errop/errors.go Outdated
Comment thread registry/remote/referrers.go Outdated
Comment thread registry/remote/errop/errors.go Outdated
qweeah added 2 commits April 13, 2023 16:52
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Comment thread registry/remote/errop/errors.go Outdated

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@qweeah It would be better if we can have a runnable example to show how this error can be parsed. Basically, we can have a mock registry which does not support delete.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Comment thread registry/remote/referrers.go Outdated
Comment thread registry/remote/referrers.go Outdated
qweeah added 2 commits April 15, 2023 07:46
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah added 2 commits April 23, 2023 15:50
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Comment thread registry/remote/referrers.go
qweeah added 2 commits April 24, 2023 23:48
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread registry/remote/referrers.go Outdated
Comment thread registry/remote/example_test.go Outdated
qweeah added 3 commits April 27, 2023 03:07
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>

@Wwwsylvia Wwwsylvia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia Wwwsylvia merged commit b74a2a1 into oras-project:main Apr 27, 2023
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.

Feature Request: err type for dangling referrers index deletion failure

7 participants