perf: save auth requests for push and attach#1097
Merged
Merged
Conversation
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Codecov Report
❗ 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 #1097 +/- ##
==========================================
+ Coverage 79.99% 80.08% +0.08%
==========================================
Files 56 57 +1
Lines 2914 2927 +13
==========================================
+ Hits 2331 2344 +13
Misses 405 405
Partials 178 178
|
qweeah
reviewed
Aug 31, 2023
Member
Follow up? |
Contributor
Created #1104. @Wwwsylvia Do we still need to create the issue for copying? |
Member
Author
Created #1105. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Add
pull, pushscope hints before callingCopyfororas pushandoras attach.This can potentially save 2 requests for each command.
oras push
Before
request
#0: HEAD manifest digest - 401request
#1: POST token (scope: pull) - 200request
#2: HEAD manifest digest - 404request
#3: HEAD config ({}) - 404request
#4: POST config ({}) - 401request
#5: POST token (scope: pull, push) - 200request
#6: POST config ({}) - 202request
#7: PUT config ({}) - 201request
#8: PUT manifest tag - 201After
request
#0: HEAD manifest digest - 401request
#1: POST token (scope: pull) - 200request
#2: HEAD manifest digest - 404request
#3: HEAD config ({}) - 404request
#4: POST config ({}) - 202request
#5: PUT config ({}) - 201request
#6: PUT manifest tag - 201oras attach
Before
request
#0: HEAD subject tag - 401request
#1: POST token (scope: pull) - 200request
#2: HEAD subject tag - 200request
#3: HEAD manifest digest - 404request
#4: HEAD config ({}) - 200request
#5: HEAD layer - 404request
#6: POST layer - 401request
#7: POST token (scope: pull, push) - 200request
#8: POST layer - 202request
#9: PUT layer - 201request
#10: PUT manifest tag - 201After
request
#0: HEAD subject tag - 401request
#1: POST token (scope: pull) - 200request
#2: HEAD subject tag - 200request
#3: HEAD manifest digest - 404request
#4: HEAD config ({}) - 200request
#5: HEAD layer - 404request
#6: POST layer - 202request
#7: PUT layer - 201request
#8: PUT manifest tag - 201Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #1084
Please check the following list: