Make use of an improved regex pattern matching to simply escape the
template name when passing into the params to allow the name be
preserved and used as input to other params.
This avoids needing to perform an additional branch test against all
variables being formatted.
Change-Id: I9c0ac8996d520b9acff3d29039c5c3d76f56d899
Depends-On: I8a74f9b4236ca7bcc72dd207fca23c2bf6a7c801
Adds empty triggerInformationAction section which when
missing was generating recurring spam on Jenkins logs.
included null not assignable to interface hudson.model.Action
See https://issues.jenkins-ci.org/browse/JENKINS-45788
Change-Id: I97efbfcb17388b5ca99901aa35f4311c8db77710
This fixes the following error message that is produced when using the
old hipchat module in a real world scenario (as opposed to a synthetic
test):
jenkins_jobs.errors.JenkinsJobsException: Unknown entry point or macro 'name' for component type: 'publisher'.
It works in the tests/hipchat/fixtures/hipchat005.yaml test because
the `data` dict contains only the 'hipchat' key, but when used in a
job-template, the dict contains a lot more, e.g. 'name', 'project-type',
'description' etc.
To make testing more difficult, `data` is not an OrderedDict, but dict
(see YamlParser._applyDefaults), so it behaves differently across python
versions, due to different order of dict.items (hash randomization, ...).
Therefore the test contains seemingly unnecessary fields like
'project-type', 'scm' and 'description'. Without these, it would pass
without the fix on at least one of py27, py35, py36, and it's rather
likely I haven't covered all possible scenarios (different platforms?).
Change-Id: Ie45084f1a4d6405d7e60dde5fce619a66dc026db
This is a preparation for the next commit which adds a testcase that
requires a plugins_info with newer version of hipchat plugin.
Change-Id: Ia8a7b226a375f407d4e0fb067737118efd0ab845
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
View documentation was not properly being generated and linked
in the index. Let's add that in.
Change-Id: I6197dbecc89ddcf8c6f6b0e6a3d4c517224dc77b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Before:
{{var}} -> {var}, but the regex matches at the inner brace, but
re_replace returns the whole match (match.group(0) = "{var}") unchanged, passing
"{{var}}" to Formatter.
{{defined_var|def}} -> {{defined_var}}, because the regex matches at the
inner brace and re_replace returns "{%s}" % key ("{defined_var}"), passing just
"{{defined_var}}" to Formatter.
{{undefined_var|def}} -> exception, because the regex again matches at
the inner brace and re_replace returns default ("def"), passing "{def}"
to Formatter which then fails as def is not a defined variable (assuming
it isn't and allow_empty = False).
{{undefined_var|defined_var}} -> value of defined_var, same as above,
"{defined_var}" is passed to Formatter.
By preventing the regex from matching at inner braces, none of these
weird cases happen and even-braced strings are passed to Formatter
unmodified.
Change-Id: I8a74f9b4236ca7bcc72dd207fca23c2bf6a7c801
Co-Authored-By: Tomáš Janoušek <tomas.janousek@gooddata.com>
Inject the template-name into parameters earlier, so it's possible to
use it in the global defaults. Mark the template name as 'verbatim' so
the interpolation is skipped by the formatter.
Change-Id: I5d98e32ed2bedaa6b536e61fbdec589f358f861f
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>
Bumps python-jenkins version to avoid few
remarkable issues fixed in it:
- allow to wait for jenkins to enter normal operation
- remove cap on pbr version
- more py3 enablement
- other, see its changelog
Change-Id: I508b412bc2d17561e7a7ceef015ea018615596ad
Remove unnecessary class members that are not used or queried after
object initialization.
Remove temporary assignment no longer needed.
Change-Id: Iab2cd2a69fae103967bb20cf2ede4884f4bf67d6
If, for whatever reason, the version of the build-timeout
plugin can not be detected, assume that we use a newer version (>= 1.14).
Version 1.14 is already ~ 2 1/2 years old so this is a sane assumption.
Also adjust fixtures to use the newer plugin version xml output.
Change-Id: I86295933d0c3247f55d0114473fc9c8f8feb7441
Signed-off-by: Bertrand Roussel <broussel@sierrawireless.com>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
JJB supports both Python 2 and 3 without any need to convert the
source, so we can safely publish universal wheels.
Change-Id: I59fdc6271ac662bf04fb84ba32b6bca6fe5e8624
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>
File inclusion is debug info, info level would
spam console and make user unable to get
progress info without it.
File inclusion can easily mean >100 lines for
users relying on templating.
Change-Id: I013d86d8563fd75f5255578c0c735c4f2d5c074b