Support project level plugin configuration
Some plugins need a configuration on project level (e.g. for
'plugins/reviewers-by-blame' the max number of reviewers that should
be automatically added should be configured per project). The idea is
to store this configuration in project.config inside a "plugin"
section having a subsection per plugin. E.g.:
[plugin "reviewers-by-blame"]
maxReviewers = 3
It should be avoided that each plugin needs to parse 'project.config'
on its own. It is also difficult from a plugin to cache the
configuration parameters as the plugin doesn't know when the
'project.config' file is updated.
Extend ProjectConfig so that it automatically parses all 'plugin'
sections on load. The values of these sections are stored internally
and can easily be accessed from a plugin, e.g.:
int maxReviewers = pluginConfigFactory
.get(project, "reviewers-by-blame")
.getInt("maxReviewers", 0);
Change-Id: I802f38a4d41814a51d40d41eb7824637c7e34948
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
3 files changed