Improve/fix parsing of plugins/editors attribute #13385
Labels
kind/question
Questions that haven't been identified as being feature requests or bugs.
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
Description
There are a few issues with how the plugins/editors attribute in workspaces is parsed and handled:
Plugins with custom registry can cause weird parsing results. E.g. plugin
http://registry.com/myPublisher/myPluginName
(no version) parses toThis should instead be treated as an invalid reference.
The imposed structure requires even externally hosted
meta.yaml
s to be placed according to thepublisher/name/version
structure, without much meaning (as long as there are three/
in the URL it would work). We don't use the plugin string for anything meaningful when a non-default 'registry' is used, AFAIK.Allowing registry to be optionally specified complicates certain other features being implemented, such as defaulting to
latest
when version is not specified (If the plugin version is not specified - fall back onlatest
redhat-developer/rh-che#1396)With this in mind, we should consider the following paths:
Rework how plugins are defined for workspaces. In general, parsing important information out of a (mostly) arbitrary string is error prone and difficult to understand. Instead, plugins could be specified in json that is friendlier to parsing, e.g.
where
reference
is an overriding URL to the plugin'smeta.yaml
. While this is more complicated than previous, ideally end-users should not be editing the raw configs themselves, and the above format may be easier to comprehend.This change may also be helpful for the eventual future when the registry gets a REST API.
Remove support for registry in plugin references. Instead of expecting plugins to specify an non-default registry in the plugin reference string (
[registry/]publisher/name/version
), we restrict plugin references to two separate options:publisher/name/version
spec, we treat it as such and assume it is in the default configured registry. Publisher and name must be alphanumeric plus'-'
, and version can also contain'.'
.This approach is maybe simpler to implement currently, but more fragile overall.
cc: @l0rd @ibuziuk WDYT?
The text was updated successfully, but these errors were encountered: