Skip to content

fix: oras push should return error when artifacttype is empty for spec 1.1#1317

Merged
qweeah merged 3 commits into
oras-project:mainfrom
wangxiaoxuan273:spec
Apr 8, 2024
Merged

fix: oras push should return error when artifacttype is empty for spec 1.1#1317
qweeah merged 3 commits into
oras-project:mainfrom
wangxiaoxuan273:spec

Conversation

@wangxiaoxuan273

@wangxiaoxuan273 wangxiaoxuan273 commented Mar 29, 2024

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
oras push should return an error when --config is used, --artifact-type is not used and --image-spec is set to v1.1.

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 #1313

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

codecov Bot commented Apr 1, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.10%. Comparing base (122f01b) to head (15e944c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1317      +/-   ##
==========================================
+ Coverage   84.06%   84.10%   +0.04%     
==========================================
  Files          90       90              
  Lines        3458     3467       +9     
==========================================
+ Hits         2907     2916       +9     
  Misses        329      329              
  Partials      222      222              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wangxiaoxuan273 wangxiaoxuan273 marked this pull request as ready for review April 2, 2024 06:04
@wangxiaoxuan273

wangxiaoxuan273 commented Apr 2, 2024

Copy link
Copy Markdown
Contributor Author

There are 3 issues to discuss:

  1. Do we allow users to input --image-spec auto? (currently yes)
  2. What should be the output of oras push -h for --image-spec? (current display below)
Screenshot 2024-04-02 at 15 08 57
  1. We need to document the behavior of auto. (default to v1.1, unless --config is used and --artifact-type is not given)

Comment thread cmd/oras/root/push.go
Comment thread cmd/oras/root/push.go Outdated
Comment thread test/e2e/suite/command/push.go
Comment thread test/e2e/suite/command/push.go Outdated
Comment thread test/e2e/suite/command/push.go Outdated
Comment thread cmd/oras/internal/option/spec.go Outdated
Comment thread cmd/oras/root/push.go Outdated
Comment thread cmd/oras/internal/option/spec.go
Comment thread cmd/oras/root/push.go Outdated
Comment thread cmd/oras/root/push.go Outdated
…c 1.1

Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.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 with suggestions

Comment thread cmd/oras/root/push.go Outdated

@qweeah qweeah 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

Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
@qweeah qweeah merged commit 2ef6dc0 into oras-project:main Apr 8, 2024
@wangxiaoxuan273 wangxiaoxuan273 deleted the spec branch April 9, 2024 08:21
FeynmanZhou pushed a commit to FeynmanZhou/oras that referenced this pull request May 11, 2024
…c 1.1 (oras-project#1317)

Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
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.

avoid pushing artifacts without artifactType if --image-spec v1.1 is specified

3 participants