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

feat: plugin install iteration 2 #369

Merged
merged 31 commits into from
Jan 12, 2024
Merged

Conversation

Two-Hearts
Copy link
Contributor

@Two-Hearts Two-Hearts commented Jan 5, 2024

This PR is the 2nd iteration of plugin install.
Installation SHOULD pass in any of the following scenario:

  1. Installing a single valid plugin executable file on file system. An example can be notation-com.example.plugin on Unix and notation-com.example.plugin.exe on Windows.
  2. Installing from a dir which contains one and only one executable file with file name in the notation-{plugin-name} format.
  3. On Unix, install from a dir which contains no executable file, however, there's one and only one candidate file with file name in the notation-{plugin-name} format. (Notation would set it to executable and try install it with a warning alert to the user). On Windows, install would fail in this case since '.exe' file extension is required.

Corresponding tests are added as well.

Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (706eab8) 73.34% compared to head (3d8621d) 73.35%.

Files Patch % Lines
plugin/manager.go 84.00% 3 Missing and 1 partial ⚠️
plugin/manager_unix.go 75.00% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #369   +/-   ##
=======================================
  Coverage   73.34%   73.35%           
=======================================
  Files          27       27           
  Lines        2480     2492   +12     
=======================================
+ Hits         1819     1828    +9     
- Misses        522      524    +2     
- Partials      139      140    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Patrick Zheng <[email protected]>
@Two-Hearts Two-Hearts changed the title fix: installing a plugin fix: installing a single plugin executable file Jan 5, 2024
@Two-Hearts Two-Hearts changed the title fix: installing a single plugin executable file fix: installing a plugin with file extension on Unix Jan 5, 2024
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
@Two-Hearts Two-Hearts changed the title fix: installing a plugin with file extension on Unix fix: plugin install iteration 2 Jan 8, 2024
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
@Two-Hearts Two-Hearts changed the title fix: plugin install iteration 2 feat: plugin install iteration 2 Jan 8, 2024
plugin/manager_windows.go Outdated Show resolved Hide resolved
plugin/manager_windows.go Outdated Show resolved Hide resolved
plugin/manager_windows.go Show resolved Hide resolved
plugin/manager.go Outdated Show resolved Hide resolved
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
@Two-Hearts Two-Hearts requested a review from shizhMSFT January 10, 2024 03:16
Signed-off-by: Patrick Zheng <[email protected]>
@Two-Hearts Two-Hearts requested a review from shizhMSFT January 10, 2024 05:18
shizhMSFT
shizhMSFT previously approved these changes Jan 10, 2024
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

plugin/manager.go Outdated Show resolved Hide resolved
plugin/plugin.go Show resolved Hide resolved
Signed-off-by: Patrick Zheng <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Copy link
Contributor

@rgnote rgnote 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
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

Copy link
Contributor

@JeyJeyGao JeyJeyGao left a comment

Choose a reason for hiding this comment

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

LGTM

@Two-Hearts Two-Hearts merged commit b315de4 into notaryproject:main Jan 12, 2024
7 checks passed
@Two-Hearts Two-Hearts deleted the fix branch January 12, 2024 02:17
@Two-Hearts Two-Hearts mentioned this pull request Jan 24, 2024
6 tasks
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.

5 participants