Support multiple forjj plugins repositories by default
Created by: clarsonneur
Introduction
Today, forjj load plugins definition from forjj-contribs
But this means a lot of restriction on this repository in term of development process, build automation and versionning.
A better approach would be to support multiple plugins repositories so that any plugins can have their own lifecycle. Following the forj-oss/forjj-contribs#113, forjj could change his behavior as:
By default:
- when an application name is given, like 'github', forjj will check if a
forjj-githubrepository exist in github. iehttps://github.com/forj-oss/forjj-<plugin>/raw/master/<plugin>.yaml - if not found, forjj will traditionnaly search in forjj-contribs.
If the application define the repo-path :
Forjj will ignore the default behavior and will search in following order to load the plugin definition file:
-
<repo-path>/forjj-<plugin>/raw/master/<plugin>.yaml, -
<repo-path>/<plugin>/raw/master/<plugin>.yamlIf not found, forjj fails
if the application define the absolute-path
Forjj will ignore the default behavior and will search for the plugin definition file to load it
-
<absolute-path>/github.yamlIf not found, forjj fails
Global setup
For private forge, we already have the ability to use internal collection of plugins.
The user can set the CONTRIBS_REPO or contrib-repo(Forjfile) or --contribs-repo to change the default path https://github.com/forj-oss/forjj-contribs/raw/master to something else.
But this one requires a 'cloned' forjj-contribs kind of repository. So lifecycle issue identical.
So, we need to add another setup parameter to change the 1. default behavior path, ie https://github.com/forj-oss/forjj-<plugin>/raw/master/ to something else.
We would need something like plugins-repo-path set by default to https://github.com/forj-oss/forjj-{{ .Name }}/raw/master/
like contribs-repo, we could have :
- Check for
FORJJ_PLUGINS_REPO_PATHenv variable - Check
--plugins-repo-path - Check in Forjfile for
forjj-settings/plugins-repo-path
When to push this US?
At earliest we can. So, I set it for 1.0.
Why?
- There is a need to create more plugins to enhance forjj. otherwise forjj stay too limited.
- At least, we need to add easily hubot, slack, and vault. Vault is a special case. but lifecycle should the same as any other plugins.
- If we want contributions, it must be more open to run plugins outside forjj stored in another public or private place.
- The code itself is not too complex. So ealisy implementable.
Following this change, current plugins can stay in forjj-contribs, but new one can be created anywhere.