-
Notifications
You must be signed in to change notification settings - Fork 88
fix: plugin error message #1217
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
fix: plugin error message #1217
Conversation
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1217 +/- ##
==========================================
- Coverage 76.54% 76.54% -0.01%
==========================================
Files 67 67
Lines 3710 3727 +17
==========================================
+ Hits 2840 2853 +13
- Misses 671 674 +3
- Partials 199 200 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide a before-and-after comparison regarding this change?
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the changes in this PR does not align with the discussion in the original issue. Will review this PR once everyone is on the same page.
cc: @FeynmanZhou
Yes, the change may not be exactly as originally proposed, as I believe we need to retain the original Go built-in error for easier error investigation. I have added an additional recommendation message to improve the error message. Please have a look, @FeynmanZhou. |
@Two-Hearts The error message in original issue is no longer valid. @JeyJeyGao helped revisit the latest plugin-related error message and proposed this PR. We just need to make sure these error message follow the Notation CLI Error Handling and Message Guideline. |
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @JeyJeyGao
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Examples: **When putting an arbitrary file into the plugin folder:** Before: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: exec format error ``` After ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file `notation-azure-trustedsigning` is not executable. Use `notation plugin install` command to install the plugin. Please ensure that the plugin executable file is compatible with linux/amd64 ``` **When the plugin name is not followed the plugin spec:** Before ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file is either not found or inaccessible: stat /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: no such file or directory ``` After ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file `notation-azure-trustedsigning` not found. Use `notation plugin install` command to install the plugin. Each plugin executable must be placed in the $PLUGIN_DIRECTORY/{plugin-name} directory, with the executable named as 'notation-{plugin-name}'' ``` **When the notation plugin executable file is not executable:** Before/After are the same ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: permission denied ``` **When using an AMR64 arch of plugin file on an AMD64 machine:** Before: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: exec format error ``` After: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin file `notation-azure-trustedsigning` is not executable. Use `notation plugin install` command to install the plugin. Please ensure that the plugin executable file is compatible with linux/amd64 ``` Resolves notaryproject#704 --------- Signed-off-by: Junjie Gao <junjiegao@microsoft.com> Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Examples: **When putting an arbitrary file into the plugin folder:** Before: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: exec format error ``` After ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file `notation-azure-trustedsigning` is not executable. Use `notation plugin install` command to install the plugin. Please ensure that the plugin executable file is compatible with linux/amd64 ``` **When the plugin name is not followed the plugin spec:** Before ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file is either not found or inaccessible: stat /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: no such file or directory ``` After ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file `notation-azure-trustedsigning` not found. Use `notation plugin install` command to install the plugin. Each plugin executable must be placed in the $PLUGIN_DIRECTORY/{plugin-name} directory, with the executable named as 'notation-{plugin-name}'' ``` **When the notation plugin executable file is not executable:** Before/After are the same ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: permission denied ``` **When using an AMR64 arch of plugin file on an AMD64 machine:** Before: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: exec format error ``` After: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin file `notation-azure-trustedsigning` is not executable. Use `notation plugin install` command to install the plugin. Please ensure that the plugin executable file is compatible with linux/amd64 ``` Resolves notaryproject#704 --------- Signed-off-by: Junjie Gao <junjiegao@microsoft.com> Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Examples: **When putting an arbitrary file into the plugin folder:** Before: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: exec format error ``` After ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file `notation-azure-trustedsigning` is not executable. Use `notation plugin install` command to install the plugin. Please ensure that the plugin executable file is compatible with linux/amd64 ``` **When the plugin name is not followed the plugin spec:** Before ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file is either not found or inaccessible: stat /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: no such file or directory ``` After ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin executable file `notation-azure-trustedsigning` not found. Use `notation plugin install` command to install the plugin. Each plugin executable must be placed in the $PLUGIN_DIRECTORY/{plugin-name} directory, with the executable named as 'notation-{plugin-name}'' ``` **When the notation plugin executable file is not executable:** Before/After are the same ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: permission denied ``` **When using an AMR64 arch of plugin file on an AMD64 machine:** Before: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] fork/exec /home/jj/.config/notation/plugins/azure-trustedsigning/notation-azure-trustedsigning: exec format error ``` After: ``` NAME DESCRIPTION VERSION CAPABILITIES ERROR azure-trustedsigning [] plugin file `notation-azure-trustedsigning` is not executable. Use `notation plugin install` command to install the plugin. Please ensure that the plugin executable file is compatible with linux/amd64 ``` Resolves notaryproject#704 --------- Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Examples:
When putting an arbitrary file into the plugin folder:
Before:
After
When the plugin name is not followed the plugin spec:
Before
After
When the notation plugin executable file is not executable:
Before/After are the same
When using an AMR64 arch of plugin file on an AMD64 machine:
Before:
After:
Resolves #704