LegacyVersion class is removed from newer setuptools package. But
support for legacy versions is added in python-jenkins 1.8.2.
Switch to that implementation.
Fix broken plugin version comparison for legacy versions.
Assume latest plugin version if no plugin version is found.
Story: 2010990
Story: 2009943
Story: 2009819
Story: 2010842
Task: 49236
Task: 44852
Task: 44396
Task: 48448
Change-Id: Id7f0be1c42357454bd9bedcdee3fefb174943d81
Added support of multilevel type for extended choice parameter
dded jenkins_jobs.modules.helpers.check_mutual_exclusive_data_args decorator that used for validating data arguments
in jenkins_jobs.modules.parameters.extended_choice_param method.
Change-Id: Id8c0f8090dd99022501558cafa5b1c27e6675425
Task: #41320
Resolves flake8 BLK related issues.
"BLK100 Black would make changes."
"BLK999 Unexpected exception: ..."
Change-Id: Ic6d4265e3d02b2f2a15ab851eaed98288c62730c
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Updated test cases as well, The tag has been introduced after 2.35.2
therefore the parameter is also >=2.35.2
Change-Id: Ie0801108a16969b420b341e2deaa6ba62deb116c
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
Please review the following patch containing the code changes in
the repo. This patch is a transition patch and is the auto-generated
output of the python-black tool.
Change-Id: I2d2de71da8a105fb62b561899ae78441ddab4032
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
settings-type parameter hides global-settings-type and makes it
impossible to use settings from the file and ConfigFileProvider at the
same time like:
maven:
settings-type: file
settings: mvn/settings.xml
global-settings-type: cfp
global-settings: test
Change-Id: Ieda05912ae8b28942d98150a51c92b2521f2b6bf
Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
If optional setting was set and then is removed, Jenkins will retain the last
configured setting for the option. This is inconsistent as it is expected that
Jenkins will revert back to its default setting. And so optional parameters
should use default setting. That is, JJB will handle default setting if
optional parameter is not set.
Original issue:
http://lists.openstack.org/pipermail/openstack-infra/2016-February/003746.html
Change-Id: Iaf8684053f8a2a035467f13d91fe2f0a56be5906
Signed-off-by: Kien Ha <kienha9922@gmail.com>
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
Move main behaviour of trigger-parameterized-builds to helper methods
and rework pipeline to utilize.
Change pipeline to respect param ordering from yaml by based on the
same option as defined for trigger-parameterized-builds.
Change-Id: I42fdf4fe7fd41c9b6560a1ef57e7f150380180d5
- Added the following for builder and publisher
- Added all the fields for JMS Messaging plugins
- Added a minimal example
- Added a full example
- Added info in trigger for builder description of the plugin
Change-Id: Ifa209978dd38692da9f9d06bdf34782bd684a324
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>
Create the ModuleRegistry anywhere other than inside the YamlParser
class. This will make it slightly easier to factor a XmlGenerator out
of YamlParser, but I also want to work toward eliminating the circular
references between YamlParser and ModuleRegistry which have been
making it difficult to understand overall program flow.
This commit also replaces all YamlParser instances being passed to
Jenkins job config generating functions with a ModuleRegistry. Mostly
it seems like the parser was only needed to call the ModuleRegistry's
'dispatch' method which to be honest I don't fully understand. This is
where the circular references mentioned in previously come in...it
seems like the "dispatch" function needs access to the (mostly) raw
data contained by the parser, so it took that as a parameter.
The need for the YamlParser's job data can be satisfied by assigning
it to a property on the ModuleRegistry object before Yaml expansion or
XML generation begins; by doing this, we allow the ModuleRegistry to
avoid referencing the parser.
Change-Id: I4b571299b81e708540392ad963163fe092acf1d9
- Update helpers.artifactory_optional_props to use convert xml
Change-Id: Ib6ea675121a2cddd8e7df357b9b7855c41758529
Signed-off-by: Kien Ha <kienha9922@gmail.com>
- Update helpers.config_file_provider to use convert mapping to xml
Change-Id: I35859653b653347049e72c9e1bf09ce9764aaca2
Signed-off-by: Kien Ha <kienha9922@gmail.com>
valid_dict provides a way to set options through their key and value.
This allows users to set options using more conventional naming
schemes/values but the resulting XML will use the corresponding value
from the dict for that key.
Change-Id: I6574a5f33eecddb9b7927841f08600f3977f0ca6
Signed-off-by: Kien Ha <kienha9922@gmail.com>
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
- Update documentation
- Add valid options to max-duration, screenshot-interval, and
video-quality
- Test max-duration, screenshot-interval, and video-quality options
Change-Id: If010e7bc79e269b766107a5b2e57b9916ca8637d
Signed-off-by: Kien Ha <kienha9922@gmail.com>
Valid options provides a way to check if the value the user input is
from a list of available options.
Change-Id: I22409602fb526a83c0525772d68da1dbd28dd11b
Signed-off-by: Kien Ha <kienha9922@gmail.com>
When configuring the trigger_builds Builder in the Jenkins web
interface, you can add the parameter "Pass-through Git Commit that was
built". You could not configure this in a jobs.yml.
This commit adds that functionality (both to the builder
"trigger_builds " and the publisher "trigger_parameterized_builds").
I still want to be backwards compatible with the old version
(true/false) and maintain the similarity with the svn-revision param.
Which means that you can either configure it as
git-revision: true/false
or
git-revision:
combine-queued-commits: true/false
There were no prior case of shared code between builders and
publishers, so (by recommendation) I put the common logic in
builders.py, and then imported it in publishers.py.
I added thorough tests for the feature in the builders fixtures,
and only a basic test in the publishers fixtures, as suggested.
Change-Id: I72cdcae3fac1094ffcc9367369556b8bcbe2d5d7
In CFP plugin version >=2.10.0 the JJB code completely breaks for Maven
settings due to the new support for freeform cfp id names. We can detect
a old style name simply by reading the starting of the name and setting
it to set settings_type=cfp to maintain support for the old versions of
this plugin. Otherwise the default settings_type will fall back to 'file'.
Users using cfp will now need to set 'settings-type: cfp' in their YAML
files if they need to pull in CFP settings. All other settings file
configuration will work as it did in the past.
Change-Id: I650d485de6ecc1d2ef8fad6580c0c315fadde168
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
This will allow other modules to convert a mapping set to xml easily
with defaults so other methods don't have to create their own.
Includes behaviour to selectively omit or include empty tags.
Behaviour for default value:
None - omit this tag if users didn't put anything
"" - create an empty element if users didn't put anything
This is applied to the existing openshift plugin functions in
refactoring as Jenkins actually retains an empty XML tag when the
optional 'auth-token' setting is missing from the input job definition.
Which results in modifying the default test's output for the openshift
plugin.
Change-Id: I935a70ad191bc0f3f3dbd571b2b1cf7468106697
* This plugin gives Jenkins the ability to spawn amazon
cloudformation stacks before running the build and stopping it at
the end
* This change adds cloudformation ability to the builders and the
publishers to create stacks and to the publishers to tear the stack
down
Change-Id: I8041382fc6f1d569c322088a3bc8812332a131e8