In 67645a46eb the requirement on
setuptools was removed in favor of the version implementation in
python-jenkins. However, other code (regsitry.py, xml_config.py) is
still using pkg_resources, which leads to errors like this:
% jenkins-jobs
ERROR:stevedore.extension:Could not load 'delete': No module named 'pkg_resources'
ERROR:stevedore.extension:Could not load 'delete-all': No module named 'pkg_resources'
ERROR:stevedore.extension:Could not load 'get-plugins-info': No module named 'pkg_resources'
ERROR:stevedore.extension:Could not load 'list': No module named 'pkg_resources'
ERROR:stevedore.extension:Could not load 'test': No module named 'pkg_resources'
ERROR:stevedore.extension:Could not load 'update': No module named 'pkg_resources'
Traceback (most recent call last):
File "/tmp/tmp.qQ9GsQCSeH/venv/bin/jenkins-jobs", line 8, in <module>
sys.exit(main())
^^^^^^
File "/tmp/tmp.qQ9GsQCSeH/venv/lib64/python3.12/site-packages/jenkins_jobs/cli/entry.py", line 177, in main
jjb = JenkinsJobs(argv)
^^^^^^^^^^^^^^^^^
File "/tmp/tmp.qQ9GsQCSeH/venv/lib64/python3.12/site-packages/jenkins_jobs/cli/entry.py", line 60, in __init__
self.parser = create_parser()
^^^^^^^^^^^^^^^
File "/tmp/tmp.qQ9GsQCSeH/venv/lib64/python3.12/site-packages/jenkins_jobs/cli/parser.py", line 112, in create_parser
extension_manager.map(parse_subcommand_args, subparser)
File "/tmp/tmp.qQ9GsQCSeH/venv/lib64/python3.12/site-packages/stevedore/extension.py", line 276, in map
raise NoMatches('No %s extensions found' % self.namespace)
stevedore.exception.NoMatches: No jjb.cli.subcommands extensions found
I could only reproduce this on Python 3.12, as on 3.11 and earlier a
`python -m venv` installs setuptools already (to bootstrap pip?).
Fixes: 67645a46eb
Change-Id: I679bbfd4b178094585587b5f47d56da37c663b5c
Signed-off-by: Evgeni Golov <evgeni@golov.de>
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
Starting from Nov 2023, Readthedocs build requires RTD configuration
file. RTD builds without it are failing.
Adding this configuration file fixes RTD build.
Change-Id: I3961508d2325077b2ac0fb0f18bc2e2a4dc8846e
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
Test for timeout plugin version before 1.14.
Test for obtaining timeout plugin version by plugin name "Build Timeout".
Test for nodejs-installator plugin, with nodejs version specified.
Change-Id: I87e304b5b45c957a36ae2a109a176bf70ae94136
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
Order of items in job dict depends on implementation specifics.
But test should not fail if implementation change.
Sort it so it won't depend on implementation.
Change-Id: I6decdf1225adcb14f888b787cfc10be66ae52a31
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