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

Plugin error messages not straightforward for users #404

Closed
Two-Hearts opened this issue May 14, 2024 · 5 comments · Fixed by #406
Closed

Plugin error messages not straightforward for users #404

Two-Hearts opened this issue May 14, 2024 · 5 comments · Fixed by #406
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Two-Hearts
Copy link
Contributor

What is not working as expected?

As a user of Notation CLI, the following command:
notation sign --id $Id --plugin $my_plugin $my_image

could return the following error:
Error: describe-key command failed: VALIDATION_ERROR: {plugin specific error details}

This error message is not very user friendly:

  1. What does describe-key command stand for?
  2. What is been validated here that caused the VALIDATION_ERROR?

What did you expect to happen?

Move the details into verbose/debug logs and a more user-friendly error message might be:
Error: invalid plugin request: {plugin specific error details}

How can we reproduce it?

notation sign --id $Id --plugin $my_plugin $my_image with a misconfigured id.

The related error message is generated in notation-go/plugin/plugin.go.

Describe your environment

applies to all env

What is the version of your notation-go Library?

notation-go v1.1.0 with notation CLI v1.0.0+

@Two-Hearts Two-Hearts added bug Something isn't working triage Needs evaluation for feasibility, timeline, etc. labels May 14, 2024
@Two-Hearts Two-Hearts added enhancement New feature or request and removed bug Something isn't working labels May 14, 2024
@FeynmanZhou FeynmanZhou added this to the 1.2.0 milestone May 17, 2024
@FeynmanZhou FeynmanZhou removed the triage Needs evaluation for feasibility, timeline, etc. label May 17, 2024
@FeynmanZhou FeynmanZhou self-assigned this May 17, 2024
@FeynmanZhou
Copy link
Member

FeynmanZhou commented May 24, 2024

Thanks @Two-Hearts for reporting this issue.

In the short term, I suggest improving the error message to be more descriptive and actionable as follows:

Error: failed to sign with the plugin $my_plugin. Invalid input passed to "--id". 
Follow this format to input the ID "https://<vaultname>.vault.azure.net/<keys|certificate>/<name>/<version>"

In the long term, as this is a plugin-specific problem, we can improve the experience in the plugin side.
I created a GitHub issue in Notation Azure Key Vault plugin: Azure/notation-azure-kv#180. The error message will not be displayed after this issue has been resolved in Notation AKV plugin.

@JeyJeyGao
Copy link
Contributor

Error: failed to sign with the plugin $my_plugin.

This part is generated in notation-go. We need a PR to fix it.

Invalid input passed to "--id". Follow this format to input the ID "https://{vault-name}.vault.azure.net/certificates/{certificate-name}"

I simplified the example in the second part to make it easier for users to understand. This will done in Azure/notation-azure-kv#181

@FeynmanZhou

@Two-Hearts
Copy link
Contributor Author

@FeynmanZhou This issue is about the first half of the error message, Error: describe-key command failed: VALIDATION_ERROR:..., which is generated by notation-go library, the 2nd half is plugin specific.

@FeynmanZhou
Copy link
Member

@Two-Hearts Yes. We just need to improve the first part (line) of the error message in notation-go. The second part (line) is an actionable recommendation for users which could be improved in the plugin side.

Does the first part look good to you?

@Two-Hearts
Copy link
Contributor Author

@Two-Hearts Yes. We just need to improve the first part (line) of the error message in notation-go. The second part (line) is an actionable recommendation for users which could be improved in the plugin side.

Does the first part look good to you?

Yep, the first part LGTM. @FeynmanZhou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants