Remove reference to ConfigParser object in ModuleRegistry. Instead:
* make use of JJBConfig.get_module_config to grab settings for Hipchat
Notifier Plugin
* make use of JJBConfig.yamlparser['allow_empty_variables'] rather
than repeating ConfigParser logic moved out of the YamlParser into
JJBConfig in an earlier commit.
Change-Id: Icb7ef514826005545e48af993335ce120f973b0d
Currently JJB warns over 700 times when checking project-config with:
WARNING:jenkins_jobs.registry:You have a macro ('tox') defined for
'builder' component type that is masking an inbuilt definition
Warn only once for this.
Change-Id: I010765269c499320fc9a84b9493d22949080e9a0
Prefer user defined macros over inbuilt entry points, as JJB may
accidentally use a name that has already been used by an end-user to
define a custom macro.
Warn users when they have a macro defined that masks an in-built
component to avoid accidentally changing XML generated with new
releases.
Change-Id: I6cae62d7cc40be6c4a5636a74f151fcce4cdd856
Use the component type entry points to infer modules to scan
corresponding modules and automatically construct entry points for any
functions associated with yaml entries in JJB definitions.
This removes the need for new JJB modules added directly to the project
to also need to be listed in the setup.cfg to be reachable. Simply
adding the needed functionality to the correct file ensures that it is
available.
Change-Id: I2a0fd8f6720ddfd8582b58e47556a87ed1ad553d
Prior to this patch macros serialized into a yaml document, a simple string
substitution was applied and then they were re-loaded into python. This
created several problems:
- newlines are lost because the yaml loading was not respecting the
newline settings of the original strings (Story: 1387060)
- {obj:} notation was not working for macro parameters (Story: 2000254)
- multiline strings passed into scripts will create a yaml syntax error
when being re-loaded (unticketed)
This patch resolves these problems by replacing the previous interpolation
code with the more robust `deep_format` method. A side effect of this patch
is that there are now fewer disparate code paths for interpolating variables.
Change-Id: Ia06c98286537a50dc52c6e5e000b32ebc9e8ede2
Signed-off-by: Justin Stoller <justin.stoller@gmail.com>
The goal of this patch is simply to move some classes out of
jenkins_jobs.builder into more appropriately-named modules. This started with
simply moving YamlParser into jenkins_jobs.parser but led to other moves in
order to avoid cyclic imports since YamlParser uses other classes previously
defined in jenkins_jobs.builder.
That said, this patch doesn't intend to address all of the clutter in
jenkins_jobs.builder, mostly just what is necessary to get started working on
YamlParser independent of other classes in that module.
Change-Id: Ie88bf683e495033eb0b670fe29c256a70282735f