Rewrite YAML parser, YAML objects and parameters expansion logic to
enable better control over expansion logic.
Broken backward compatilibity:
* More agressive parameter expansion. This may lead to parameters
expanded in places where they were not expanded before.
* Top-level elements, which is not known to parser (such as 'job',
'view', 'project' etc), are now lead to parse failures.
Prepend them with underscore to be ignored by parser.
* Files included using '!include-raw:' elements and having formatting in
it's path ('lazy-loaded' in previous implementation) are now expanded
too.
Use '!include-raw-escape:' for them instead.
See changes in these tests for examples:
tests/yamlparser/job_fixtures/lazy-load-jobs-multi001.yaml
tests/yamlparser/job_fixtures/lazy-load-jobs-multi002.yaml
tests/yamlparser/job_fixtures/lazy-load-jobs001.yaml
* Parameters with template value using itself were substituted as is.
For example: "timer: '{timer}'" was expanded to "{timer}". Now it
leads to recursive parameter error.
See changes in this test for example:
tests/yamlparser/job_fixtures/parameter_name_reuse_default.*
->
tests/yamlparser/error_fixtures/parameter_name_reuse_default.*
* When job group includes a job which was never declared, it was just
ignored. Now it fails: job is missing.
See changes in this test for example:
tests/yamlparser/job_fixtures/job_group_includes_missing_job.*
->
tests/yamlparser/error_fixtures/job_group_includes_missing_job.*
Change-Id: Ief4e515f065a1b9e0f74fe06d7e94fa77d69f273
Rename fixtures directory to job_fixtures to prepare for adding view_fixtures
directory in the following commits.
Change-Id: Ic20997cae020b542ddc22bf444fa6b92fbcae064
Jinja2 formatter wasn't applied in case of macro parameter
without arguments, due to `ModuleRegistry.dispatch`
couldn't find the parameter definition in the registry.
On other hand, project properties weren't applied for
uno-choice parameter macro with arguments, so it makes
impossible to use these parameters with macros.
Change-Id: Idaff9307dff30567a80b917f6e5ac0717100c349
Jenkins Wiki has been fully taken off line, so update the remaining
links to reference either the relevant plugin page or the github repo.
Add extlink target for repo in jenkinsci github org.
The sonatype-clm plugin seems to be more-or-less completely deprecated,
so update the description to indicate this and link to the
nexus-artifact-uploader plugin.
Update the jjb sphinx plugin so that it generates references for the
yamlfunctions.
Change-Id: If2241e751d01a60a8cb4cbaea5b3176aeb92eab4
Signed-off-by: Pat Long <pllong@arista.com>
If the parameter is used in a macro, special fields from the
job layer (`_project-name`, `_project-full-name`) were not initialized.
Change-Id: Ie70f592c8ee71c3b8e1cfc3c2ba578e814af0a29
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
Following parameters have been implemented in JJB:
- Active Choices Parameter
- Active Choices Reactive Reference Parameter
Test cases also have been written.
Change-Id: I6e953aa26114fde9ff293ed17cc17d5972df9af3
Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
The Jenkins Wiki page is deprecated and Jenkins community is expected
to migrate their documentation to plugins.jenkins.io URL. This patch
updates all parameters that have a relevant plugins.jenkins.io URL
documentation link.
Change-Id: I3f944d268031c0217544ee94bb5361276ca9158d
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
This toxenv will allow us to flag URLs that no longer work. We
also switch from using old style setup.py build_sphinx to the
newer sphinx-build command.
Change-Id: I62f42918814fb6eea4876e0d22c6bccddf86a826
Signed-off-by: Thanh Ha <zxiiro@gmail.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>
The problem with `if default:` is that it evaluates int 0 to be
equivalent to False. If a user is passing in a int 0 then they
should be expected to receive int 0 in the case of defaults.
Change-Id: Ida1f4c68b6f9d1af5b98d633b552f038c57654cc
Signed-off-by: Thanh Ha <zxiiro@linux.com>
This resolves the error "TypeError: cannot serialize 1 (type int)" when
using a parameter inside of a macro and then passing an integer value
to the macro. For example:
- parameter:
name: int-param
parameters:
- string:
name: VAR_INT
default: '{var}'
- job-template:
name: int-param
parameters:
- int-param:
var: 1
Change-Id: Ie3a5d2e03b7aa0b7cafdb467cd0118e4ff6e73bc
Signed-off-by: Thanh Ha <zxiiro@linux.com>
As has been found earlier in Idf3460f165209611113193c7e85a884c42511371
having allNodesMatchingLabel on is a very bad idea
because it kills scaling in your CI
by scheduling every job on every node in parallel
Change-Id: Iae07b578ccfb6f728a1615628479318c46e0530a
Current default value setting makes the jobs with label parameter
execute in parallel on all nodes matching a label. In some cases that is
not expected and is undesirable. It is also no the default value
upstream
Change-Id: Idf3460f165209611113193c7e85a884c42511371
Converted all relevant functions to use helpers.<insert function>
instead of a specific import.
Added commas to last entries of mapping tuples.
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
Change-Id: Ie7c40809ad8259fc3906871360c16dbb6e58a4b0
Adds support for all fields for nodelabelparameter. Uploaded new tests, including one that covers existing behavior to prevent regression.
Story: #2001287
Task: #5835
Change-Id: I9dc4574427626fd56ba41149f0f6ab131a22e966
- upgrades hacking to current version
- sorts new linting issues
- sorts bug with sys.reload on py3
Change-Id: I4a18abc93116667a2733e8aec619ac59ea73d630
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
The extended parameters plugin allows to specify where the groovy script
file is to generate parameter
Change-Id: I0c6ac0b49c24b8d3afbc06b003847de2e043c2b8
Adds support for extended choice parameters with regards to default groovy scripts.
Change-Id: I9d2a61013f041e7b81a80b5618781dbefeace329
Story: #2001931
Task: #14461
Due to an extra colon and indentation, the example for the credentials
plugin parameter was not being included correctly.
Change-Id: I7363f8dea713410dc4fa263a557ba7cb6d1c4e58
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
It is impossible now to chose one of the following values of sortMode:
[ASCENDING_SMART, DESCENDING_SMART] because default value in JJB was hardcoded w/o '_',
but jenkins expect value w/ '_'. So if we pass e.g. ACENDING SMART (w/o '_') we get
improperly configured job and sortMode in this way replaced with NONE.
If we pass w/ '_' we got an error on testing JJB definitions.
Please merge ASAP.
Change-Id: I9bc4ff471ddb7d648005832e055ba14d59822489
Additionally update the plugin to use convert_mapping_to_xml and add
min/max tests.
Change-Id: I8f0a9054c12ea984a286aea1012513baac07479f
Co-Authored-By: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>