diff --git a/jenkins_jobs/modules/triggers.py b/jenkins_jobs/modules/triggers.py index 2f89b5c60..8421fd6b7 100644 --- a/jenkins_jobs/modules/triggers.py +++ b/jenkins_jobs/modules/triggers.py @@ -240,6 +240,67 @@ def build_gerrit_skip_votes(xml_parent, data): XML.SubElement(skip_vote_node, tag_name).text = str(setting).lower() +def build_gerrit_parameter_modes(xml_parent, data, plugin_ver): + if plugin_ver < pkg_resources.parse_version("2.18.0"): + for parameter_name in ( + "commit-message", + "name-and-email", + "change-subject", + "comment-text", + ): + parameter_mode = "{}-parameter-mode".format(parameter_name) + if parameter_mode in data: + logger.warning( + "Gerrit Trigger property '{}' is not supported in this " + "plugin version".format(parameter_mode) + ) + + deprecated_mappings = ( + ("no-name-and-email", "noNameAndEmailParameters", False), + ("readable-message", "readableMessage", False), + ) + helpers.convert_mapping_to_xml( + xml_parent, data, deprecated_mappings, fail_required=True + ) + else: # version >= 2.18.0 + readable_message = data.get("readable-message") + if readable_message is not None: + logger.warning("Gerrit Trigger property 'readable-message' is deprecated") + no_name_and_email = data.get("no-name-and-email") + if no_name_and_email is not None: + logger.warning("Gerrit Trigger property 'no-name-and-email' is deprecated") + allowed_parameter_modes = ["NONE", "PLAIN", "BASE64"] + new_mappings = ( + ( + "commit-message-parameter-mode", + "commitMessageParameterMode", + "BASE64" if readable_message is not True else "PLAIN", + allowed_parameter_modes, + ), + ( + "name-and-email-parameter-mode", + "nameAndEmailParameterMode", + "PLAIN" if no_name_and_email is not True else "NONE", + allowed_parameter_modes, + ), + ( + "change-subject-parameter-mode", + "changeSubjectParameterMode", + "PLAIN", + allowed_parameter_modes, + ), + ( + "comment-text-parameter-mode", + "commentTextParameterMode", + "BASE64", + allowed_parameter_modes, + ), + ) + helpers.convert_mapping_to_xml( + xml_parent, data, new_mappings, fail_required=True + ) + + def gerrit(registry, xml_parent, data): """yaml: gerrit @@ -450,10 +511,42 @@ def gerrit(registry, xml_parent, data): parameters (default true) :arg bool no-name-and-email: Do not pass compound 'name and email' parameters (default false) + + .. deprecated:: 3.5.0 Please use `name-and-email-parameter-mode` + parameter. + :arg bool readable-message: If parameters regarding multiline text, e.g. commit message, should be as human readable or not. If false, those parameters are Base64 encoded to keep environment variables clean. (default false) + + .. deprecated:: 3.5.0 Please use `commit-message-parameter-mode` + parameter. + + :arg str name-and-email-parameter-mode: The parameter mode for the compound + "name and email" parameters (like GERRIT_PATCHSET_UPLOADER or + GERRIT_CHANGE_OWNER). This can either be 'NONE' to avoid passing the + parameter all together, 'PLAIN' to pass the parameter in human readable + form, or 'BASE64' to pass the parameter in base64 encoded form (default + 'PLAIN'). Requires Gerrit Trigger Plugin version >= 2.18.0. + :arg str commit-message-parameter-mode: The parameter mode for the + GERRIT_CHANGE_COMMIT_MESSAGE parameter. This can either be 'NONE' to + avoid passing the parameter all together, 'PLAIN' to pass the parameter + in human readable form, or 'BASE64' to pass the parameter in base64 + encoded form (default 'BASE64'). Requires Gerrit Trigger Plugin version + >= 2.18.0. + :arg str change-subject-parameter-mode: The parameter mode for the + GERRIT_CHANGE_SUBJECT parameter. This can either be 'NONE' to avoid + passing the parameter all together, 'PLAIN' to pass the parameter in + human readable form, or 'BASE64' to pass the parameter in base64 + encoded form (default 'PLAIN'). Requires Gerrit Trigger Plugin version + >= 2.18.0. + :arg str comment-text-parameter-mode: The parameter mode for the + GERRIT_EVENT_COMMENT_TEXT parameter. This can either be 'NONE' to avoid + passing the parameter all together, 'PLAIN' to pass the parameter in + human readable form, or 'BASE64' to pass the parameter in base64 + encoded form (default 'BASE64'). Requires Gerrit Trigger Plugin version + >= 2.18.0. :arg str dependency-jobs: All jobs on which this job depends. If a commit should trigger both a dependency and this job, the dependency will be built first. Use commas to separate job names. Beware of cyclic @@ -469,7 +562,14 @@ def gerrit(registry, xml_parent, data): trigger configuration will be fetched from there on a regular interval :arg bool trigger-for-unreviewed-patches: trigger patchset-created events for changes that were uploaded while connection to Gerrit was down - (default false). Requires Gerrit Trigger Plugin version >= 2.11.0 + (default false). Requires Gerrit Trigger Plugin version >= 2.11.0. + + .. deprecated:: 3.5.0 Supported for Gerrit Trigger Plugin versions + < 2.14.0. See + `Missed Events Playback Feature `_. + :arg str custom-url: Custom URL for a message sent to Gerrit. Build details URL will be used if empty. (default '') :arg str server-name: Name of the server to trigger on, or ''__ANY__'' to @@ -503,6 +603,11 @@ def gerrit(registry, xml_parent, data): gerrit_handle_legacy_configuration(data) + plugin_info = registry.get_plugin_info("Gerrit Trigger") + plugin_ver = pkg_resources.parse_version( + plugin_info.get("version", str(sys.maxsize)) + ) + projects = data.get("projects", []) gtrig = XML.SubElement( xml_parent, @@ -607,11 +712,10 @@ def gerrit(registry, xml_parent, data): ("silent", "silentMode", False), ("silent-start", "silentStartMode", False), ("escape-quotes", "escapeQuotes", True), - ("no-name-and-email", "noNameAndEmailParameters", False), - ("readable-message", "readableMessage", False), ("dependency-jobs", "dependencyJobsNames", ""), ] helpers.convert_mapping_to_xml(gtrig, data, general_mappings, fail_required=True) + build_gerrit_parameter_modes(gtrig, data, plugin_ver) notification_levels = ["NONE", "OWNER", "OWNER_REVIEWERS", "ALL", "SERVER_DEFAULT"] notification_level = data.get("notification-level", "SERVER_DEFAULT") if notification_level not in notification_levels: @@ -624,16 +728,26 @@ def gerrit(registry, xml_parent, data): XML.SubElement(gtrig, "notificationLevel").text = notification_level XML.SubElement(gtrig, "dynamicTriggerConfiguration").text = str( data.get("dynamic-trigger-enabled", False) - ) + ).lower() XML.SubElement(gtrig, "triggerConfigURL").text = str( data.get("dynamic-trigger-url", "") ) + if data.get("dynamic-trigger-enabled", False) is False: + XML.SubElement(gtrig, "dynamicGerritProjects").set("class", "empty-list") XML.SubElement(gtrig, "triggerInformationAction").text = str( data.get("trigger-information-action", "") ) - XML.SubElement(gtrig, "allowTriggeringUnreviewedPatches").text = str( - data.get("trigger-for-unreviewed-patches", False) - ).lower() + if (plugin_ver >= pkg_resources.parse_version("2.11.0")) and ( + plugin_ver < pkg_resources.parse_version("2.14.0") + ): + XML.SubElement(gtrig, "allowTriggeringUnreviewedPatches").text = str( + data.get("trigger-for-unreviewed-patches", False) + ).lower() + elif "trigger-for-unreviewed-patches" in data: + logger.warning( + "Gerrit Trigger property 'trigger-for-unreviewed-patches' is not " + "supported in this plugin version" + ) build_gerrit_triggers(gtrig, data) override = str(data.get("override-votes", False)).lower() if override == "true": diff --git a/tests/jsonparser/fixtures/complete001.xml b/tests/jsonparser/fixtures/complete001.xml index 355fac1ac..17a54f725 100644 --- a/tests/jsonparser/fixtures/complete001.xml +++ b/tests/jsonparser/fixtures/complete001.xml @@ -68,14 +68,16 @@ false false true - false - false + BASE64 + PLAIN + PLAIN + BASE64 - False + false + - false diff --git a/tests/triggers/fixtures/gerrit001.xml b/tests/triggers/fixtures/gerrit001.xml index 5a30fcb37..00774f200 100644 --- a/tests/triggers/fixtures/gerrit001.xml +++ b/tests/triggers/fixtures/gerrit001.xml @@ -31,14 +31,15 @@ false false false - false - false + BASE64 + PLAIN + PLAIN + BASE64 - True + true http://myhost/mytrigger - false APRV diff --git a/tests/triggers/fixtures/gerrit002.xml b/tests/triggers/fixtures/gerrit002.xml index d42eb2bb9..f18e4fd77 100644 --- a/tests/triggers/fixtures/gerrit002.xml +++ b/tests/triggers/fixtures/gerrit002.xml @@ -35,14 +35,15 @@ false false false - false - false + BASE64 + PLAIN + PLAIN + BASE64 - True + true http://myhost/mytrigger - false APRV diff --git a/tests/triggers/fixtures/gerrit003.xml b/tests/triggers/fixtures/gerrit003.xml index 55ef0e6fa..32d55b85e 100644 --- a/tests/triggers/fixtures/gerrit003.xml +++ b/tests/triggers/fixtures/gerrit003.xml @@ -52,14 +52,15 @@ false false false - false - false + BASE64 + PLAIN + PLAIN + BASE64 - True + true http://myhost/mytrigger - false APRV diff --git a/tests/triggers/fixtures/gerrit004.xml b/tests/triggers/fixtures/gerrit004.xml index 4afca1cd0..b7c5dd8b1 100644 --- a/tests/triggers/fixtures/gerrit004.xml +++ b/tests/triggers/fixtures/gerrit004.xml @@ -41,14 +41,15 @@ false true false - false - false job1, job2 + BASE64 + PLAIN + PLAIN + BASE64 ALL - True + true http://myhost/mytrigger - true true diff --git a/tests/triggers/fixtures/gerrit004.yaml b/tests/triggers/fixtures/gerrit004.yaml index df64b5926..d890d57f0 100644 --- a/tests/triggers/fixtures/gerrit004.yaml +++ b/tests/triggers/fixtures/gerrit004.yaml @@ -32,11 +32,10 @@ triggers: silent: false silent-start: true escape-quotes: false - no-name-and-email: false dependency-jobs: 'job1, job2' + name-and-email-parameter-mode: PLAIN notification-level: ALL dynamic-trigger-enabled: true dynamic-trigger-url: http://myhost/mytrigger - trigger-for-unreviewed-patches: true server-name: my-server failure-message-file: path/to/filename diff --git a/tests/triggers/fixtures/gerrit005.xml b/tests/triggers/fixtures/gerrit005.xml index bb719e43a..05a179daf 100644 --- a/tests/triggers/fixtures/gerrit005.xml +++ b/tests/triggers/fixtures/gerrit005.xml @@ -31,14 +31,16 @@ false false true - false - false + BASE64 + PLAIN + PLAIN + BASE64 - False + false + - false APRV diff --git a/tests/triggers/fixtures/gerrit006.xml b/tests/triggers/fixtures/gerrit006.xml index 30a9e5c34..26ecccee1 100644 --- a/tests/triggers/fixtures/gerrit006.xml +++ b/tests/triggers/fixtures/gerrit006.xml @@ -31,14 +31,15 @@ false false false - false - true + PLAIN + PLAIN + PLAIN + BASE64 - True + true http://myhost/mytrigger - false recheck diff --git a/tests/triggers/fixtures/gerrit007.xml b/tests/triggers/fixtures/gerrit007.xml index 821186ea9..8c673fd06 100644 --- a/tests/triggers/fixtures/gerrit007.xml +++ b/tests/triggers/fixtures/gerrit007.xml @@ -41,14 +41,15 @@ false false false - false - false + BASE64 + PLAIN + PLAIN + BASE64 - True + true http://myhost/mytrigger - true diff --git a/tests/triggers/fixtures/gerrit008.xml b/tests/triggers/fixtures/gerrit008.xml index d17614898..2639bd702 100644 --- a/tests/triggers/fixtures/gerrit008.xml +++ b/tests/triggers/fixtures/gerrit008.xml @@ -47,14 +47,15 @@ false true false - false - false job1, job2 + BASE64 + PLAIN + PLAIN + BASE64 ALL - True + true http://myhost/mytrigger - true true diff --git a/tests/triggers/fixtures/gerrit009.xml b/tests/triggers/fixtures/gerrit009.xml index 8abc6e438..cc87f5e25 100644 --- a/tests/triggers/fixtures/gerrit009.xml +++ b/tests/triggers/fixtures/gerrit009.xml @@ -13,14 +13,15 @@ false false true - false - false + BASE64 + PLAIN + PLAIN + BASE64 - True + true http://myhost/mytrigger - false APRV diff --git a/tests/triggers/fixtures/gerrit010.xml b/tests/triggers/fixtures/gerrit010.xml index c9cc24993..78d66b4a4 100644 --- a/tests/triggers/fixtures/gerrit010.xml +++ b/tests/triggers/fixtures/gerrit010.xml @@ -31,14 +31,15 @@ false false false - false - false + BASE64 + PLAIN + PLAIN + BASE64 - True + true http://myhost/mytrigger - false APRV diff --git a/tests/triggers/fixtures/gerrit011-name-and-email-parameter-mode-base64.xml b/tests/triggers/fixtures/gerrit011-name-and-email-parameter-mode-base64.xml new file mode 100644 index 000000000..a52b428ee --- /dev/null +++ b/tests/triggers/fixtures/gerrit011-name-and-email-parameter-mode-base64.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + BASE64 + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit011-name-and-email-parameter-mode-base64.yaml b/tests/triggers/fixtures/gerrit011-name-and-email-parameter-mode-base64.yaml new file mode 100644 index 000000000..052da2cf7 --- /dev/null +++ b/tests/triggers/fixtures/gerrit011-name-and-email-parameter-mode-base64.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + name-and-email-parameter-mode: BASE64 diff --git a/tests/triggers/fixtures/gerrit012-name-and-email-parameter-mode-none.xml b/tests/triggers/fixtures/gerrit012-name-and-email-parameter-mode-none.xml new file mode 100644 index 000000000..3e5af26fa --- /dev/null +++ b/tests/triggers/fixtures/gerrit012-name-and-email-parameter-mode-none.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + NONE + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit012-name-and-email-parameter-mode-none.yaml b/tests/triggers/fixtures/gerrit012-name-and-email-parameter-mode-none.yaml new file mode 100644 index 000000000..1f589cd64 --- /dev/null +++ b/tests/triggers/fixtures/gerrit012-name-and-email-parameter-mode-none.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + name-and-email-parameter-mode: NONE diff --git a/tests/triggers/fixtures/gerrit013-name-and-email-parameter-mode-plain.xml b/tests/triggers/fixtures/gerrit013-name-and-email-parameter-mode-plain.xml new file mode 100644 index 000000000..168ecdb6a --- /dev/null +++ b/tests/triggers/fixtures/gerrit013-name-and-email-parameter-mode-plain.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + PLAIN + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit013-name-and-email-parameter-mode-plain.yaml b/tests/triggers/fixtures/gerrit013-name-and-email-parameter-mode-plain.yaml new file mode 100644 index 000000000..f10f5dfeb --- /dev/null +++ b/tests/triggers/fixtures/gerrit013-name-and-email-parameter-mode-plain.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + name-and-email-parameter-mode: PLAIN diff --git a/tests/triggers/fixtures/gerrit014-commit-message-parameter-mode-base64.xml b/tests/triggers/fixtures/gerrit014-commit-message-parameter-mode-base64.xml new file mode 100644 index 000000000..168ecdb6a --- /dev/null +++ b/tests/triggers/fixtures/gerrit014-commit-message-parameter-mode-base64.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + PLAIN + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit014-commit-message-parameter-mode-base64.yaml b/tests/triggers/fixtures/gerrit014-commit-message-parameter-mode-base64.yaml new file mode 100644 index 000000000..afc29a4bf --- /dev/null +++ b/tests/triggers/fixtures/gerrit014-commit-message-parameter-mode-base64.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + commit-message-parameter-mode: BASE64 diff --git a/tests/triggers/fixtures/gerrit015-commit-message-parameter-mode-plain.xml b/tests/triggers/fixtures/gerrit015-commit-message-parameter-mode-plain.xml new file mode 100644 index 000000000..aca3e5b3e --- /dev/null +++ b/tests/triggers/fixtures/gerrit015-commit-message-parameter-mode-plain.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + PLAIN + PLAIN + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit015-commit-message-parameter-mode-plain.yaml b/tests/triggers/fixtures/gerrit015-commit-message-parameter-mode-plain.yaml new file mode 100644 index 000000000..b3f8df2f3 --- /dev/null +++ b/tests/triggers/fixtures/gerrit015-commit-message-parameter-mode-plain.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + commit-message-parameter-mode: PLAIN diff --git a/tests/triggers/fixtures/gerrit016-commit-message-parameter-mode-none.xml b/tests/triggers/fixtures/gerrit016-commit-message-parameter-mode-none.xml new file mode 100644 index 000000000..585b758a0 --- /dev/null +++ b/tests/triggers/fixtures/gerrit016-commit-message-parameter-mode-none.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + NONE + PLAIN + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit016-commit-message-parameter-mode-none.yaml b/tests/triggers/fixtures/gerrit016-commit-message-parameter-mode-none.yaml new file mode 100644 index 000000000..fb9035413 --- /dev/null +++ b/tests/triggers/fixtures/gerrit016-commit-message-parameter-mode-none.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + commit-message-parameter-mode: NONE diff --git a/tests/triggers/fixtures/gerrit017-change-subject-parameter-mode-base64.xml b/tests/triggers/fixtures/gerrit017-change-subject-parameter-mode-base64.xml new file mode 100644 index 000000000..afb1fc2e5 --- /dev/null +++ b/tests/triggers/fixtures/gerrit017-change-subject-parameter-mode-base64.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + PLAIN + BASE64 + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit017-change-subject-parameter-mode-base64.yaml b/tests/triggers/fixtures/gerrit017-change-subject-parameter-mode-base64.yaml new file mode 100644 index 000000000..89f9649f4 --- /dev/null +++ b/tests/triggers/fixtures/gerrit017-change-subject-parameter-mode-base64.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + change-subject-parameter-mode: BASE64 diff --git a/tests/triggers/fixtures/gerrit018-change-subject-parameter-mode-plain.xml b/tests/triggers/fixtures/gerrit018-change-subject-parameter-mode-plain.xml new file mode 100644 index 000000000..168ecdb6a --- /dev/null +++ b/tests/triggers/fixtures/gerrit018-change-subject-parameter-mode-plain.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + PLAIN + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit018-change-subject-parameter-mode-plain.yaml b/tests/triggers/fixtures/gerrit018-change-subject-parameter-mode-plain.yaml new file mode 100644 index 000000000..4db9e31c6 --- /dev/null +++ b/tests/triggers/fixtures/gerrit018-change-subject-parameter-mode-plain.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + change-subject-parameter-mode: PLAIN diff --git a/tests/triggers/fixtures/gerrit019-change-subject-parameter-mode-none.xml b/tests/triggers/fixtures/gerrit019-change-subject-parameter-mode-none.xml new file mode 100644 index 000000000..06483bd25 --- /dev/null +++ b/tests/triggers/fixtures/gerrit019-change-subject-parameter-mode-none.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + PLAIN + NONE + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit019-change-subject-parameter-mode-none.yaml b/tests/triggers/fixtures/gerrit019-change-subject-parameter-mode-none.yaml new file mode 100644 index 000000000..876f7aaac --- /dev/null +++ b/tests/triggers/fixtures/gerrit019-change-subject-parameter-mode-none.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + change-subject-parameter-mode: NONE diff --git a/tests/triggers/fixtures/gerrit020-comment-text-parameter-mode-base64.xml b/tests/triggers/fixtures/gerrit020-comment-text-parameter-mode-base64.xml new file mode 100644 index 000000000..168ecdb6a --- /dev/null +++ b/tests/triggers/fixtures/gerrit020-comment-text-parameter-mode-base64.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + PLAIN + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit020-comment-text-parameter-mode-base64.yaml b/tests/triggers/fixtures/gerrit020-comment-text-parameter-mode-base64.yaml new file mode 100644 index 000000000..097c06485 --- /dev/null +++ b/tests/triggers/fixtures/gerrit020-comment-text-parameter-mode-base64.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + comment-text-parameter-mode: BASE64 diff --git a/tests/triggers/fixtures/gerrit021-comment-text-parameter-mode-plain.xml b/tests/triggers/fixtures/gerrit021-comment-text-parameter-mode-plain.xml new file mode 100644 index 000000000..25b079f32 --- /dev/null +++ b/tests/triggers/fixtures/gerrit021-comment-text-parameter-mode-plain.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + PLAIN + PLAIN + PLAIN + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit021-comment-text-parameter-mode-plain.yaml b/tests/triggers/fixtures/gerrit021-comment-text-parameter-mode-plain.yaml new file mode 100644 index 000000000..37ac319d5 --- /dev/null +++ b/tests/triggers/fixtures/gerrit021-comment-text-parameter-mode-plain.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + comment-text-parameter-mode: PLAIN diff --git a/tests/triggers/fixtures/gerrit022-comment-text-parameter-mode-none.xml b/tests/triggers/fixtures/gerrit022-comment-text-parameter-mode-none.xml new file mode 100644 index 000000000..22a02bd25 --- /dev/null +++ b/tests/triggers/fixtures/gerrit022-comment-text-parameter-mode-none.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + PLAIN + PLAIN + NONE + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit022-comment-text-parameter-mode-none.yaml b/tests/triggers/fixtures/gerrit022-comment-text-parameter-mode-none.yaml new file mode 100644 index 000000000..867ee90bc --- /dev/null +++ b/tests/triggers/fixtures/gerrit022-comment-text-parameter-mode-none.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + comment-text-parameter-mode: NONE diff --git a/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.plugins_info.yaml b/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.plugins_info.yaml new file mode 100644 index 000000000..a19595b4e --- /dev/null +++ b/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.plugins_info.yaml @@ -0,0 +1,3 @@ +- longName: 'Gerrit Trigger' + shortName: 'gerrit-trigger' + version: '2.17.0' diff --git a/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.xml b/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.xml new file mode 100644 index 000000000..ecd8a3a7d --- /dev/null +++ b/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.xml @@ -0,0 +1,35 @@ + + + + + + + + false + false + false + false + + false + false + true + + true + false + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.yaml b/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.yaml new file mode 100644 index 000000000..cd08b8c94 --- /dev/null +++ b/tests/triggers/fixtures/gerrit023-no-name-and-email-lt-2.18.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + no-name-and-email: true diff --git a/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.plugins_info.yaml b/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.plugins_info.yaml new file mode 100644 index 000000000..7515655fc --- /dev/null +++ b/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.plugins_info.yaml @@ -0,0 +1,3 @@ +- longName: 'Gerrit Trigger' + shortName: 'gerrit-trigger' + version: '2.18.0' diff --git a/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.xml b/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.xml new file mode 100644 index 000000000..3e5af26fa --- /dev/null +++ b/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + BASE64 + NONE + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.yaml b/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.yaml new file mode 100644 index 000000000..cd08b8c94 --- /dev/null +++ b/tests/triggers/fixtures/gerrit024-no-name-and-email-ge-2.18.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + no-name-and-email: true diff --git a/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.plugins_info.yaml b/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.plugins_info.yaml new file mode 100644 index 000000000..a19595b4e --- /dev/null +++ b/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.plugins_info.yaml @@ -0,0 +1,3 @@ +- longName: 'Gerrit Trigger' + shortName: 'gerrit-trigger' + version: '2.17.0' diff --git a/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.xml b/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.xml new file mode 100644 index 000000000..c7af0d187 --- /dev/null +++ b/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.xml @@ -0,0 +1,35 @@ + + + + + + + + false + false + false + false + + false + false + true + + false + true + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.yaml b/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.yaml new file mode 100644 index 000000000..6fb173e83 --- /dev/null +++ b/tests/triggers/fixtures/gerrit025-readable-message-lt-2.18.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + readable-message: true diff --git a/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.plugins_info.yaml b/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.plugins_info.yaml new file mode 100644 index 000000000..7515655fc --- /dev/null +++ b/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.plugins_info.yaml @@ -0,0 +1,3 @@ +- longName: 'Gerrit Trigger' + shortName: 'gerrit-trigger' + version: '2.18.0' diff --git a/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.xml b/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.xml new file mode 100644 index 000000000..aca3e5b3e --- /dev/null +++ b/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.xml @@ -0,0 +1,37 @@ + + + + + + + + false + false + false + false + + false + false + true + + PLAIN + PLAIN + PLAIN + BASE64 + + false + + + + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.yaml b/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.yaml new file mode 100644 index 000000000..6fb173e83 --- /dev/null +++ b/tests/triggers/fixtures/gerrit026-readable-message-ge-2.18.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + readable-message: true diff --git a/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.plugins_info.yaml b/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.plugins_info.yaml new file mode 100644 index 000000000..c4e8764fa --- /dev/null +++ b/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.plugins_info.yaml @@ -0,0 +1,3 @@ +- longName: 'Gerrit Trigger' + shortName: 'gerrit-trigger' + version: '2.13.0' diff --git a/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.xml b/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.xml new file mode 100644 index 000000000..8b26014c2 --- /dev/null +++ b/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.xml @@ -0,0 +1,36 @@ + + + + + + + + false + false + false + false + + false + false + true + + false + false + + false + + + + true + + + + + + + + + __ANY__ + + + diff --git a/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.yaml b/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.yaml new file mode 100644 index 000000000..4b1238ffd --- /dev/null +++ b/tests/triggers/fixtures/gerrit027-trigger-for-unreviewed-patches.yaml @@ -0,0 +1,3 @@ +triggers: + - gerrit: + trigger-for-unreviewed-patches: true diff --git a/tests/yamlparser/fixtures/complete001.xml b/tests/yamlparser/fixtures/complete001.xml index 546fd5e68..ef15abeb0 100644 --- a/tests/yamlparser/fixtures/complete001.xml +++ b/tests/yamlparser/fixtures/complete001.xml @@ -69,14 +69,16 @@ false false true - false - false + BASE64 + PLAIN + PLAIN + BASE64 - False + false + - false