notation icon indicating copy to clipboard operation
notation copied to clipboard

Create plugin add to place plugin in proper directory

Open dtzar opened this issue 3 years ago • 5 comments

Currently notation plugin only officially supports the list command. It is confusing, error prone, and time consuming for users to have to go lookup what the proper directory is for plugins. Suggestion is to add support for notation plugin add <name> <path-to-local-plugin-file> which automatically creates the proper directory and adds the plugin file there.

dtzar avatar Jun 08 '22 16:06 dtzar

This might be more challenging for a multi-file plug-in that might be written in Java or .net if the expectation is to copy the plug-in over.

sajayantony avatar Jun 08 '22 17:06 sajayantony

Expectation would be to copy the file over. It was my understanding that a plugin must be a single executable file - at least that's what I was reading in the code.

dtzar avatar Jun 08 '22 19:06 dtzar

@gokarnm any inputs on this?

sajayantony avatar Jun 08 '22 21:06 sajayantony

I agree that expecting users to copy over files to appropriate plugin location is error prone and bad CX. This is not prioritized for RC1 by should be by GA release. The plugin itself can be a set of files, containing the executable and any dependencies, and is expected to be placed in a sub directory with matching name e.g ~/notation/plugins/com.example.nv2plugin/notation-com.example.nv2plugin.

Something like notation plugin add <name> <path-to-local-plugin-directory> would work better, and does the following

  • Validate that plugin executable exists as per plugin executable naming convention, and has correct permissions
  • Create directory name in plugin base directory
  • Copy all the file in path-to-local-plugin-directory to the plugin sub directory.

We also have a notion of system and user level paths for plugin base dir, so probably will need a switch for it and a default value.

gokarnm avatar Jun 08 '22 21:06 gokarnm

The multi-file thing is a good issue. Perhaps we can pass in a file, or a directory. This behavior did previously exist, but it was single-file based. It's another good first issue for someone to pickup

SteveLasker avatar Jun 14 '22 21:06 SteveLasker

We should also consider an approach similar to Docker plugin.
i.e. notation plugin install <name>

dtzar avatar Nov 03 '22 16:11 dtzar

Can I work on this?

Manas23601 avatar Feb 23 '23 17:02 Manas23601

@dtzar Could you confirm it is duplicate of https://github.com/notaryproject/notation/issues/549, which provides more details and context. Maybe we could close this one and track #549

yizha1 avatar Feb 25 '23 01:02 yizha1

Agree 549 is duplicate, solves the problem, and has more detail on a design for implementation than this issue

dtzar avatar Mar 01 '23 00:03 dtzar