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

Missing reference details in error messages #808

Closed
yizha1 opened this issue Oct 27, 2023 · 1 comment · Fixed by #810
Closed

Missing reference details in error messages #808

yizha1 opened this issue Oct 27, 2023 · 1 comment · Fixed by #810
Assignees
Labels
bug Something isn't working triage Need to triage

Comments

@yizha1
Copy link
Contributor

yizha1 commented Oct 27, 2023

What is not working as expected?

The reference details are missing in error messages from Notation CLI. It is hard to know what is wrong and troubleshooting is time consuming, especially when using Notation CLI in CI/CD pipeline and pass environment variable in the command line.

Here are some examples:

$ notation sign
Error: missing reference

$ notation sign net-monitor:v1
Error: invalid reference: missing repository

$ notation sign test localhost:5000/net-monitor:v1
Error: invalid reference: missing repository

$ notation sign localhost:5001/net-monitor localhost:5001/net-monitor:v1
Error: failed to get manifest descriptor: reference cannot be empty

$ notation sign localhost:5001/net-monitor
Error: failed to get manifest descriptor: reference cannot be empty

$ notation verify
Error: missing reference

$ notation verify localhost:5001/net-monitor
Error: failed to get manifest descriptor: reference cannot be empty

$ notation verify test localhost:5001/net-monitor:v1
Error: invalid reference: missing repository

$ notation verify localhost:5001 localhost:5001/net-monitor:v1
Error: invalid reference: missing repository

$ notation inspect
Error: missing reference

$ notation inspect localhost:5001/net-monitor
Error: failed to get manifest descriptor: reference cannot be empty

$ notation inspect test localhost:5001/net-monitor:v1
Error: invalid reference: missing repository

$ notation ls
Error: no reference specified

$ notation ls test localhost:5000/net-monitor:v1
Error: invalid reference: missing repository

$ notation ls net-monitor:v1
Error: invalid reference: missing repository

What did you expect to happen?

The error message can give clear information about what is missing and what is not correct based on the actual value that users input, for example

$ notation sign
Error: missing reference to the artifact

$ notation sign net-monitor:v1
Error: "net-monitor:v1": invalid reference: missing repository

How can we reproduce it?

Run the example commands

Describe your environment

Linux

What is the version of your Notation CLI or Notation Library?

notation v1.0.0

@yizha1 yizha1 added bug Something isn't working triage Need to triage labels Oct 27, 2023
@Two-Hearts Two-Hearts self-assigned this Oct 27, 2023
@Two-Hearts
Copy link
Contributor

@yizha1 I'm working on a PR to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Need to triage
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants