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

feat: add flag to skip deleting obsolete referrers index #957

Merged
merged 48 commits into from
Jul 3, 2023

Conversation

qweeah
Copy link
Contributor

@qweeah qweeah commented May 29, 2023

What this PR does / why we need it:
This PR adds a flag to oras attach, oras cp and oras manifest push. The flag can be used to specify whether to clean up old referrers index when referrers API is not available.

There is not a breaking change and by default, mentioned commands will still do referrers cleanup.

Depends on merging of #967.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #954, fixes #952, fixes #915

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

@codecov-commenter
Copy link

codecov-commenter commented May 29, 2023

Codecov Report

Merging #957 (757f2ae) into main (f9aec91) will increase coverage by 0.30%.
The diff coverage is 85.71%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #957      +/-   ##
==========================================
+ Coverage   81.08%   81.39%   +0.30%     
==========================================
  Files          53       54       +1     
  Lines        2792     2816      +24     
==========================================
+ Hits         2264     2292      +28     
+ Misses        358      355       -3     
+ Partials      170      169       -1     
Impacted Files Coverage Δ
cmd/oras/internal/option/referrers.go 55.55% <55.55%> (ø)
cmd/oras/internal/errors/errors.go 100.00% <100.00%> (ø)
cmd/oras/root/attach.go 85.48% <100.00%> (+2.98%) ⬆️
cmd/oras/root/cp.go 86.86% <100.00%> (+0.49%) ⬆️
cmd/oras/root/manifest/push.go 77.27% <100.00%> (+4.40%) ⬆️

@qweeah qweeah changed the title feat!: add flag for referrers garbage collection feat!: add flag to skip deleting obsolete referrers index Jun 2, 2023
qweeah added 15 commits June 6, 2023 01:32
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah qweeah changed the title feat!: add flag to skip deleting obsolete referrers index feat: add flag to skip deleting obsolete referrers index Jun 6, 2023
Signed-off-by: Billy Zha <jinzha1@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.

What about the manifest delete path?

cmd/oras/internal/option/referrers.go Outdated Show resolved Hide resolved
@qweeah
Copy link
Contributor Author

qweeah commented Jun 29, 2023

What about the manifest delete path?

Referrers index deletion happens after manifest deletion right? If the registry already supports deletion and the token used covers manifest deletion, why would referrers index fail?

Also why would user want to skip referrers index deletion when manifest deletion is successful?

@shizhMSFT
Copy link
Contributor

Referrers index deletion happens after manifest deletion right? If the registry already supports deletion and the token used covers manifest deletion, why would referrers index fail?

LoL. Makes sense.

Signed-off-by: Billy Zha <jinzha1@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

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

@qweeah qweeah merged commit ba60b99 into oras-project:main Jul 3, 2023
qweeah added a commit to qweeah/oras that referenced this pull request Aug 3, 2023
…s-project#957)"

This reverts commit ba60b99.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
shizhMSFT pushed a commit to shizhMSFT/oras that referenced this pull request Aug 3, 2023
…s-project#957)"

This reverts commit ba60b99.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
shizhMSFT pushed a commit to shizhMSFT/oras that referenced this pull request Aug 3, 2023
…t#957)

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Co-authored-by: Terry Howe <tlhowe@amazon.com>
shizhMSFT pushed a commit to shizhMSFT/oras that referenced this pull request Aug 3, 2023
…s-project#957)"

This reverts commit ba60b99.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah added a commit to qweeah/oras that referenced this pull request Aug 3, 2023
…as-project#957)"

This reverts commit ba60b99.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah added a commit to qweeah/oras that referenced this pull request Aug 3, 2023
…as-project#957)"

This reverts commit ba60b99.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah added a commit to qweeah/oras that referenced this pull request Aug 3, 2023
…as-project#957)"

This reverts commit ba60b99.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah added a commit that referenced this pull request Aug 3, 2023
…)" (#1046)

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah added a commit to qweeah/oras that referenced this pull request Aug 9, 2023
qweeah added a commit to qweeah/oras that referenced this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
4 participants