"prune-tags" removes tags from the local workspace before fetch if
they no longer exist on the remote. Support for this was added
to the git plugin in JENKINS-40529.
Change-Id: I204fd0a508944fecba8a3a26527793cdf37234f8
Story: https://storyboard.openstack.org/#!/story/2011138
The feature is supported by GitHub PR Comment Build Plugin. The change extends
property strategy configuration with a label regex parameter that triggers a job.
The job configuration is only supported by trusted users that have write access
to the repository.
Change-Id: Ib6910c6ebb78801710e334503a4545f08498ed0b
Adds a new scm.git choosing-strategy 'ancestry', corresponding to
AncestryBuildChooser, and two new options if that strategy is
selected, maximum-age and ancestor-sha1.
Includes doc and test updates.
Change-Id: Ib94f6100d4891b4196a6326c0678f638b4edbeab
Signed-off-by: Dan Mick <danmick@gmail.com>
"abort-builds" must be present in job_contents_keys in order for it to
properly work.
Also add a multibranch test for the yamlparser that will verify that
this works properly.
Change-Id: Ide9cd0f89a19002977cdcc2dfb9cd873e7d16945
The `pkg_resources` module no longer bundles a vendored version of the
`packaging` module. Add an explicit dependency on `packaging` and
directly use its classes.
Change-Id: I9362ca6d6323b56bc579db30e7f5bb40b57da65a
In the latest version of Jenkins, the default value of 'disabled' is
true. When 'disabled' is not set (or None), reconfig_job will activate
the job, but in some cases we hope that 'disabled' remain the last
setting.
When 'disabled' is not set (or None) in yaml, and the job exists,
fix_disabled will try to get 'disabled' from the jenkins server. So the
'disabled' value should match the current value on the jenkins server.
Change-Id: Icd840f15c4d48cd8a8ebc0f891beac68c2bb6bdd
Fix docs and docs-linkcheck tox targets:
It looks like recently sphinx began to check if footnotes are
referenced. If not, it issues a warning which is treated as error.
Fix Python 3.10 and 3.11:
It looks like opendev switched to Noble Ubuntu release.
Pin these versions to previous one.
Shift flake8 version.
New version ignores syntax whithin strings.
Fix formatting errors reported by flake8.
Change-Id: I9b23cccf0dc83fb56083b5fe8c9c026f5dff7e9a
This reverts commit 8bffa4d520edd1559d25c0fc7e2635f60e504d56.
8bffa4d520edd1559d25c0fc7e2635f60e504d56 introduced a bug where new jobs
without a `disabled` value configured in their source would fail to be
created on Jenkins.
Reverting 8bffa4d520edd1559d25c0fc7e2635f60e504d56 for now while the bug
is addressed and sufficient test cases created to catch such a
regression.
Change-Id: Ia8adc1f8394b6a745e8bbc7038c85958c56fd11b
It is expensive to read and parse an YAML file. This commit optimizes
for usecases where YAML files are reused across any input by caching the
raw parsing result.
* Pin setuptools version to 69.5.1 for Python >= 3.8
A change introduced in setuptools version 70.0.0 causes tests under
test_moduleregistry.py to fail with "InvalidVersion". Pin the setuptools
version for Python >= 3.8 until this is investigated and resolved.
Change-Id: I534d7a6d9992780cd8de4f8460190caf5c3bde12
The repo plugin supports 'cleanFirst' since plugin v1.11.0
9c7e81cbf0
Add support inside jenkins-job-builder to set that value.
Change-Id: Ifae1bad0f0fb4a56fc0f030038eefbcc8cd4ad6f
Either Jenkins seems to have made an update where the build strategy
properties have been moved, or this never worked. When generating the
XML using the Jenkins UI, the build strategies appear at the top level.
Prior to this patch, when using jjb, the configuration was completely
ignored, causing some charming build storms.
Breaking change: The legacy github org output is no longer correct.
Change-Id: Idb5bf025f9bcbf9d9588465713ea5a29ff069e6d
Don't only try to find undeclared variables from the current template
but also recursively find undeclared variables from included and
imported jinja2 templates.
Otherwise included/imported templates with variables can not be used.
Change-Id: Iebdce1accf74f27901d80a41c85624ba819bf2a8
sphinx.domain.python got split[0] into multiple modules so make the
sphinx extension work with older and newer Sphinx versions.
[0]
e9dcfebcf9
Change-Id: I2dfb085cd382e277562f4dcb3d903729dc388fd4
Use '!include-raw-expand:' instead of '!include-raw:'
and '!include-raw-verbatim:' instead of '!include-raw-escape:'.
Tags '!include-raw:' and '!include-raw-escape:' are now deprecated.
Change-Id: I3cc5ab9f73d03de1ba09cbc4568366a3bb464a08
Add support for the following configuration options:
- stripSingleParents
- flattentTapResult
- skipIfBuildNotOk
- removeYamlIfCorrupted
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Change-Id: I387e5cd46fadb54e478627346dc6b4223bda1fc0
Currently, global defaults are merged to custom defaults for job
templates, but not for jobs.
Unify this behaviour.
Change-Id: I26fb2678df7f4225571bf7c3cd4be7041ce99217
Expand variables inside macros without parameters and jobs
the same way as they are expanded inside macros with parameters
and job templates.
Make tags behave inside macros without parameters and jobs
the same way as they are expanded inside macros with parameters
and job templates.
Update or fix affected tests.
Story: 2010588
Story: 2010963
Story: 2010535
Task: 47394
Task: 49069
Task: 47151
Change-Id: Ie05ae6aa386c62ebbf68dd3e2c7001a4e444a47a
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
'pre-scm-buildstep' wrapper has two modes:
1. Older: no 'buildsteps' element is specified. Build steps is a list under
wrapper name. For example:
- pre-scm-buildstep:
- shell: echo hello
- shell: echo bye
2. Newer: build steps specified inside 'buildsteps' mapping element:
- pre-scm-buildsteps:
buildsteps:
- shell: echo hello
- shell: echo bye
But, when 'preSCMbuildstep' plugin version is equal or higher 0.3, and first
mode is used, it fails.
Fix that.
Change-Id: I010d9f6c5e06ccd8c2723026aae2c60f79917ff4
Story: 2010711
Search for included files relative to the current job first
Change-Id: I34a5743967bf7cbb8b464a0a36abad24180d61e4
Signed-off-by: Max Trunov <trunov_ms@taximaxim.ru>
Currently, Loader.source_path is used for both error locations and
as base for include directory.
But, it is set to "<expanded j2-yaml>" by !j2-yaml: tag, which makes it
unusable as base for include directory.
Make separate source_dir attribute for this usage.
Change-Id: I67669eb42f761e2d76e89992e6ad89480ddd3df0
Folders was not actually tested by tests. Fix tests and add more tests.
Fix bug in code unearthed by now-working tests: defaults were not checked
for job folders.
Task: 49188
Change-Id: I922af7a28b0ec0c99ef3f8a17b3d5a9c10f2dce0
Now, when tag !include-raw: has variable in included file path,
included file is expanded.
And lazy-loading mechanics is removed - now it can be expanded in
the usual way.
Change-Id: I7234d42793a080e7f4186707c4d1d2e9404bd7f3