Bug 967625 - [RFE] Support API version check for UI plugins
[RFE] Support API version check for UI plugins
Status: CLOSED WONTFIX
Product: oVirt
Classification: Community
Component: ovirt-engine-webadmin (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Nobody's working on this, feel free to take it
bugs@ovirt.org
ux
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-27 12:23 EDT by vszocs
Modified: 2014-06-16 11:32 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-16 11:32:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description vszocs 2013-05-27 12:23:08 EDT
As discussed on engine-devel mailing list [1], this RFE aims to support UI Plugin API version check as part of plugin bootstrap process, as well as providing API version to plugins at runtime.

Following is a design proposal for implementing UI Plugin API version check feature.

UI Plugin infrastructure will have its API versioned, i.e. providing API version number (integer) that can only go up in time.

Assume we have a UI plugin, i.e. /usr/share/ovirt-engine/ui-plugins/example.json

Each plugin can (optionally) specify required API version:

example.json:
"name": "example-plugin",
"apiVersion": "xxx"
...

Where "xxx" is an interval with syntax similar to [2]:
[2] --> actualApiVersion == 2
[2,3] --> 2 <= actualApiVersion <= 3
(2,) --> 2 < actualApiVersion

If "apiVersion" is specified, UI Plugin infrastructure performs API version check as part of plugin bootstrap, i.e. just before loading given plugin via corresponding <iframe> element. If "apiVersion" doesn't meet "actualApiVersion", the plugin won't be loaded but moved to new state to indicate API version mismatch (i.e. special case of FAILED state).

If "apiVersion" is not specified, we assume the plugin works with any API version, bypassing API version check altogether.

To support use-case like "my plugin supports API version 2 to 4, but for version 3 it needs to do something differently", there will be API for retrieving actual UI Plugin API version at runtime. For example:

var api = parent.pluginApi('example-plugin');
var version = api.version();
if (version == 3) {
    // Do something
}

[1] http://www.mail-archive.com/engine-devel@ovirt.org/msg03663.html
[2] http://maven.apache.org/enforcer/enforcer-rules/versionRanges.html
Comment 1 Itamar Heim 2014-06-16 11:32:29 EDT
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.

Note You need to log in before you can comment on or make changes to this bug.