diff options
38 files changed, 507 insertions, 98 deletions
diff --git a/jenkins_jobs/local_yaml.py b/jenkins_jobs/local_yaml.py index c22fc3c6..9aeeb9af 100644 --- a/jenkins_jobs/local_yaml.py +++ b/jenkins_jobs/local_yaml.py @@ -203,6 +203,7 @@ import io import logging import os import re +import copy import jinja2 import yaml @@ -598,6 +599,11 @@ class LazyLoader(CustomLoader): def __repr__(self): return "%s %s" % (self._cls.yaml_tag, self._node.value) + def __deepcopy__(self, memodict={}): + return LazyLoader( + (copy.deepcopy(self._cls), self._loader, copy.deepcopy(self._node)) + ) + def format(self, *args, **kwargs): node = yaml.ScalarNode( tag=self._node.tag, value=self._node.value.format(*args, **kwargs) diff --git a/jenkins_jobs/modules/helpers.py b/jenkins_jobs/modules/helpers.py index 10945c71..258b13cb 100644 --- a/jenkins_jobs/modules/helpers.py +++ b/jenkins_jobs/modules/helpers.py @@ -19,6 +19,7 @@ import xml.etree.ElementTree as XML from jenkins_jobs.errors import InvalidAttributeError from jenkins_jobs.errors import JenkinsJobsException from jenkins_jobs.errors import MissingAttributeError +from jenkins_jobs.modules import hudson_model def build_trends_publisher(plugin_name, xml_element, data): @@ -613,6 +614,26 @@ def trigger_project(tconfigs, project_def, param_order=None): ) +def trigger_threshold( + parent_element, element_name, threshold_name, supported_thresholds=None +): + """Generate a resultThreshold XML element for build/join triggers""" + element = XML.SubElement(parent_element, element_name) + + try: + threshold = hudson_model.THRESHOLDS[threshold_name.upper()] + except KeyError: + if not supported_thresholds: + supported_thresholds = hudson_model.THRESHOLDS.keys() + raise JenkinsJobsException( + "threshold must be one of %s" % ", ".join(supported_thresholds) + ) + XML.SubElement(element, "name").text = threshold["name"] + XML.SubElement(element, "ordinal").text = threshold["ordinal"] + XML.SubElement(element, "color").text = threshold["color"] + return element + + def convert_mapping_to_xml(parent, data, mapping, fail_required=True): """Convert mapping to XML diff --git a/jenkins_jobs/modules/project_matrix.py b/jenkins_jobs/modules/project_matrix.py index ebd566f5..01bc431d 100644 --- a/jenkins_jobs/modules/project_matrix.py +++ b/jenkins_jobs/modules/project_matrix.py @@ -162,9 +162,10 @@ class Matrix(jenkins_jobs.modules.base.Base): strategy = data.get(strategy_name, {}) if strategy_name == "execution-strategy": - XML.SubElement(root, "combinationFilter").text = str( - strategy.get("combination-filter", "") - ).rstrip() + if "combination-filter" in strategy: + XML.SubElement(root, "combinationFilter").text = str( + strategy.get("combination-filter", "") + ).rstrip() XML.SubElement(ex_r, "runSequentially").text = str( strategy.get("sequential", False) ).lower() diff --git a/jenkins_jobs/modules/project_multibranch.py b/jenkins_jobs/modules/project_multibranch.py index 93b5f380..49b5f8e3 100644 --- a/jenkins_jobs/modules/project_multibranch.py +++ b/jenkins_jobs/modules/project_multibranch.py @@ -60,10 +60,18 @@ Plugins required: (default '-1, forever') * **script-path** (`str`): Path to Jenkinsfile, relative to workspace. (default 'Jenkinsfile') + * **script-id** (`str`): Script id from the global Jenkins script store + provided by the config-file provider plugin. Mutually exclusive with + **script-path** option. + * **sandbox** (`bool`): This option is strongly recommended if the + Jenkinsfile is using load to evaluate a groovy source file from an + SCM repository. Usable only with **script-id** option. (default 'false') Job examples: -.. literalinclude:: /../../tests/multibranch/fixtures/multibranch_defaults.yaml +.. literalinclude:: /../../tests/multibranch/fixtures/multibranch_defaults_id_mode.yaml + +.. literalinclude:: /../../tests/multibranch/fixtures/multibranch_defaults_path_mode.yaml .. literalinclude:: /../../tests/multibranch/fixtures/multi_scm_full.yaml @@ -85,8 +93,39 @@ logger = logging.getLogger(str(__name__)) class WorkflowMultiBranch(jenkins_jobs.modules.base.Base): sequence = 0 multibranch_path = "org.jenkinsci.plugins.workflow.multibranch" + multibranch_defaults_path = "org.jenkinsci.pipeline.workflow.multibranch" jenkins_class = "".join([multibranch_path, ".WorkflowMultiBranchProject"]) - jenkins_factory_class = "".join([multibranch_path, ".WorkflowBranchProjectFactory"]) + jenkins_factory = { + "script_path": { + "class": "".join([multibranch_path, ".WorkflowBranchProjectFactory"]) + }, + "script_id": { + "class": "".join( + [ + multibranch_defaults_path, + ".defaults.PipelineBranchDefaultsProjectFactory", + ] + ), + "plugin": "pipeline-multibranch-defaults", + }, + } + + @staticmethod + def _factory_opts_check(data): + + sandbox = data.get("sandbox", None) + script_id = data.get("script-id", None) + script_path = data.get("script-path", None) + + if script_id and script_path: + error_msg = "script-id and script-path are mutually exclusive options" + raise JenkinsJobsException(error_msg) + elif not script_id and sandbox: + error_msg = ( + "Sandbox mode is applicable only for multibranch with defaults" + "project type used with script-id option" + ) + raise JenkinsJobsException(error_msg) def root_xml(self, data): xml_parent = XML.Element(self.jenkins_class) @@ -268,28 +307,50 @@ class WorkflowMultiBranch(jenkins_jobs.modules.base.Base): # Factory # ########### - factory = XML.SubElement( - xml_parent, "factory", {"class": self.jenkins_factory_class} - ) + self._factory_opts_check(data) + + if data.get("script-id"): + mode = "script_id" + fopts_map = ( + ("script-id", "scriptId", None), + ("sandbox", "useSandbox", None), + ) + else: + mode = "script_path" + fopts_map = (("script-path", "scriptPath", "Jenkinsfile"),) + + factory = XML.SubElement(xml_parent, "factory", self.jenkins_factory[mode]) XML.SubElement( factory, "owner", {"class": self.jenkins_class, "reference": "../.."} ) - XML.SubElement(factory, "scriptPath").text = data.get( - "script-path", "Jenkinsfile" - ) + + # multibranch default + + helpers.convert_mapping_to_xml(factory, data, fopts_map, fail_required=False) return xml_parent class WorkflowMultiBranchDefaults(WorkflowMultiBranch): - jenkins_class = ( - "org.jenkinsci.plugins.pipeline.multibranch" - ".defaults.PipelineMultiBranchDefaultsProject" - ) - jenkins_factory_class = ( - "org.jenkinsci.plugins.pipeline.multibranch" - ".defaults.PipelineBranchDefaultsProjectFactory" + multibranch_path = "org.jenkinsci.plugins.workflow.multibranch" + multibranch_defaults_path = "org.jenkinsci.plugins.pipeline.multibranch" + jenkins_class = "".join( + [multibranch_defaults_path, ".defaults.PipelineMultiBranchDefaultsProject"] ) + jenkins_factory = { + "script_path": { + "class": "".join([multibranch_path, ".WorkflowBranchProjectFactory"]), + "plugin": "workflow-multibranch", + }, + "script_id": { + "class": "".join( + [ + multibranch_defaults_path, + ".defaults.PipelineBranchDefaultsProjectFactory", + ] + ) + }, + } def bitbucket_scm(xml_parent, data): @@ -804,7 +865,7 @@ def github_scm(xml_parent, data): (default 'contributors') :arg str discover-pr-origin: Discovers pull requests where the origin repository is the same as the target repository. - Valid options: merge-current, current, both. (default 'merge-current') + Valid options: merge-current, current, both, false. (default 'merge-current') :arg bool discover-tags: Discovers tags on the repository. (default false) :arg list build-strategies: Provides control over whether to build a branch @@ -946,18 +1007,19 @@ def github_scm(xml_parent, data): XML.SubElement(dprf, "trust").attrib["class"] = trust_map[trust] dpro_strategy = data.get("discover-pr-origin", "merge-current") - dpro = XML.SubElement( - traits, "".join([github_path_dscore, ".OriginPullRequestDiscoveryTrait"]) - ) - dpro_strategy_map = {"merge-current": "1", "current": "2", "both": "3"} - if dpro_strategy not in dpro_strategy_map: - raise InvalidAttributeError( - "discover-pr-origin", dpro_strategy, dpro_strategy_map.keys() + if dpro_strategy: + dpro = XML.SubElement( + traits, "".join([github_path_dscore, ".OriginPullRequestDiscoveryTrait"]) ) - dpro_mapping = [ - ("discover-pr-origin", "strategyId", "merge-current", dpro_strategy_map) - ] - helpers.convert_mapping_to_xml(dpro, data, dpro_mapping, fail_required=True) + dpro_strategy_map = {"merge-current": "1", "current": "2", "both": "3"} + if dpro_strategy not in dpro_strategy_map: + raise InvalidAttributeError( + "discover-pr-origin", dpro_strategy, dpro_strategy_map.keys() + ) + dpro_mapping = [ + ("discover-pr-origin", "strategyId", "merge-current", dpro_strategy_map) + ] + helpers.convert_mapping_to_xml(dpro, data, dpro_mapping, fail_required=True) if data.get("head-filter-regex", None): rshf = XML.SubElement(traits, "jenkins.scm.impl.trait.RegexSCMHeadFilterTrait") @@ -1193,7 +1255,27 @@ def property_strategies(xml_parent, data): max-survivability (optional) Requires the :jenkins-plugins:`Pipeline Multibranch Plugin <workflow-multibranch>` - + * **trigger-build-on-pr-comment** (str): The comment body to + trigger a new build for a PR job when it is received. This + is compiled as a case insensitive regular expression, so + use ``".*"`` to trigger a build on any comment whatsoever. + (optional) + Requires the :jenkins-plugins:`GitHub PR Comment Build Plugin + <github-pr-comment-build>` + * **trigger-build-on-pr-review** (bool): This property will + cause a job for a pull request ``(PR-*)`` to be triggered + immediately when a review is made on the PR in GitHub. + This has no effect on jobs that are not for pull requests. + (optional) + Requires the :jenkins-plugins:`GitHub PR Comment Build Plugin + <github-pr-comment-build>` + * **trigger-build-on-pr-update** (bool): This property will + cause a job for a pull request ``(PR-*)`` to be triggered + immediately when the PR title or description is edited in + GitHub. This has no effect on jobs that are not for pull + requests. (optional) + Requires the :jenkins-plugins:`GitHub PR Comment Build Plugin + <github-pr-comment-build>` * **named-branches** (dict): Named branches get different properties. Comprised of a list of defaults and a list of property strategy exceptions for use with specific branches. @@ -1210,6 +1292,27 @@ def property_strategies(xml_parent, data): max-survivability (optional) Requires the :jenkins-plugins:`Pipeline Multibranch Plugin <workflow-multibranch>` + * **trigger-build-on-pr-comment** (str): The comment body to + trigger a new build for a PR job when it is received. This + is compiled as a case insensitive regular expression, so + use ``".*"`` to trigger a build on any comment whatsoever. + (optional) + Requires the :jenkins-plugins:`GitHub PR Comment Build Plugin + <github-pr-comment-build>` + * **trigger-build-on-pr-review** (bool): This property will + cause a job for a pull request ``(PR-*)`` to be triggered + immediately when a review is made on the PR in GitHub. + This has no effect on jobs that are not for pull requests. + (optional) + Requires the :jenkins-plugins:`GitHub PR Comment Build Plugin + <github-pr-comment-build>` + * **trigger-build-on-pr-update** (bool): This property will + cause a job for a pull request ``(PR-*)`` to be triggered + immediately when the PR title or description is edited in + GitHub. This has no effect on jobs that are not for pull + requests. (optional) + Requires the :jenkins-plugins:`GitHub PR Comment Build Plugin + <github-pr-comment-build>` * **exceptions** (list): A list of branch names and the property strategies to be used on that branch, instead of any listed @@ -1375,6 +1478,7 @@ def apply_property_strategies(props_elem, props_list): basic_property_strategies = "jenkins.branch" workflow_multibranch = "org.jenkinsci.plugins.workflow.multibranch" + pr_comment_build = "com.adobe.jenkins.github__pr__comment__build" # Valid options for the pipeline branch durability override. pbdo_map = collections.OrderedDict( [ @@ -1384,6 +1488,13 @@ def apply_property_strategies(props_elem, props_list): ] ) + pcb_bool_opts = collections.OrderedDict( + [ + ("trigger-build-on-pr-review", ".TriggerPRReviewBranchProperty"), + ("trigger-build-on-pr-update", ".TriggerPRUpdateBranchProperty"), + ] + ) + for dbs_list in props_list: if dbs_list.get("suppress-scm-triggering", False): @@ -1404,3 +1515,19 @@ def apply_property_strategies(props_elem, props_list): {"plugin": "workflow-multibranch"}, ) XML.SubElement(pbdo_elem, "hint").text = pbdo_map.get(pbdo_val) + + tbopc_val = dbs_list.get("trigger-build-on-pr-comment", None) + if tbopc_val: + tbopc_elem = XML.SubElement( + props_elem, + "".join([pr_comment_build, ".TriggerPRCommentBranchProperty"]), + {"plugin": "github-pr-comment-build"}, + ) + XML.SubElement(tbopc_elem, "commentBody").text = tbopc_val + for opt in pcb_bool_opts: + if dbs_list.get(opt, False): + XML.SubElement( + props_elem, + "".join([pr_comment_build, pcb_bool_opts.get(opt)]), + {"plugin": "github-pr-comment-build"}, + ) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 68b93e73..48bb420c 100755 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -608,20 +608,12 @@ def trigger(registry, xml_parent, data): tconfig = XML.SubElement(xml_parent, "hudson.tasks.BuildTrigger") childProjects = XML.SubElement(tconfig, "childProjects") childProjects.text = data["project"] - tthreshold = XML.SubElement(tconfig, "threshold") threshold = data.get("threshold", "SUCCESS") supported_thresholds = ["SUCCESS", "UNSTABLE", "FAILURE"] - if threshold not in supported_thresholds: - raise JenkinsJobsException( - "threshold must be one of %s" % ", ".join(supported_thresholds) - ) - tname = XML.SubElement(tthreshold, "name") - tname.text = hudson_model.THRESHOLDS[threshold]["name"] - tordinal = XML.SubElement(tthreshold, "ordinal") - tordinal.text = hudson_model.THRESHOLDS[threshold]["ordinal"] - tcolor = XML.SubElement(tthreshold, "color") - tcolor.text = hudson_model.THRESHOLDS[threshold]["color"] + helpers.trigger_threshold( + tconfig, "threshold", threshold, supported_thresholds=supported_thresholds + ) def clone_workspace(registry, xml_parent, data): @@ -3501,11 +3493,13 @@ def join_trigger(registry, xml_parent, data): Trigger a job after all the immediate downstream jobs have completed. Requires the Jenkins :jenkins-plugins:`Join Plugin <join>`. - :arg bool even-if-unstable: if true jobs will trigger even if some - downstream jobs are marked as unstable (default false) :arg list projects: list of projects to trigger :arg list publishers: list of triggers from publishers module that defines projects that need to be triggered + :arg str threshold: result threshold to trigger jobs (optional). + Valid values are "success", "unstable", "failure", and "aborted". + :arg bool even-if-unstable: if true jobs will trigger even if some + downstream jobs are marked as unstable (default false) (DEPRECATED) Example: @@ -3523,8 +3517,13 @@ def join_trigger(registry, xml_parent, data): for edited_node in create_publishers(registry, pub): publishers.append(edited_node) - unstable = str(data.get("even-if-unstable", "false")).lower() - XML.SubElement(jointrigger, "evenIfDownstreamUnstable").text = unstable + unstable = str(data.get("even-if-unstable", "")).lower() + if unstable: + XML.SubElement(jointrigger, "evenIfDownstreamUnstable").text = unstable + + threshold = data.get("threshold", "") + if threshold: + helpers.trigger_threshold(jointrigger, "resultThreshold", threshold) def jabber(registry, xml_parent, data): diff --git a/jenkins_jobs/modules/triggers.py b/jenkins_jobs/modules/triggers.py index d6b2d7bb..13ce06a9 100644 --- a/jenkins_jobs/modules/triggers.py +++ b/jenkins_jobs/modules/triggers.py @@ -1175,6 +1175,8 @@ def github_pull_request(registry, xml_parent, data): in the pull request will trigger a build (default false) :arg str skip-build-phrase: when filled, adding this phrase to the pull request title or body will not trigger a build (optional) + :arg list black-list-commit-author: When filled, pull request commits from this user(s) + will not trigger a build (optional) :arg str black-list-labels: list of GitHub labels for which the build should not be triggered (optional) :arg str white-list-labels: list of GitHub labels for which the build @@ -1184,6 +1186,8 @@ def github_pull_request(registry, xml_parent, data): without asking (default false) :arg bool auto-close-on-fail: close failed pull request automatically (default false) + :arg bool display-build-errors-on-downstream-builds: Display build errors on downstream builds + (default false) :arg list white-list-target-branches: Adding branches to this whitelist allows you to selectively test pull requests destined for these branches only. Supports regular expressions (e.g. 'master', @@ -1218,6 +1222,9 @@ def github_pull_request(registry, xml_parent, data): (optional) :arg bool cancel-builds-on-update: cancel existing builds when a PR is updated (optional) + :arg str comment-file: Extends the standard build comment message on + github with a custom message file. (optional) + :arg bool no-commit-status: Enables "Do not update commit status" :arg list included-regions: Each inclusion uses regular expression pattern matching, and must be separated by a new line. An empty list implies that everything is included. (optional) @@ -1240,26 +1247,37 @@ def github_pull_request(registry, xml_parent, data): """ ghprb = XML.SubElement(xml_parent, "org.jenkinsci.plugins.ghprb." "GhprbTrigger") mapping = [ - ("cron", "spec", ""), ( "allow-whitelist-orgs-as-admins", "allowMembersOfWhitelistedOrgsAsAdmin", False, ), - ("cron", "cron", ""), ("trigger-phrase", "triggerPhrase", ""), ("skip-build-phrase", "skipBuildPhrase", ""), ("only-trigger-phrase", "onlyTriggerPhrase", False), ("github-hooks", "useGitHubHooks", False), ("permit-all", "permitAll", False), ("auto-close-on-fail", "autoCloseFailedPullRequests", False), + ( + "display-build-errors-on-downstream-builds", + "displayBuildErrorsOnDownstreamBuilds", + False, + ), ] + XML.SubElement(ghprb, "configVersion").text = "3" + cron_string = data.get("cron", "") or "" + XML.SubElement(ghprb, "spec").text = cron_string + XML.SubElement(ghprb, "cron").text = cron_string admin_string = "\n".join(data.get("admin-list", [])) XML.SubElement(ghprb, "adminlist").text = admin_string white_string = "\n".join(data.get("white-list", [])) XML.SubElement(ghprb, "whitelist").text = white_string org_string = "\n".join(data.get("org-list", [])) XML.SubElement(ghprb, "orgslist").text = org_string + black_list_commit_author_string = " ".join(data.get("black-list-commit-author", "")) + XML.SubElement( + ghprb, "blackListCommitAuthor" + ).text = black_list_commit_author_string white_list_labels_string = "\n".join(data.get("white-list-labels", [])) XML.SubElement(ghprb, "whiteListLabels").text = white_list_labels_string black_list_labels_string = "\n".join(data.get("black-list-labels", [])) @@ -1272,11 +1290,13 @@ def github_pull_request(registry, xml_parent, data): build_desc_template = data.get("build-desc-template", "") if build_desc_template: XML.SubElement(ghprb, "buildDescTemplate").text = str(build_desc_template) + else: + XML.SubElement(ghprb, "buildDescTemplate") helpers.convert_mapping_to_xml(ghprb, data, mapping, fail_required=False) white_list_target_branches = data.get("white-list-target-branches", []) + ghprb_wltb = XML.SubElement(ghprb, "whiteListTargetBranches") if white_list_target_branches: - ghprb_wltb = XML.SubElement(ghprb, "whiteListTargetBranches") for branch in white_list_target_branches: be = XML.SubElement( ghprb_wltb, "org.jenkinsci.plugins." "ghprb.GhprbBranch" @@ -1284,8 +1304,8 @@ def github_pull_request(registry, xml_parent, data): XML.SubElement(be, "branch").text = str(branch) black_list_target_branches = data.get("black-list-target-branches", []) + ghprb_bltb = XML.SubElement(ghprb, "blackListTargetBranches") if black_list_target_branches: - ghprb_bltb = XML.SubElement(ghprb, "blackListTargetBranches") for branch in black_list_target_branches: be = XML.SubElement( ghprb_bltb, "org.jenkinsci.plugins." "ghprb.GhprbBranch" @@ -1301,7 +1321,7 @@ def github_pull_request(registry, xml_parent, data): triggered_status = data.get("triggered-status", "") started_status = data.get("started-status", "") status_url = data.get("status-url", "") - status_add_test_results = data.get("status-add-test-results", "") + status_add_test_results = data.get("status-add-test-results", False) success_status = data.get("success-status", "") failure_status = data.get("failure-status", "") error_status = data.get("error-status", "") @@ -1333,9 +1353,18 @@ def github_pull_request(registry, xml_parent, data): str(data.get("cancel-builds-on-update", False)).lower() == "true" ) + comment_file = data.get("comment-file", "") + no_commit_status = data.get("no-commit-status", False) + # We want to have only one 'extensions' subelement, even if status # handling, comment handling and other extensions are enabled. - if requires_status or requires_job_comment or cancel_builds_on_update: + if ( + requires_status + or requires_job_comment + or cancel_builds_on_update + or comment_file + or no_commit_status + ): extensions = XML.SubElement(ghprb, "extensions") # Both comment and status elements have this same type. Using a const is @@ -1349,22 +1378,24 @@ def github_pull_request(registry, xml_parent, data): extensions, "org.jenkinsci.plugins" ".ghprb.extensions.status." "GhprbSimpleStatus", ) + commit_status_context_element = XML.SubElement( + simple_status, "commitStatusContext" + ) + triggered_status_element = XML.SubElement(simple_status, "triggeredStatus") + started_status_element = XML.SubElement(simple_status, "startedStatus") + status_url_element = XML.SubElement(simple_status, "statusUrl") if status_context: - XML.SubElement(simple_status, "commitStatusContext").text = str( - status_context - ) + commit_status_context_element.text = str(status_context) if triggered_status: - XML.SubElement(simple_status, "triggeredStatus").text = str( - triggered_status - ) + triggered_status_element.text = str(triggered_status) if started_status: - XML.SubElement(simple_status, "startedStatus").text = str(started_status) + started_status_element.text = str(started_status) if status_url: - XML.SubElement(simple_status, "statusUrl").text = str(status_url) - if status_add_test_results: - XML.SubElement(simple_status, "addTestResults").text = str( - status_add_test_results - ).lower() + status_url_element.text = str(status_url) + + XML.SubElement(simple_status, "addTestResults").text = str( + status_add_test_results + ).lower() if requires_status_message: completed_elem = XML.SubElement(simple_status, "completedStatus") @@ -1407,6 +1438,20 @@ def github_pull_request(registry, xml_parent, data): "org.jenkinsci.plugins.ghprb.extensions." "build.GhprbCancelBuildsOnUpdate", ) + if comment_file: + comment_file_tag = XML.SubElement( + extensions, + "org.jenkinsci.plugins.ghprb.extensions." "comments.GhprbCommentFile", + ) + comment_file_path_elem = XML.SubElement(comment_file_tag, "commentFilePath") + comment_file_path_elem.text = str(comment_file) + + if no_commit_status: + XML.SubElement( + extensions, + "org.jenkinsci.plugins.ghprb.extensions." "status.GhprbNoCommitStatus", + ) + def gitlab_merge_request(registry, xml_parent, data): """yaml: gitlab-merge-request diff --git a/tests/cmd/fixtures/multi-path/output_recursive/job4 b/tests/cmd/fixtures/multi-path/output_recursive/job4 index dd47f962..20f4d7fc 100644 --- a/tests/cmd/fixtures/multi-path/output_recursive/job4 +++ b/tests/cmd/fixtures/multi-path/output_recursive/job4 @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes/> <actions/> <description><!-- Managed by Jenkins Job Builder --></description> diff --git a/tests/general/fixtures/custom-workspace002.xml b/tests/general/fixtures/custom-workspace002.xml index a3a266b6..3535e187 100644 --- a/tests/general/fixtures/custom-workspace002.xml +++ b/tests/general/fixtures/custom-workspace002.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes/> <actions/> <keepDependencies>false</keepDependencies> diff --git a/tests/general/fixtures/matrix-axis-yaml.xml b/tests/general/fixtures/matrix-axis-yaml.xml index 33724b97..02ef44a0 100644 --- a/tests/general/fixtures/matrix-axis-yaml.xml +++ b/tests/general/fixtures/matrix-axis-yaml.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <org.jenkinsci.plugins.yamlaxis.YamlAxis> <name>python</name> diff --git a/tests/general/fixtures/matrix-axis001.xml b/tests/general/fixtures/matrix-axis001.xml index da2c6c0d..25929b6b 100644 --- a/tests/general/fixtures/matrix-axis001.xml +++ b/tests/general/fixtures/matrix-axis001.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis> <name>config</name> diff --git a/tests/general/fixtures/matrix-axis002.xml b/tests/general/fixtures/matrix-axis002.xml index fa00869b..1f6363bf 100644 --- a/tests/general/fixtures/matrix-axis002.xml +++ b/tests/general/fixtures/matrix-axis002.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis> <name>config</name> diff --git a/tests/general/fixtures/matrix-axis003.xml b/tests/general/fixtures/matrix-axis003.xml index 538337cc..1541278d 100644 --- a/tests/general/fixtures/matrix-axis003.xml +++ b/tests/general/fixtures/matrix-axis003.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <jenkins.plugins.shiningpanda.matrix.PythonAxis> <name>PYTHON</name> diff --git a/tests/general/fixtures/matrix-axis004.xml b/tests/general/fixtures/matrix-axis004.xml index 1c055910..ce276723 100644 --- a/tests/general/fixtures/matrix-axis004.xml +++ b/tests/general/fixtures/matrix-axis004.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <hudson.matrix.JDKAxis> <name>jdk</name> diff --git a/tests/general/fixtures/matrix-axis005.xml b/tests/general/fixtures/matrix-axis005.xml index 69122611..753e4d10 100644 --- a/tests/general/fixtures/matrix-axis005.xml +++ b/tests/general/fixtures/matrix-axis005.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis> <name>config</name> diff --git a/tests/general/fixtures/project-type002.xml b/tests/general/fixtures/project-type002.xml index ede8bc0a..ae27ec89 100644 --- a/tests/general/fixtures/project-type002.xml +++ b/tests/general/fixtures/project-type002.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes/> <actions/> <keepDependencies>false</keepDependencies> diff --git a/tests/multibranch/fixtures/multibranch_defaults.xml b/tests/multibranch/fixtures/multibranch_defaults_id_mode.xml index 94859b22..8136ab90 100644 --- a/tests/multibranch/fixtures/multibranch_defaults.xml +++ b/tests/multibranch/fixtures/multibranch_defaults_id_mode.xml @@ -58,6 +58,7 @@ </sources> <factory class="org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineBranchDefaultsProjectFactory"> <owner class="org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject" reference="../.."/> - <scriptPath>Jenkinsfile</scriptPath> + <scriptId>my-pipeline</scriptId> + <useSandbox>true</useSandbox> </factory> </org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject> diff --git a/tests/multibranch/fixtures/multibranch_defaults_id_mode.yaml b/tests/multibranch/fixtures/multibranch_defaults_id_mode.yaml new file mode 100644 index 00000000..b7b52f1a --- /dev/null +++ b/tests/multibranch/fixtures/multibranch_defaults_id_mode.yaml @@ -0,0 +1,9 @@ +name: 'demo-multibranch-defaults' +project-type: multibranch-defaults +script-id: my-pipeline +sandbox: true +scm: + - github: + repo: 'foo' + repo-owner: 'johndoe' + credentials-id: 'secret' diff --git a/tests/multibranch/fixtures/multibranch_defaults_path_mode.xml b/tests/multibranch/fixtures/multibranch_defaults_path_mode.xml new file mode 100644 index 00000000..c8a0070e --- /dev/null +++ b/tests/multibranch/fixtures/multibranch_defaults_path_mode.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="utf-8"?> +<org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject plugin="workflow-multibranch"> + <properties/> + <views> + <hudson.model.AllView> + <name>All</name> + <filterExecutors>false</filterExecutors> + <filterQueue>false</filterQueue> + <properties class="hudson.model.View$PropertyList"/> + <owner class="org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject" reference="../../.."/> + </hudson.model.AllView> + </views> + <viewsTabBar class="hudson.views.DefaultViewsTabBar"/> + <folderViews class="jenkins.branch.MultiBranchProjectViewHolder" plugin="branch-api"> + <owner class="org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject" reference="../.."/> + </folderViews> + <healthMetrics> + <com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric plugin="cloudbees-folder"> + <nonRecursive>false</nonRecursive> + </com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric> + </healthMetrics> + <icon class="jenkins.branch.MetadataActionFolderIcon" plugin="branch-api"> + <owner class="org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject" reference="../.."/> + </icon> + <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder"> + <pruneDeadBranches>true</pruneDeadBranches> + <daysToKeep>-1</daysToKeep> + <numToKeep>-1</numToKeep> + </orphanedItemStrategy> + <triggers/> + <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api"> + <data> + <jenkins.branch.BranchSource> + <source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source"> + <id>gh-johndoe-foo</id> + <repoOwner>johndoe</repoOwner> + <repository>foo</repository> + <credentialsId>secret</credentialsId> + <traits> + <org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait> + <strategyId>1</strategyId> + </org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait> + <org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait> + <strategyId>1</strategyId> + <trust class="org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustContributors"/> + </org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait> + <org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait> + <strategyId>1</strategyId> + </org.jenkinsci.plugins.github__branch__source.OriginPullRequestDiscoveryTrait> + <jenkins.plugins.git.traits.WipeWorkspaceTrait> + <extension class="hudson.plugins.git.extensions.impl.WipeWorkspace"/> + </jenkins.plugins.git.traits.WipeWorkspaceTrait> + </traits> + </source> + </jenkins.branch.BranchSource> + </data> + <owner class="org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject" reference="../.."/> + </sources> + <factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory" plugin="workflow-multibranch"> + <owner class="org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject" reference="../.."/> + <scriptPath>Jenkinsfile</scriptPath> + </factory> +</org.jenkinsci.plugins.pipeline.multibranch.defaults.PipelineMultiBranchDefaultsProject> diff --git a/tests/multibranch/fixtures/multibranch_defaults.yaml b/tests/multibranch/fixtures/multibranch_defaults_path_mode.yaml index 51e41beb..51e41beb 100644 --- a/tests/multibranch/fixtures/multibranch_defaults.yaml +++ b/tests/multibranch/fixtures/multibranch_defaults_path_mode.yaml diff --git a/tests/multibranch/fixtures/scm_github_full.xml b/tests/multibranch/fixtures/scm_github_full.xml index 2d914b2b..6a52b72a 100644 --- a/tests/multibranch/fixtures/scm_github_full.xml +++ b/tests/multibranch/fixtures/scm_github_full.xml @@ -107,6 +107,11 @@ <org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty plugin="workflow-multibranch"> <hint>MAX_SURVIVABILITY</hint> </org.jenkinsci.plugins.workflow.multibranch.DurabilityHintBranchProperty> + <com.adobe.jenkins.github__pr__comment__build.TriggerPRCommentBranchProperty plugin="github-pr-comment-build"> + <commentBody>Ci build!</commentBody> + </com.adobe.jenkins.github__pr__comment__build.TriggerPRCommentBranchProperty> + <com.adobe.jenkins.github__pr__comment__build.TriggerPRReviewBranchProperty plugin="github-pr-comment-build"/> + <com.adobe.jenkins.github__pr__comment__build.TriggerPRUpdateBranchProperty plugin="github-pr-comment-build"/> </a> </properties> </strategy> diff --git a/tests/multibranch/fixtures/scm_github_full.yaml b/tests/multibranch/fixtures/scm_github_full.yaml index 42350c67..591e0fd8 100644 --- a/tests/multibranch/fixtures/scm_github_full.yaml +++ b/tests/multibranch/fixtures/scm_github_full.yaml @@ -20,6 +20,9 @@ scm: all-branches: - suppress-scm-triggering: true - pipeline-branch-durability-override: max-survivability + - trigger-build-on-pr-comment: "Ci build!" + - trigger-build-on-pr-review: true + - trigger-build-on-pr-update: true build-strategies: - tags: ignore-tags-newer-than: 1 diff --git a/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.xml b/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.xml new file mode 100644 index 00000000..d700a816 --- /dev/null +++ b/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8"?> +<org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject plugin="workflow-multibranch"> + <properties/> + <views> + <hudson.model.AllView> + <name>All</name> + <filterExecutors>false</filterExecutors> + <filterQueue>false</filterQueue> + <properties class="hudson.model.View$PropertyList"/> + <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../../.."/> + </hudson.model.AllView> + </views> + <viewsTabBar class="hudson.views.DefaultViewsTabBar"/> + <folderViews class="jenkins.branch.MultiBranchProjectViewHolder" plugin="branch-api"> + <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/> + </folderViews> + <healthMetrics> + <com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric plugin="cloudbees-folder"> + <nonRecursive>false</nonRecursive> + </com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric> + </healthMetrics> + <icon class="jenkins.branch.MetadataActionFolderIcon" plugin="branch-api"> + <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/> + </icon> + <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder"> + <pruneDeadBranches>true</pruneDeadBranches> + <daysToKeep>-1</daysToKeep> + <numToKeep>-1</numToKeep> + </orphanedItemStrategy> + <triggers/> + <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api"> + <data> + <jenkins.branch.BranchSource> + <source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source"> + <id>gh-johndoe-foo</id> + <repoOwner>johndoe</repoOwner> + <repository>foo</repository> + <traits> + <org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait> + <strategyId>1</strategyId> + </org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait> + <org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait> + <strategyId>1</strategyId> + <trust class="org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustContributors"/> + </org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait> + <jenkins.plugins.git.traits.WipeWorkspaceTrait> + <extension class="hudson.plugins.git.extensions.impl.WipeWorkspace"/> + </jenkins.plugins.git.traits.WipeWorkspaceTrait> + </traits> + </source> + </jenkins.branch.BranchSource> + </data> + <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/> + </sources> + <factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory"> + <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/> + <scriptPath>Jenkinsfile</scriptPath> + </factory> +</org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject> diff --git a/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.yaml b/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.yaml new file mode 100644 index 00000000..7852137e --- /dev/null +++ b/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.yaml @@ -0,0 +1,7 @@ +name: 'demo-multibranch-github-no-fork-prs' +project-type: multibranch +scm: + - github: + repo: 'foo' + repo-owner: 'johndoe' + discover-pr-origin: no diff --git a/tests/publishers/fixtures/join-trigger002.xml b/tests/publishers/fixtures/join-trigger002.xml new file mode 100644 index 00000000..9df79716 --- /dev/null +++ b/tests/publishers/fixtures/join-trigger002.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<project> + <publishers> + <hudson.tasks.BuildTrigger> + <childProjects>project-1,project-2</childProjects> + <threshold> + <name>FAILURE</name> + <ordinal>2</ordinal> + <color>RED</color> + </threshold> + </hudson.tasks.BuildTrigger> + <join.JoinTrigger> + <joinProjects>cleanup</joinProjects> + <joinPublishers/> + <resultThreshold> + <name>FAILURE</name> + <ordinal>2</ordinal> + <color>RED</color> + </resultThreshold> + </join.JoinTrigger> + </publishers> +</project> diff --git a/tests/publishers/fixtures/join-trigger002.yaml b/tests/publishers/fixtures/join-trigger002.yaml new file mode 100644 index 00000000..80940e47 --- /dev/null +++ b/tests/publishers/fixtures/join-trigger002.yaml @@ -0,0 +1,8 @@ +publishers: + - trigger: + project: project-1,project-2 + threshold: failure + - join-trigger: + projects: + - cleanup + threshold: failure diff --git a/tests/triggers/fixtures/github-pull-request-comments.xml b/tests/triggers/fixtures/github-pull-request-comments.xml index 7b2c151e..ef6b231f 100644 --- a/tests/triggers/fixtures/github-pull-request-comments.xml +++ b/tests/triggers/fixtures/github-pull-request-comments.xml @@ -2,25 +2,31 @@ <project> <triggers class="vector"> <org.jenkinsci.plugins.ghprb.GhprbTrigger> + <configVersion>3</configVersion> + <spec>* * * * *</spec> + <cron>* * * * *</cron> <adminlist>user1 user2</adminlist> <whitelist>user3 user4</whitelist> <orgslist>org1 org2</orgslist> + <blackListCommitAuthor/> <whiteListLabels/> <blackListLabels/> <excludedRegions/> <includedRegions/> - <spec>* * * * *</spec> + <buildDescTemplate/> <allowMembersOfWhitelistedOrgsAsAdmin>true</allowMembersOfWhitelistedOrgsAsAdmin> - <cron>* * * * *</cron> <triggerPhrase>retest this please</triggerPhrase> <skipBuildPhrase/> <onlyTriggerPhrase>true</onlyTriggerPhrase> <useGitHubHooks>true</useGitHubHooks> <permitAll>false</permitAll> <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests> + <displayBuildErrorsOnDownstreamBuilds>false</displayBuildErrorsOnDownstreamBuilds> + <whiteListTargetBranches/> + <blackListTargetBranches/> <extensions> <org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildStatus> <messages> diff --git a/tests/triggers/fixtures/github-pull-request-full.xml b/tests/triggers/fixtures/github-pull-request-full.xml index 7bfe2e3c..05652ba7 100644 --- a/tests/triggers/fixtures/github-pull-request-full.xml +++ b/tests/triggers/fixtures/github-pull-request-full.xml @@ -2,12 +2,16 @@ <project> <triggers class="vector"> <org.jenkinsci.plugins.ghprb.GhprbTrigger> + <configVersion>3</configVersion> + <spec>* * * * *</spec> + <cron>* * * * *</cron> <adminlist>user1 user2</adminlist> <whitelist>user3 user4</whitelist> <orgslist>org1 org2</orgslist> + <blackListCommitAuthor>blacklist commit author</blackListCommitAuthor> <whiteListLabels>label1 label2</whiteListLabels> <blackListLabels>label3 @@ -17,15 +21,14 @@ region</excludedRegions> <includedRegions>include region</includedRegions> <buildDescTemplate>build description</buildDescTemplate> - <spec>* * * * *</spec> <allowMembersOfWhitelistedOrgsAsAdmin>true</allowMembersOfWhitelistedOrgsAsAdmin> - <cron>* * * * *</cron> <triggerPhrase>retest this please</triggerPhrase> <skipBuildPhrase>no tests</skipBuildPhrase> <onlyTriggerPhrase>true</onlyTriggerPhrase> <useGitHubHooks>true</useGitHubHooks> <permitAll>true</permitAll> <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests> + <displayBuildErrorsOnDownstreamBuilds>true</displayBuildErrorsOnDownstreamBuilds> <whiteListTargetBranches> <org.jenkinsci.plugins.ghprb.GhprbBranch> <branch>master</branch> @@ -49,7 +52,7 @@ region</includedRegions> <triggeredStatus>triggered status message</triggeredStatus> <startedStatus>started</startedStatus> <statusUrl>url/to/status</statusUrl> - <addTestResults>test result with status message</addTestResults> + <addTestResults>false</addTestResults> <completedStatus> <org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildResultMessage> <message>success message</message> @@ -82,6 +85,10 @@ region</includedRegions> </messages> </org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildStatus> <org.jenkinsci.plugins.ghprb.extensions.build.GhprbCancelBuildsOnUpdate/> + <org.jenkinsci.plugins.ghprb.extensions.comments.GhprbCommentFile> + <commentFilePath>/tmp/path</commentFilePath> + </org.jenkinsci.plugins.ghprb.extensions.comments.GhprbCommentFile> + <org.jenkinsci.plugins.ghprb.extensions.status.GhprbNoCommitStatus/> </extensions> </org.jenkinsci.plugins.ghprb.GhprbTrigger> </triggers> diff --git a/tests/triggers/fixtures/github-pull-request-full.yaml b/tests/triggers/fixtures/github-pull-request-full.yaml index 11a70a36..7fa8bfe9 100644 --- a/tests/triggers/fixtures/github-pull-request-full.yaml +++ b/tests/triggers/fixtures/github-pull-request-full.yaml @@ -19,10 +19,15 @@ triggers: build-desc-template: "build description" trigger-phrase: 'retest this please' skip-build-phrase: 'no tests' + black-list-commit-author: + - blacklist + - commit + - author only-trigger-phrase: true github-hooks: true permit-all: true auto-close-on-fail: false + display-build-errors-on-downstream-builds: true allow-whitelist-orgs-as-admins: true white-list-target-branches: - master @@ -35,7 +40,7 @@ triggers: triggered-status: "triggered status message" started-status: "started" status-url: "url/to/status" - status-add-test-results: "test result with status message" + status-add-test-results: false success-status: "success message" failure-status: "failure message" error-status: "error message" @@ -43,6 +48,8 @@ triggers: failure-comment: "failure comment" error-comment: "error-comment" cancel-builds-on-update: true + comment-file: "/tmp/path" + no-commit-status: true included-regions: - include - region diff --git a/tests/triggers/fixtures/github-pull-request-minimal.xml b/tests/triggers/fixtures/github-pull-request-minimal.xml index dbeac30a..9e72adca 100644 --- a/tests/triggers/fixtures/github-pull-request-minimal.xml +++ b/tests/triggers/fixtures/github-pull-request-minimal.xml @@ -2,22 +2,28 @@ <project> <triggers class="vector"> <org.jenkinsci.plugins.ghprb.GhprbTrigger> + <configVersion>3</configVersion> + <spec/> + <cron/> <adminlist/> <whitelist/> <orgslist/> + <blackListCommitAuthor/> <whiteListLabels/> <blackListLabels/> <excludedRegions/> <includedRegions/> - <spec/> + <buildDescTemplate/> <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin> - <cron/> <triggerPhrase/> <skipBuildPhrase/> <onlyTriggerPhrase>false</onlyTriggerPhrase> <useGitHubHooks>false</useGitHubHooks> <permitAll>false</permitAll> <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests> + <displayBuildErrorsOnDownstreamBuilds>false</displayBuildErrorsOnDownstreamBuilds> + <whiteListTargetBranches/> + <blackListTargetBranches/> </org.jenkinsci.plugins.ghprb.GhprbTrigger> </triggers> </project> diff --git a/tests/triggers/fixtures/github-pull-request-multiple-extensions.xml b/tests/triggers/fixtures/github-pull-request-multiple-extensions.xml index f2d8d14b..8d910f0e 100644 --- a/tests/triggers/fixtures/github-pull-request-multiple-extensions.xml +++ b/tests/triggers/fixtures/github-pull-request-multiple-extensions.xml @@ -2,25 +2,31 @@ <project> <triggers class="vector"> <org.jenkinsci.plugins.ghprb.GhprbTrigger> + <configVersion>3</configVersion> + <spec>* * * * *</spec> + <cron>* * * * *</cron> <adminlist>user1 user2</adminlist> <whitelist>user3 user4</whitelist> <orgslist>org1 org2</orgslist> + <blackListCommitAuthor/> <whiteListLabels/> <blackListLabels/> <excludedRegions/> <includedRegions/> - <spec>* * * * *</spec> + <buildDescTemplate/> <allowMembersOfWhitelistedOrgsAsAdmin>true</allowMembersOfWhitelistedOrgsAsAdmin> - <cron>* * * * *</cron> <triggerPhrase>retest this please</triggerPhrase> <skipBuildPhrase/> <onlyTriggerPhrase>true</onlyTriggerPhrase> <useGitHubHooks>true</useGitHubHooks> <permitAll>false</permitAll> <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests> + <displayBuildErrorsOnDownstreamBuilds>false</displayBuildErrorsOnDownstreamBuilds> + <whiteListTargetBranches/> + <blackListTargetBranches/> <extensions> <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus> <commitStatusContext>test status context</commitStatusContext> diff --git a/tests/triggers/fixtures/github-pull-request-status.xml b/tests/triggers/fixtures/github-pull-request-status.xml index c12373cf..758d98b9 100644 --- a/tests/triggers/fixtures/github-pull-request-status.xml +++ b/tests/triggers/fixtures/github-pull-request-status.xml @@ -2,25 +2,31 @@ <project> <triggers class="vector"> <org.jenkinsci.plugins.ghprb.GhprbTrigger> + <configVersion>3</configVersion> + <spec>* * * * *</spec> + <cron>* * * * *</cron> <adminlist>user1 user2</adminlist> <whitelist>user3 user4</whitelist> <orgslist>org1 org2</orgslist> + <blackListCommitAuthor/> <whiteListLabels/> <blackListLabels/> <excludedRegions/> <includedRegions/> - <spec>* * * * *</spec> + <buildDescTemplate/> <allowMembersOfWhitelistedOrgsAsAdmin>true</allowMembersOfWhitelistedOrgsAsAdmin> - <cron>* * * * *</cron> <triggerPhrase>retest this please</triggerPhrase> <skipBuildPhrase/> <onlyTriggerPhrase>true</onlyTriggerPhrase> <useGitHubHooks>true</useGitHubHooks> <permitAll>false</permitAll> <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests> + <displayBuildErrorsOnDownstreamBuilds>false</displayBuildErrorsOnDownstreamBuilds> + <whiteListTargetBranches/> + <blackListTargetBranches/> <extensions> <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus> <commitStatusContext>test status context</commitStatusContext> diff --git a/tests/wrappers/fixtures/matrix-tie-parent.xml b/tests/wrappers/fixtures/matrix-tie-parent.xml index 9d2c65b8..f88d63b5 100644 --- a/tests/wrappers/fixtures/matrix-tie-parent.xml +++ b/tests/wrappers/fixtures/matrix-tie-parent.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes/> <buildWrappers> <matrixtieparent.BuildWrapperMtp> diff --git a/tests/yamlparser/fixtures/custom_distri.xml b/tests/yamlparser/fixtures/custom_distri.xml index a12900d8..cf9e6467 100644 --- a/tests/yamlparser/fixtures/custom_distri.xml +++ b/tests/yamlparser/fixtures/custom_distri.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <hudson.matrix.TextAxis> <name>distribution</name> diff --git a/tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml b/tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml index 8d582dba..0923b125 100644 --- a/tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml +++ b/tests/yamlparser/fixtures/expand-yaml-for-template-job/dimensionality-test001.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <hudson.matrix.TextAxis> <name>PLATFORM</name> @@ -32,7 +31,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <hudson.matrix.TextAxis> <name>PLATFORM</name> @@ -61,7 +59,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <hudson.matrix.TextAxis> <name>PLATFORM</name> diff --git a/tests/yamlparser/fixtures/github_cancel_builds_on_update_variable001.xml b/tests/yamlparser/fixtures/github_cancel_builds_on_update_variable001.xml index 0832d960..b22d1095 100644 --- a/tests/yamlparser/fixtures/github_cancel_builds_on_update_variable001.xml +++ b/tests/yamlparser/fixtures/github_cancel_builds_on_update_variable001.xml @@ -11,22 +11,28 @@ <scm class="hudson.scm.NullSCM"/> <triggers class="vector"> <org.jenkinsci.plugins.ghprb.GhprbTrigger> + <configVersion>3</configVersion> + <spec/> + <cron/> <adminlist/> <whitelist/> <orgslist/> + <blackListCommitAuthor/> <whiteListLabels/> <blackListLabels/> <excludedRegions/> <includedRegions/> - <spec/> + <buildDescTemplate/> <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin> - <cron/> <triggerPhrase/> <skipBuildPhrase/> <onlyTriggerPhrase>false</onlyTriggerPhrase> <useGitHubHooks>false</useGitHubHooks> <permitAll>false</permitAll> <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests> + <displayBuildErrorsOnDownstreamBuilds>false</displayBuildErrorsOnDownstreamBuilds> + <whiteListTargetBranches/> + <blackListTargetBranches/> <extensions> <org.jenkinsci.plugins.ghprb.extensions.build.GhprbCancelBuildsOnUpdate/> </extensions> diff --git a/tests/yamlparser/fixtures/github_cancel_builds_on_update_variable002.xml b/tests/yamlparser/fixtures/github_cancel_builds_on_update_variable002.xml index 1d913309..14790269 100644 --- a/tests/yamlparser/fixtures/github_cancel_builds_on_update_variable002.xml +++ b/tests/yamlparser/fixtures/github_cancel_builds_on_update_variable002.xml @@ -11,22 +11,28 @@ <scm class="hudson.scm.NullSCM"/> <triggers class="vector"> <org.jenkinsci.plugins.ghprb.GhprbTrigger> + <configVersion>3</configVersion> + <spec/> + <cron/> <adminlist/> <whitelist/> <orgslist/> + <blackListCommitAuthor/> <whiteListLabels/> <blackListLabels/> <excludedRegions/> <includedRegions/> - <spec/> + <buildDescTemplate/> <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin> - <cron/> <triggerPhrase/> <skipBuildPhrase/> <onlyTriggerPhrase>false</onlyTriggerPhrase> <useGitHubHooks>false</useGitHubHooks> <permitAll>false</permitAll> <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests> + <displayBuildErrorsOnDownstreamBuilds>false</displayBuildErrorsOnDownstreamBuilds> + <whiteListTargetBranches/> + <blackListTargetBranches/> </org.jenkinsci.plugins.ghprb.GhprbTrigger> </triggers> <builders/> diff --git a/tests/yamlparser/fixtures/project-matrix002.xml b/tests/yamlparser/fixtures/project-matrix002.xml index a31faada..e9fe8630 100644 --- a/tests/yamlparser/fixtures/project-matrix002.xml +++ b/tests/yamlparser/fixtures/project-matrix002.xml @@ -9,7 +9,6 @@ <color>BLUE</color> </touchStoneResultCondition> </executionStrategy> - <combinationFilter/> <axes/> <actions/> <description><!-- Managed by Jenkins Job Builder --></description> diff --git a/tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml b/tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml index f2bf89fa..18637ea3 100644 --- a/tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml +++ b/tests/yamlparser/fixtures/trigger_parameterized_builds/parameter-override-ordering-003.xml @@ -3,7 +3,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <hudson.matrix.TextAxis> <name>foo_bar</name> @@ -45,7 +44,6 @@ <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> <runSequentially>false</runSequentially> </executionStrategy> - <combinationFilter/> <axes> <hudson.matrix.TextAxis> <name>foo_bar</name> |