summaryrefslogtreecommitdiffstats
path: root/tests/yamlparser/fixtures
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Fix Authorization Matrix property - inheritance strategy"master-patchesZuul2020-07-173-0/+29
|\
| * Fix Authorization Matrix property - inheritance strategyAdam Romanek2020-07-153-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now <inheritanceStrategy> tag was only added to jobs-in-a-folder and folder configs. In JJB the tag's class is always set to "InheritParentStrategy" which according to the docs means the "item will inherit its parent items permissions". Apparently <inheritanceStrategy> tag needs to be present on top-level jobs also. For top-level jobs setting the tag's class value to "InheritParentStrategy" means the job "will inherit the global security security settings" and this is the default behavior. The code has simplified a bit - if it's a folder then we use a different property name for authorization matrix property, other than that the code is the same for all three "variants": folder, job-in-a-folder and job-outside-a-folder (top-level job). Also this change fixes the missing <inheritanceStrategy> tag for job-in-a-folder, where the folder name was specified as part of the "name" key instead of the standalone "folder" key. With this change we no longer check if a job is in a folder or not, so it's implicitly fixed. Added a test case to catch potential regressions in the future. The copyright notice reflects this and the previous contribution in this module. Change-Id: I84b22c09c8a107aab2b4eca20feffc9b61675a92
* | Merge "Updated GHPRB plugin support"Zuul2020-07-152-4/+16
|\ \
| * | Updated GHPRB plugin supportEren ATAS2020-07-072-4/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented the following tags that have been missing: - displayBuildErrorsOnDownstreamBuilds - blackListCommitAuthor - GhprbCommentFile - GhprbNoCommitStatus Following tags are printed when the value of the key is empty: - whiteListTargetBranches - blackListTargetBranches - buildDescTemplate - triggeredStatus - startedStatus - statusUrl - addTestResults Also updated tests Change-Id: I1e19841d88728af9ac6aa9e1c78f89fe962a583f Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
* / Removed the unnecessary empty combinationFilter TagEren ATAS2020-07-074-7/+0
|/ | | | | | | | | In the current implementation, jjb creates an empty combinationFilter tag whenever there is `executionStrategy`. This empty tag should not appear. Change-Id: I2bf25ae58d12904ce0a00e0a5cfefbf27d9451ad Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
* Gerrit Trigger: update support to the latest plugin versionAdam Romanek2020-06-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes include: - deprecated the following options and made support for them dependent on the Gerrit Trigger plugin version: - 'no-name-and-email' - 'readable-message' - 'trigger-for-unreviewed-patches' - added a set of new options: - 'name-and-email-parameter-mode' (replaced 'no-name-and-email') - 'commit-message-parameter-mode' (replaced 'readable-message') - 'change-subject-parameter-mode' - 'comment-text-parameter-mode' all these options can have one of the following values: - NONE - PLAIN - BASE64 the default value for the first two options is taken from the respective options they replaced, if they exist in the input YAML file, so the overall change should be backward compatible - fixed the value generated for <dynamicTriggerConfiguration> element it should be "true"/"false" instead of "True"/"False" - added an empty <dynamicGerritProjects> element when dynamic trigger functionality is disabled to match what the plugin does With the above changes the markup generated by JJB is fully aligned with Gerrit Trigger plugin v2.30.x. Tested on Gerrit Trigger plugin v2.30.0. Task: 39871 Story: 2007722 Change-Id: I25800874f51a93a351926a9a1be255cce80b88bd
* Merge "Pipelines: stop producing unsupported and deprecated XML tags"Zuul2020-05-2511-78/+73
|\
| * Pipelines: stop producing unsupported and deprecated XML tagsAdam Romanek2020-05-2511-78/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes include: - <concurrentBuild> should now be represented as <org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/> property - <triggers> should now be localed inside <org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty> property, in <properties> section - unsupported XML elements got removed: - <blockBuildWhenDownstreamBuilding> - <blockBuildWhenUpstreamBuilding> - <assignedNode> - <canRoam> - <customWorkspace> - got rid of publishers from project_pipeline_template005.{xml,yaml} as these are not supported in Pipeline jobs The above changes align the produced XMLs with the ones from Jenkins 2.190.1 and Pipeline plugin v2.6. Task: 39836 Story: 2007708 Change-Id: I650ef2ee60e872cce8f93de5f391933d68ec81f0
* | Added trim option for String parameter.Igor Lakhtenkov2020-05-221-0/+2
|/ | | | | Task: #22637 Change-Id: Ic2722aac586d3911e3ff5ab4c2d3c5a7a03fa14e
* Fix Authorization Matrix property support on jobs in a folderAdam Romanek2020-05-132-0/+28
| | | | | | | | | | | | | | | | | Without the fix: > 2020-05-11 10:56:12.238+0000 [id=29522] WARNING > o.e.j.s.h.ContextHandler$Context#log: Error while serving http://localhost/job/someFolder/createItem > java.lang.ClassCastException: com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty cannot be cast to hudson.model.JobProperty It turns out com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty should only be applied to Folders, not Jobs. The latter should use hudson.security.AuthorizationMatrixProperty. Task: 39760 Story: 2007666 Change-Id: I64907265b214fb1e489e1e657a30c90d6ee08c3f
* Fix authorization property issueArtem Nikitin2020-01-172-0/+35
| | | | | | | | | | | The change fixes a XML generating error (KeyError: '_use_folder_perms') for project, which isn't contained in a folder and has got authorization properties. Task: 38110 Story: 2007087 Change-Id: I2e0ec6e524d07a935333b35e10eb4204af9256f7
* Fix double inderection of name templatesJames Harris2019-11-052-0/+59
| | | | | | | | | | Ensure that we can resolve any lazily loaded templates that might be dictionary keys in yaml. For more informmation please see the added test case in tests/yamlparser/fixtures/jinja-string04.yaml. Change-Id: I67fbca422f2165729af15e4d039278ad66f6240b Story: 2006431 Task: 36338
* Allow use of jinja templates in defaultsJames Harris2019-11-052-0/+38
| | | | | | | | | | | | Jinja templates are not deep-copyable so they cannot be used in "defautls" sections or to pick defualts for job groups or projects. This works around the issue by waiting until we render the template to construct the template itself. Story: 2006431 Task: 36337 Change-Id: Ief31fdaac06bb14d0aaba71c8c0e658a7f861671
* Fix Authorization properties for folder and job in FolderJo Rhett2019-10-022-0/+34
| | | | | | | | | This outputs the correct XML schema for authorization properties for both a folder, and a job inside a folder. Story: 2006493 Story: 2006611 Change-Id: I14662855613ce146f74b85f5978a0ed828f4439b
* Revert "Add support for rendering jinja template as yaml"Daniel Watkins2019-07-293-41/+0
| | | | | | This reverts commit a9e12ed4a9f5866da0af5fdc68f60b09ca8efa4b. Change-Id: I2bbb2cc167a4c2cd95ac6b376ebe83bcf7a263ad
* Add support for rendering jinja template as yamlPhilip Roche2019-07-123-0/+41
| | | | | | | | | | | | | | | | | | | | | | This also adds support for using custom loaders in job definitions not just job-templates and builders. I have also added unit tests for include-jinja2-as-yaml custom loader. Example usage: - axis: type: user-defined name: VERSIONS values: !include-jinja2-as-yaml: versions.j2.yaml.inc Where versions.j2.yaml.inc is {% for possible_versions in configuration["possible_versions"] %} - {{ possible_versions["versions"] }} {% endfor -%} Change-Id: I15a431d5a86b29d704efda8576965ade2b7dcd2f
* Fix default '0' being ignoredThanh Ha2018-12-052-0/+61
| | | | | | | | | 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>
* Handle cancel-builds-on-update values from varsDaniel Belenky2018-11-144-0/+97
| | | | | | | | | | | The code assumes that the value of cancel-builds-on-update is a boolean. This fails when specifying the value of the param in a variable because when deep_formatter formats the data, booleans turn into strings. Also added tests for such case. Change-Id: Ib1ec3d5545091be550bfe023e49c7982372d5b55 Signed-off-by: Daniel Belenky <daniel.belenky@gmail.com>
* adopt pre-commit hooksSorin Sbarnea2018-07-121-1/+0
| | | | | Change-Id: I98bc0b5717c3921b35e74f53c55f896427880a84 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
* Normalize newlines at end of fileSorin Sbarnea2018-06-2920-27/+8
| | | | | | | | Preparatory move for adopting pre-commit hooks. Shoudl only remove newlines and spaces at end of files. Change-Id: Ia33679467c533722b9308f7e7b74be395c926428 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
* Symlink folders001.xml to deduplicate the test xmlSorin Sbarnea2018-06-291-15/+1
| | | | | | | Change-Id: Id03b1a147303cc377a48be25ba93f97cab856a8c Co-Authored-By: Thanh Ha <thanh.ha@linuxfoundation.org> Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com> Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
* Merge "add pipeline template using nested stage command"Zuul2018-06-212-0/+39
|\
| * add pipeline template using nested stage commandAnushka Bhandari2018-05-232-0/+39
| | | | | | | | | | | | Change-Id: I52bbf54c5c1c2603473b36f362b42e9291976543 Story: #2001759 Task: #12157
* | Add trigger-from-child-projects option.Tomas Hartmann2018-06-085-0/+131
| | | | | | | | | | | | | | | | Update trigger-parameterized-job arguments, to include trigger from child projects. Closes-Bug: story/2002157 Change-Id: Iae0610ee942dd2cad95e3fcaa8b70b16f42b3c50
* | Fix default value regex patternMartin Kopec2018-05-222-0/+55
|/ | | | | | | | | | | | | Negative values can't be set as default values currently, for example: num-to-keep: '{num_to_keep|-1}' It will return an exception saying: 'parameter missing to format'. This should also allow other patterns as long they do not contain the closing curly bracket. Change-Id: I26dafb80b120f2c071dda6d9a27319d533b0f874
* Document use of | character for variable defaultsThanh Ha2018-04-132-0/+55
| | | | | Change-Id: Id20fc7a49fef6684170a73834f2df06db3f0ca7f Signed-off-by: Thanh Ha <zxiiro@linux.com>
* Add helper tag to join arbitrary lists into stringsDarragh Bailey2018-04-122-0/+135
| | | | | | | | | | | | | Adds a yaml application tag '!join:' to support defining data as a list while having the resulting contents automatically joined together with the specified delimiter and passed as a string into the resulting object returned by yaml for JJB to process. This allows users to store long lists of data that is combined together for use with Jenkins plugins that expect a delimited string of arguments instead of needing each module in JJB to provide individual support. Change-Id: I745181ade3926d5c29708963189ae499a0378ece
* Added code for lightweight-checkoutAndrew Mellen2018-03-222-0/+2
| | | | | | Implements: lightweight-checkout for pipeline projects Closes-Story: #2001717 Change-Id: I9bd63fba9a8f199e6b8c467c072d9804a44ec45d
* Fix duplicated actions field in XML for foldersMarco Nenciarini2018-02-272-2/+0
| | | | Change-Id: I9638dda0c31dfd70ffe8fcfc9eecc260bb326f61
* Merge "Always deep format Jinja2 templates"Zuul2018-02-245-0/+53
|\
| * Always deep format Jinja2 templatesDaniel Watkins2018-02-235-0/+53
| | | | | | | | | | | | | | | | | | | | As Jinja2 provides functionality other than interpolation, it's entirely feasible to use it outside of a context where there are template variables. This change ensures that we always deep format Jinja2 templates, even when we wouldn't normally interpolate a regular JJB template. Change-Id: Ia3f86dd2073d48594eaf791fa2277db7e5ebf0ab
* | Add support for {% include %} in Jinja2 templatesDaniel Watkins2018-02-235-0/+76
|/ | | | | | | | | | This allows the use of the {% include %} tag[0] within Jinja2 templates, with the same search path used for looking up other templates (i.e. the one which LocalLoader is instantiated with). [0] http://jinja.pocoo.org/docs/2.9/templates/#include Change-Id: I0403c385ee317e1460a80a9bf717aa4712f37e2f
* Add !j2 directive to allow inline Jinja2 templatesDaniel Watkins2018-02-212-0/+42
| | | | | | | This enables the use of Jinja2 templating within strings in the template YAML files. Change-Id: I2e912d2f874c5f2428e1aed4af94897aee8d4a72
* Merge "Fix the formatter regex"Zuul2018-02-092-0/+40
|\
| * Fix the formatter regexJan Hruban2018-01-162-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge "Fix timeout wrapper version detection"Zuul2018-02-087-42/+54
|\ \
| * | Fix timeout wrapper version detectionThomas Bechtold2018-01-097-42/+54
| |/ | | | | | | | | | | | | | | | | | | | | 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>
* | Merge "hipchat_notif: Fix compatibility dispatch"Zuul2018-02-083-0/+47
|\ \
| * | hipchat_notif: Fix compatibility dispatchTomas Janousek2018-02-013-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | gerrit-trigger: avoid exception spamming logsSorin Sbarnea2018-02-061-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Allow template-name in the global defaults"Zuul2018-01-272-2/+9
|\ \ | |/ |/|
| * Allow template-name in the global defaultsJan Hruban2018-01-162-2/+9
| | | | | | | | | | | | | | | | 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
* | Merge "Add cloudbees folder creation support"Zuul2017-10-234-0/+51
|\ \
| * | Add cloudbees folder creation supportJerome Hourquebie2017-10-234-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | Add project folder module. Jenkins folder could be made with project-type: folder This requires Cloudbees folder plugin and python-jenkins folder update (see: https://review.openstack.org/#/c/180185/) Change-Id: I7e1c28c26a69ae6ca736cec88fcb957a716d8fad
* | | Basic folder supportDarragh Bailey2017-10-237-0/+104
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows specifying a folder attribute for each job generated, which in turn is used when creating or uploading to place the job under the requested folder. The job name is expanded after defaults are applied, to support the attribute being defined within a set of defaults applied to a number of jobs. This in turn allows for multiple jobs with the same basename to exist, provided they are targeted at different folders. Does not support creating the folders if they do not exist. Change-Id: I8c2157c4c81087cc972a048d1b88d5f08ac65361
* | Switch param order from yaml conf to plugin specificDarragh Bailey2017-09-222-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Add !include-jinja2 for rendering templates with Jinja2Daniel Watkins2017-08-098-0/+112
|/ | | | | | | | | | | | | | | | | | | | | | | | | | This template included using !include-jinja2: """ {{ my_var }} """ is rendered the same as an existing template that looks like this: """ {my_var} """ This also allows the use of Jinja2's richer syntax: """ {% for test_environment in configuration.get("envs", ["py35"]) %} tox -e {{ test_environment }} {% endfor %} """ Story: 2001135 Change-Id: Ia3ee21822d6e9237f5ea46796bc8810ecac61e2c
* project matrix: rename variable/refactorAntoine Musso2017-06-222-0/+33
| | | | | | | | | | | | | | | | | | While reviewing the YAML axis execution strategy for the matrix project, Darragh Bailey suggested to: * use proper variable naming * JJB exceptions * Rely on hudson_model * Drop trailing slashes Slightly refactor the matrix project method. For the combination touchstones, the web interface list the result has 'Stable', 'Unstable'. Map 'Stable' to 'Success' which is actually in hudson.model.Result. Add a basic test to cover that. Change-Id: I7ab416a2dbadae6d8a41fe8902ebec04fc530abc
* Fix !include parsing with variableAleksandr Charykov2017-04-202-0/+78
| | | | | | | Do not overwrite template string when parsing yaml. Story: 2000996 Change-Id: Id1b12be69c3994fa4108a9841c0128da9dc883ef
* Merge "Wrapper pre-scm-buildstep: added support for failOnError parameter"Jenkins2017-03-295-41/+43
|\