headlamp icon indicating copy to clipboard operation
headlamp copied to clipboard

Create a compatibility validation for plugins

Open joaquimrocha opened this issue 2 years ago • 1 comments

Current situation

So far, we left the responsibility of ensuring Headlamp's plugins are compatible with the Headlamp core to whoever is running/deploying the plugins. However, if we are to make the installation of plugins more dynamic, we need to ensure that the compatibility of plugins vs Headlamp is clear.

Ideal future situation

When loading a plugin, Headlamp can check whether the plugin is compatible with it and warn the user otherwise, instead of trying to load the plugin straight away.

Implementation options

There are several ways we can do this. While Headlamp is in 0.x version, maybe relying on the Headlamp version itself for comparison with a plugins' inner compat version is not a good idea. So maybe we can have a plugin-engine version associated with Headlamp, as this allows us to decouple the Headlamp version from the plugin engine which can be useful in other cases too.

joaquimrocha avatar Feb 07 '22 11:02 joaquimrocha

  • Export the plugins package.json. It has a dependencies field, and we could check the version of "@kinvolk/headlamp-plugin" mentioned in there. Currently only the "plugin-name/main.js" file is exported, but it could also export the package.json. Other information in there that could be useful to display is the plugin name, description and also the plugins URL.
  • Feature detection. Plugins could detect Headlamp version and also features in the headlamp API. This way plugins could try and be compatible with multiple versions.
  • The unimplemented headlamp-plugin upgrade could check plugin compatibility. It could find API compatibilities. Whilst not checking compatibility of the plugin on the loading side, it could check on the development side.

illume avatar Jun 20 '22 17:06 illume

todo:

  • sketch out what UI a headlamp user would see
    • settings page plugins greyed out with message about plugin incompatibility
    • an alert / notification that a plugin is not
  • what would a headlamp author see?

illume avatar Oct 24 '23 11:10 illume

Decided on these:

  • To show that a plugin is snackbar, with a link to the settings
  • a compatibility check at build time of the app, and the container image.
  • we won't do engines now, as it is a complication.

To investigate more:

  • So this is when a plugin author is developing the plugin, they want to see if their plugin is compatible with the headlamp they are running.
  • a backend version type command could give the (version of headlamp, headlamp-plugin compatibility info).
  • the backend itself checks if a plugin is compatible, and we can run it as a command

illume avatar Nov 29 '23 10:11 illume