Add support for disable-strict-forbidden-file-verification
Enabling this option will allow an event to trigger a build if the event contains BOTH one or more wanted file paths AND one or more forbidden file paths. In other words, with this option, the build will not get triggered if the change contains only forbidden files, otherwise it will get triggered. Support for this was added in Plugin Version 2.16.0. Change-Id: I860b076c2393909012c3ac9821559c9e8c9f7e28
This commit is contained in:
parent
9bb036379c
commit
440acd0fa1
@ -367,6 +367,15 @@ def gerrit(parser, xml_parent, data):
|
||||
* **pattern** (`str`) -- Topic name pattern to
|
||||
match
|
||||
|
||||
* **disable-strict-forbidden-file-verification** (`bool`) --
|
||||
Enabling this option will allow an event to trigger a
|
||||
build if the event contains BOTH one or more wanted file
|
||||
paths AND one or more forbidden file paths. In other
|
||||
words, with this option, the build will not get
|
||||
triggered if the change contains only forbidden files,
|
||||
otherwise it will get triggered. Requires plugin
|
||||
version >= 2.16.0 (default false)
|
||||
|
||||
:arg dict skip-vote: map of build outcomes for which Jenkins must skip
|
||||
vote. Requires Gerrit Trigger Plugin version >= 2.7.0
|
||||
|
||||
@ -521,6 +530,11 @@ def gerrit(parser, xml_parent, data):
|
||||
'PLAIN'))
|
||||
XML.SubElement(topic_tag, 'pattern').text = topic['pattern']
|
||||
|
||||
XML.SubElement(gproj,
|
||||
'disableStrictForbiddenFileVerification').text = str(
|
||||
project.get('disable-strict-forbidden-file-verification',
|
||||
False)).lower()
|
||||
|
||||
build_gerrit_skip_votes(gtrig, data)
|
||||
XML.SubElement(gtrig, 'silentMode').text = str(
|
||||
data.get('silent', False)).lower()
|
||||
|
@ -62,6 +62,7 @@
|
||||
<pattern>**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
|
||||
</branches>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<pattern>subdirectory/**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
|
||||
</filePaths>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -23,6 +23,7 @@
|
||||
<pattern>subdirectory/**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
|
||||
</filePaths>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<pattern>subdirectory/**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
|
||||
</filePaths>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
<com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
<compareType>PLAIN</compareType>
|
||||
@ -39,6 +40,7 @@
|
||||
<pattern>subdirectory/**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
|
||||
</filePaths>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -29,6 +29,7 @@
|
||||
<pattern>refactor-xy**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Topic>
|
||||
</topics>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<pattern>subdirectory/**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
|
||||
</filePaths>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<pattern>subdirectory/**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
|
||||
</filePaths>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -29,6 +29,7 @@
|
||||
<pattern>refactor-xy**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Topic>
|
||||
</topics>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -35,6 +35,7 @@
|
||||
<pattern>refactor-xy**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Topic>
|
||||
</topics>
|
||||
<disableStrictForbiddenFileVerification>true</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
@ -21,6 +21,7 @@ triggers:
|
||||
forbidden-file-paths:
|
||||
- compare-type: ANT
|
||||
pattern: subdirectory/**
|
||||
disable-strict-forbidden-file-verification: true
|
||||
topics:
|
||||
- compare-type: ANT
|
||||
pattern: refactor-xy**
|
||||
|
@ -62,6 +62,7 @@
|
||||
<pattern>**</pattern>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
|
||||
</branches>
|
||||
<disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
|
||||
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
|
||||
</gerritProjects>
|
||||
<skipVote>
|
||||
|
Loading…
Reference in New Issue
Block a user