notation icon indicating copy to clipboard operation
notation copied to clipboard

Improve error output for notation plugin

Open FeynmanZhou opened this issue 1 year ago • 1 comments

What is the areas you experience the issue in?

Notation CLI

What is not working as expected?

When putting an arbitrary file into the plugin folder:

notation plugin ls
NAME       DESCRIPTION   VERSION   CAPABILITIES   ERROR

azure-kv                           []             ERROR: response is not in JSON format. error: fork/exec /home/azureuser/.config/notation/plugins/azure-kv/notation-azure-kv: exec format error, stderr:

Suggestion: changing the error to /home/azureuser/.config/notation/plugins/azure-kv/notation-azure-kv: file format is not as expected

When the plugin name is not followed the plugin spec:

NAME       DESCRIPTION   VERSION   CAPABILITIES   ERROR

azure-kv                           []             stat /home/azureuser/.config/notation/plugins/azure-kv/notation-azure-kv: no such file or directory

Suggest: changing the error to Each plugin executable must be located under $PLUGIN_DIRECTORY/{plugin-name} directory, with executable named as notation-{plugin-name}.

When the notation plugin executable file is not executable:

NAME       DESCRIPTION   VERSION   CAPABILITIES   ERROR

azure-kv                           []             ERROR: response is not in JSON format. error: fork/exec /home/azureuser/.config/notation/plugins/azure-kv/notation-azure-kv: permission denied, stderr:

Suggest: changing it to /home/azureuser/.config/notation/plugins/azure-kv/notation-azure-kv: permission denied

When using an AMR64 arch of plugin file on an AMD64 machine:

notation plugin ls
NAME       DESCRIPTION   VERSION   CAPABILITIES   ERROR

azure-kv                           []             ERROR: response is not in JSON format. error: fork/exec /home/azureuser/.config/notation/plugins/azure-kv/notation-azure-kv: exec format error, stderr:

Suggest: changing the error to /home/azureuser/.config/notation/plugins/azure-kv/notation-azure-kv: file format is not as expected

What did you expect to happen?

See above

How can we reproduce it?

See above

Describe your environment

Ubuntu 20.08

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

v1.0.0-RC.7

FeynmanZhou avatar Jun 05 '23 16:06 FeynmanZhou