Allow plugins to provide their own name
Plugin name is an important part for plugin developers and users: it drives SSH command names, REST API endpoints, used as a prefix in project.config for plugin-owned capabilities and can be used in project.config sections for project specific configuration. Currently there is no way for a plugin to provide its own name. When a new version of a plugin is released and it is copied to $site/plugins folders with unchanged name: replication-2.8.SNAPSHOT.jar then the plugin name in all places mentioned above is changed. With this change plugin name can be optionally provided by plugins, instead of deriving it from the plugin file name. To provide its own plugin name, plugin has to put the following line in the manifest file: Gerrit-PluginName: replication This is especially useful for plugins that contribute plugin-owned capabilities that are stored in project.config file as [plugin-name]-[capability-name] Other use case is to be able to put project specific plugin configuration section in project.config. In this case it is advantageous to reserve the plugin name to access the configuration section in project.config file. Multiple versions of the same plugin with different file names can not be deployed on one Gerrit installation site: only the first plugin can be successful deployed. All other plugins with the same name are disabled. If plugin provides its own name, it has some implications for SSH install command and PUT /plugins/plugin-name REST endpoint. In both cases a name of the plugin to install is passed from the user. If the plugin provides its own name in MANIFEST file, the plugin name from the MANIFEST file has precedence over the name passed to the SSH command or REST endpoint. Change-Id: If28349e95be2e90c6ee8169a72ba8cd642b49b98
This commit is contained in:
committed by
David Pursehouse
parent
b00e99f5aa
commit
366ad0eae8
@@ -63,7 +63,9 @@ Install Plugin
|
||||
'PUT /plugins/link:#plugin-id[\{plugin-id\}]'
|
||||
|
||||
Installs a new plugin on the Gerrit server. If a plugin with the
|
||||
specified name already exists it is overwritten.
|
||||
specified name already exists it is overwritten. Note: if the plugin
|
||||
provides its own name in the MANIFEST file, then the plugin name from
|
||||
the MANIFEST file has precedence over the \{plugin-id\} above.
|
||||
|
||||
The plugin jar can either be sent as binary data in the request body
|
||||
or a URL to the plugin jar must be provided in the request body inside
|
||||
@@ -242,7 +244,6 @@ IDs
|
||||
~~~~~~~~~~~~~
|
||||
The ID of the plugin.
|
||||
|
||||
|
||||
[[json-entities]]
|
||||
JSON Entities
|
||||
-------------
|
||||
|
||||
Reference in New Issue
Block a user