Add print_job_urls = True to [job_builder] to enable output as urls
instead of simple job names when changing them.
Change-Id: I3454606a50ca385c87d8c13d3eab5d30d94cf02f
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Avoids occasional test executions failures
caused by leftover files on dev machine or
by preexisting configuration files.
Change-Id: Ia0ba29e2dda58c37410a6926cae3039e4ba3473e
Introduced by a7af4a4c100916f77456a8dabbc92a3f935bde62
config.validate() expects the presence of builder['plugins_info'].
Its value can either be null or a list.
Change-Id: Idc9f0be7b25cc254f2aea958d5c3bc8b3ccaac89
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Remove unnecessary class members that are not used or queried after
object initialization.
Remove temporary assignment no longer needed.
Change-Id: Iab2cd2a69fae103967bb20cf2ede4884f4bf67d6
Based on current documentation:
If no configuration files are found (either in the default paths or
given through the command-line), jenkins-jobs will skip querying for
plugin information
Change-Id: Ic83dfc89eb07013054a5582a8a44e787605db735
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Use a simple object to ensure matching against any default value is
possible to distinguish been not being set by a user versus use of
a negative default value passed.
This prevents triggering an incorrect notification to the user when
the code is querying for plugin options that could override the
default behaviour and the compatibility code attempts to look up an non
existing section. It would fail to distinguish between no section
present and current value to return matching the default value
suggested.
Change-Id: I5597c2628ccb5a4282a97a4ce5d3bbe41bd9eebb
Migrate from a global config __future__ to control behaviour to plugin
specific options to decide on whether to take the param order from yaml
when using the trigger-parameterized-builds plugin or when plugins are
making use of it as well.
Adjust the config retrieval to support a default value to simplify
logic around ensuring the behaviour matches 'true' by default.
Remove some redundant logic in helper module handling a default value
lookup and add some additional conf files to continue having some tests
using the old behaviour.
Remove old conf files setting the __futures__.param_order_from_yaml to
true as this is now the default under the correct plugin setting.
Change-Id: Ibd5f549b6d626bacaaa4221015a70aaf03626b00
Remove the old default hipchat configuration style in favour of
using the new plugin style and provide a mechanism to copy the url
value from the jenkins section automatically as part of a simple
migration.
This will allow removal of querying the jenkins section from existing
module code and allow for better isolation.
Change-Id: I6889777904ebabc01c044abcd31c9d8a20c255c4
Allows user to specify which section from ini config
should be used for loading Jenkins server details.
Change-Id: I57633662e3ca2dba48af8db9e08fb8d5f8bc3bfa
Plugins can use get_plugin_config() which will search in a plugin
namespace. For example:
[plugin "hipchat"]
authtoken = 123token
- Updated hipchat plugin to use get_plugin_config()
- Updated stash plugin to use get_plugin_config()
- Backwards compatibility is kept by falling back to the old
configuration setting if the new one is not found.
- Warning is displayed if the old configuration method is used.
Change-Id: I7cff063e2d179a5d9a3f221c85de6864382bc477
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
This corrects the issue where a config file in a standard location is
not used if --conf <file> is not passed on the command line.
Change-Id: I4a17d342f2751359381658a545441465d4a42a9b
Signed-off-by: Philip Marc Schwartz <philip@progmad.com>
Make sure that flush cache is correct set first by config file, and
additionally that the CLI overrides any defaults.
In the V2 API work, when moving code around the flush cache option was
accidentally removed from being set by the command line or config
files. This ensures it follows the same behaviour as other similar
options.
Change-Id: I9fb1e234e5ed081ada64855389a87d2f7555469e
This commit sees JJBConfig start to take the form it ought to have,
namely using attributes to represent different logical sections of
configuration that target specific subsystems of JJB.
It also moves ConfigParser data retrieval from
jenkins_jobs.modules.helpers.get_value_from_yaml_or_config_file() to
jenkins_jobs.config.JJBConfig.get_module_config()
TODO: Add JJBConfig tests to validate the behavior of JJBConfig in
specific circumstances.
Change-Id: I053d165559f5325a2f40b239117a86e6d0f3ef37
Ensure that argparser object only makes use of the JJBConfig object
instead of leaking a command line parser into a config object for API
usage.
Take care to use 'None' as default for store_true/store_false options
in order to ensure that the config file defaults are only overridden
when CLI options are explicitly set.
Change-Id: I4066ad750f9893759c2e9bdfde425fafacc7e672
* Create jenkins_jobs.config module with JJBConfig class.
* Move DEFAULT_CONF from jenkins_jobs.cmd into jenkins_jobs.config
* Move configuration initialization into JJBConfig
* Create method, "do_magical_things" to handle arbitration between
config file and arguments as well as setting default values for
config file settings if it doesn't contain the expected keys.
* Move JenkinsJobs.create_parser into its own module,
jenkins_jobs.cli.parser, it can be used to provide default settings
in the JJBConfig class when an argparse namespace object is not
provided; this is primarily necessary because most of the original
configuration initialization code relies on this being a namespace
object (simple descendant of the object class).
At this point JJBConfig isn't much more than an object-oriented
version of the way configuration handling happened previously. Its
current form, however, is more amenable to the ultimate goal of the
2.0 refactorings--namely, being able to pass a single config object
around rather than breaking it up into apparently arbitrary settings
necessary to instantiate the Builder class and its delegate objects.
Change-Id: Ic0147e1dccbe620aaaba039a434e7cea6c670054