From: Anil Belur Date: Thu, 23 May 2019 01:11:55 +0000 (+1000) Subject: Update gerrit comment trigger keywords with regex X-Git-Tag: v0.38.0~6 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F15738%2F3;p=releng%2Fglobal-jjb.git Update gerrit comment trigger keywords with regex 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 --- diff --git a/jjb/lf-c-cpp-jobs.yaml b/jjb/lf-c-cpp-jobs.yaml index 9dfc4473..e49a4377 100644 --- a/jjb/lf-c-cpp-jobs.yaml +++ b/jjb/lf-c-cpp-jobs.yaml @@ -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}' @@ -262,7 +262,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}' @@ -339,7 +339,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*$' gerrit_trigger_file_paths: - compare-type: REG_EXP diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index b2eb383b..2545a6be 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -287,7 +287,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*$' gerrit_trigger_file_paths: - compare-type: REG_EXP @@ -430,7 +430,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*$' gerrit_trigger_file_paths: - compare-type: REG_EXP @@ -620,7 +620,7 @@ 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 # @@ -737,7 +737,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*$' ##################### # Job Configuration # @@ -852,7 +852,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 # @@ -1018,7 +1018,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*$' projects: - project-compare-type: ANT project-pattern: 'releng/global-jjb' @@ -1128,7 +1128,7 @@ 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}' @@ -1187,7 +1187,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 # @@ -1463,7 +1463,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*$' ##################### # Job Configuration # @@ -1588,7 +1588,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*$' gerrit_trigger_file_paths: - compare-type: REG_EXP @@ -1772,7 +1772,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 # diff --git a/jjb/lf-info-vote.yaml b/jjb/lf-info-vote.yaml index 24c7c11e..92763d3c 100644 --- a/jjb/lf-info-vote.yaml +++ b/jjb/lf-info-vote.yaml @@ -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 diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index aa6904b1..abbf66e4 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -161,7 +161,7 @@ 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: @@ -312,7 +312,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*$' ##################### # Job Configuration # @@ -445,7 +445,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 # @@ -564,7 +564,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*$' gerrit_trigger_file_paths: - compare-type: REG_EXP @@ -832,7 +832,7 @@ 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 @@ -1118,7 +1118,7 @@ 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 # @@ -1331,7 +1331,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*$' gerrit_trigger_file_paths: - compare-type: REG_EXP diff --git a/jjb/lf-node-jobs.yaml b/jjb/lf-node-jobs.yaml index b1e0cbd1..d7d50d6a 100644 --- a/jjb/lf-node-jobs.yaml +++ b/jjb/lf-node-jobs.yaml @@ -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 # diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index 61bb5d2d..12512d23 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -132,7 +132,7 @@ 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 # @@ -317,7 +317,7 @@ 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 # @@ -479,7 +479,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 # diff --git a/jjb/lf-rtd-jobs.yaml b/jjb/lf-rtd-jobs.yaml index 110f4ba4..b252626d 100644 --- a/jjb/lf-rtd-jobs.yaml +++ b/jjb/lf-rtd-jobs.yaml @@ -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 ##################### @@ -178,7 +178,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 # diff --git a/jjb/lf-whitesource-jobs.yaml b/jjb/lf-whitesource-jobs.yaml index 8fade15b..77434a87 100644 --- a/jjb/lf-whitesource-jobs.yaml +++ b/jjb/lf-whitesource-jobs.yaml @@ -163,7 +163,7 @@ 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 index 00000000..936facfe --- /dev/null +++ b/releasenotes/notes/update-gerrit-trigger-comments-469ffad2c2d8770a.yaml @@ -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.