Collect plugins which should be processed by webpack

Currently, the method to collect the plugins which should be processed by webpack is implemented like this:

Rule 1: the plugin starts with foreman or katello
Rule 2: it does not end with “_core” or “-core”

Plugins not named like this can not use deliver react complements e.g.

Every foreman plugin normally should know, that its a foreman plugin :slight_smile: In the ruby gem specification there is a metadata attribute which can be used to specify, that its a foreman plugin.

Keep in mind: Metadata items have the following restrictions:

  • The metadata must be a Hash object
  • All keys and values must be Strings
  • Keys can be a maximum of 128 bytes and values can be a maximum of 1024 bytes
  • All strings must be UTF-8, no binary data is allowed

I’m currently working on a PR to use the new metadata flag “is_foreman_plugin”:

The suggestion would be, to remove the old implementation completely and only use the “is_foreman_plugin” flag.

CC @ekohl @Laviro

4 Likes

+1 for using only is_foreman_plugin in the plugin gem metadata.

The plugin template should be updated as well:

Then we should encourage plugin authors to update. Luckily not a huge number of plugins use webpack so it should be fairly easy.

1 Like

Sure, I will do this after we have clarified and agreed that this approach is the prefered one.

See: https://github.com/theforeman/foreman_plugin_template/pull/36

Given there is no objection and it’s a simple addition without removal, I’d say we can start with implementing this.

A quick grep through foreman-packaging’s rpm/develop branch I think these are Foreman plugins that use webpack. It may not be complete or correct, but it may help you:

  • foreman-tasks
  • foreman_acd
  • foreman_ansible
  • foreman_discovery
  • foreman_leapp
  • foreman_openscap
  • foreman_puppet
  • foreman_remote_execution
  • foreman_rh_cloud
  • foreman_snapshot_management
  • foreman_statistics
  • foreman_templates
  • foreman_webhooks
  • katello

There is additional one which is not packaged yet, but is using webpack:

  • foreman_host_reports