Update gerrit comment trigger keywords with regex 38/15738/3
authorAnil Belur <abelur@linuxfoundation.org>
Thu, 23 May 2019 01:11:55 +0000 (11:11 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 23 May 2019 01:11:55 +0000 (11:11 +1000)
Update gerrit comment trigger to use standard regex
and avoid triggering jobs, when these keywords are used as
gerrit comments between users.

Change-Id: Iac67e9508fd600650c4ed351094cfdaf2e212835
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
jjb/lf-c-cpp-jobs.yaml
jjb/lf-ci-jobs.yaml
jjb/lf-info-vote.yaml
jjb/lf-maven-jobs.yaml
jjb/lf-node-jobs.yaml
jjb/lf-python-jobs.yaml
jjb/lf-rtd-jobs.yaml
jjb/lf-whitesource-jobs.yaml
releasenotes/notes/update-gerrit-trigger-comments-469ffad2c2d8770a.yaml [new file with mode: 0644]

index 9dfc447..e49a437 100644 (file)
@@ -99,7 +99,7 @@
           server-name: '{gerrit-server-name}'
           trigger-on:
             - comment-added-contains-event:
-                comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(stage-release)$'
+                comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
           projects:
             - project-compare-type: 'ANT'
               project-pattern: '{project}'
           server-name: '{gerrit-server-name}'
           trigger-on:
             - comment-added-contains-event:
-                comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(stage-release)$'
+                comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
           projects:
             - project-compare-type: 'ANT'
               project-pattern: '{project}'
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     gerrit_trigger_file_paths:
       - compare-type: REG_EXP
index b2eb383..2545a6b 100644 (file)
     gerrit_merge_triggers:
       - change-merged-event
       - comment-added-contains-event:
-          comment-contains-value: remerge$
+          comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
 
     gerrit_trigger_file_paths:
       - compare-type: REG_EXP
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     gerrit_trigger_file_paths:
       - compare-type: REG_EXP
     submodule-disable: false
     gerrit_jjb_deploy_job_triggers:
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(jjb-deploy[:]* (?!\*+$).+$)'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(jjb-deploy[:]* (?!\*+$).+$)'
 
     #####################
     # Job Configuration #
     gerrit_merge_triggers:
       - change-merged-event
       - comment-added-contains-event:
-          comment-contains-value: remerge$
+          comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
 
     #####################
     # Job Configuration #
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     #####################
     # Job Configuration #
                 exclude-no-code-change: false
             - draft-published-event
             - comment-added-contains-event:
-                comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+                comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
           projects:
             - project-compare-type: ANT
               project-pattern: 'releng/global-jjb'
                 exclude-no-code-change: false
             - draft-published-event
             - comment-added-contains-event:
-                comment-contains-value: recheck$
+                comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
           projects:
             - project-compare-type: ANT
               project-pattern: '{project-pattern}'
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     #####################
     # Job Configuration #
     gerrit_merge_triggers:
       - change-merged-event
       - comment-added-contains-event:
-          comment-contains-value: remerge$
+          comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
 
     #####################
     # Job Configuration #
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     gerrit_trigger_file_paths:
       - compare-type: REG_EXP
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     #####################
     # Job Configuration #
index 24c7c11..92763d3 100644 (file)
@@ -53,7 +53,7 @@
 
     gerrit_verify_triggers:
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(vote)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+vote\s*$'
       - comment-added-event:
           approval-category: 'CRVW'
           approval-value: 2
index aa6904b..abbf66e 100644 (file)
 
     gerrit_clm_triggers:
       - comment-added-contains-event:
-          comment-contains-value: run-clm$
+          comment-contains-value: '^Patch Set\s+\d+:\s+run-clm\s*$'
 
     parameters:
       - lf-infra-parameters:
     gerrit_merge_triggers:
       - change-merged-event
       - comment-added-contains-event:
-          comment-contains-value: remerge$
+          comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
 
     #####################
     # Job Configuration #
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     #####################
     # Job Configuration #
     gerrit_merge_triggers:
       - change-merged-event
       - comment-added-contains-event:
-          comment-contains-value: remerge$
+          comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
 
     gerrit_trigger_file_paths:
       - compare-type: REG_EXP
 
     gerrit_release_triggers:
       - comment-added-contains-event:
-          comment-contains-value: stage-release$
+          comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
 
     gerrit_trigger_file_paths:
       - compare-type: ANT
 
     gerrit_sonar_triggers:
       - comment-added-contains-event:
-          comment-contains-value: run-sonar$
+          comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
 
     #####################
     # Job Configuration #
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     gerrit_trigger_file_paths:
       - compare-type: REG_EXP
index b1e0cbd..d7d50d6 100644 (file)
@@ -82,7 +82,7 @@
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     #####################
     # Job Configuration #
index 61bb5d2..12512d2 100644 (file)
 
     gerrit_clm_triggers:
       - comment-added-contains-event:
-          comment-contains-value: run-clm$
+          comment-contains-value: '^Patch Set\s+\d+:\s+run-clm\s*$'
 
     #####################
     # Job Configuration #
 
     gerrit_sonar_triggers:
       - comment-added-contains-event:
-          comment-contains-value: run-sonar$
+          comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
 
     #####################
     # Job Configuration #
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     #####################
     # Job Configuration #
index 110f4ba..b252626 100644 (file)
@@ -78,7 +78,7 @@
     gerrit_merge_triggers:
       - change-merged-event
       - comment-added-contains-event:
-          comment-contains-value: remerge$
+          comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
       - ref-updated-event
 
     #####################
           exclude-no-code-change: false
       - draft-published-event
       - comment-added-contains-event:
-          comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
 
     #####################
     # Job Configuration #
index 8fade15..77434a8 100644 (file)
 
     gerrit_wss_triggers:
       - comment-added-contains-event:
-          comment-contains-value: run-whitesource$
+          comment-contains-value: '^Patch Set\s+\d+:\s+(run-whitesource)\s*$'
 
     #####################
     # Job Configuration #
diff --git a/releasenotes/notes/update-gerrit-trigger-comments-469ffad2c2d8770a.yaml b/releasenotes/notes/update-gerrit-trigger-comments-469ffad2c2d8770a.yaml
new file mode 100644 (file)
index 0000000..936facf
--- /dev/null
@@ -0,0 +1,7 @@
+---
+upgrade:
+  - |
+    Update gerrit comment trigger to use a more standard regex and avoid triggering
+    jobs, when these keywords are intended to be used as code review comments
+    between users. Also improve the regexs to make them more succinct and
+    readable.