Skip to content

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

Merged
merged 15 commits into from
Mar 25, 2025

Conversation

JeyJeyGao
Copy link
Contributor

@JeyJeyGao JeyJeyGao commented Mar 12, 2025

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

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.54%. Comparing base (784ffb8) to head (1455007).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/notation/plugin/list.go 80.00% 3 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
@JeyJeyGao JeyJeyGao marked this pull request as ready for review March 12, 2025 12:59
Copy link

@Two-Hearts Two-Hearts left a 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?

@JeyJeyGao
Copy link
Contributor Author

Can you provide a before-and-after comparison regarding this change?

Updated.

Copy link

@Two-Hearts Two-Hearts left a 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

@JeyJeyGao
Copy link
Contributor Author

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.

@FeynmanZhou
Copy link
Member

FeynmanZhou commented Mar 14, 2025

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

@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>
FeynmanZhou
FeynmanZhou previously approved these changes Mar 17, 2025
Copy link
Member

@FeynmanZhou FeynmanZhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @JeyJeyGao

shizhMSFT
shizhMSFT previously approved these changes Mar 18, 2025
Copy link
Contributor

@shizhMSFT shizhMSFT left a 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>
@JeyJeyGao JeyJeyGao dismissed stale reviews from shizhMSFT and FeynmanZhou via 6e57033 March 19, 2025 02:57
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
FeynmanZhou
FeynmanZhou previously approved these changes Mar 20, 2025
Copy link
Member

@FeynmanZhou FeynmanZhou left a 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>
Copy link

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@FeynmanZhou FeynmanZhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JeyJeyGao JeyJeyGao merged commit b7a2f0c into notaryproject:main Mar 25, 2025
7 checks passed
@JeyJeyGao JeyJeyGao deleted the fix/plugin_error_message branch March 25, 2025 00:23
Two-Hearts pushed a commit to Two-Hearts/notation that referenced this pull request Apr 23, 2025
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>
Two-Hearts pushed a commit to Two-Hearts/notation that referenced this pull request Apr 23, 2025
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>
FeynmanZhou pushed a commit to FeynmanZhou/notation that referenced this pull request May 15, 2025
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>
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.

Improve error output for notation plugin
4 participants