From: Anil Belur Date: Thu, 7 Mar 2019 18:04:32 +0000 (+1000) Subject: Optimize the jjb-deploy trigger regex X-Git-Tag: v0.34.0~8^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=c3128e6979246c6dadb83be4a14b5179b5d53721;p=releng%2Fglobal-jjb.git Optimize the jjb-deploy trigger regex Optimize the jjb-deploy trigger regex to trigger the job _only_ when the Gerrit CR comment is intended as a command. The `jjb-deploy` job presently gets triggered and is waste of infra resources when the keyword is intended as comment in Gerrit. Ref: https://git.opendaylight.org/gerrit/#/c/80358/ Issue: RELENG-1847 Change-Id: I3b35adb1284d3d9029ba025bf660b66fbb5d98e0 Signed-off-by: Anil Belur --- diff --git a/docs/jjb/lf-ci-jobs.rst b/docs/jjb/lf-ci-jobs.rst index a6d67c20..79c09296 100644 --- a/docs/jjb/lf-ci-jobs.rst +++ b/docs/jjb/lf-ci-jobs.rst @@ -369,6 +369,18 @@ This job checks out the current code review patch and then runs a .. note:: + The JJB Deploy Job is configured to trigger only if the Gerrit comment + starts with the `jjb-deploy` keyword. + + Example of a valid command in Gerrit comment that triggers the job: + + ``jjb-deploy builder-jjb-*`` + + Example of a invalid command in Gerrit comment that would _not_ trigger + the job: + + ``Update the job. jjb-deploy builder-jjb-*`` + JOB_NAME can include the * wildcard character to push multiple jobs matching the pattern. For example ``jjb-deploy builder-jjb-*`` will push all builder-jjb-* jobs to the sandbox system. diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index bdcd65ef..925ec4ed 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -598,7 +598,7 @@ submodule-timeout: 10 gerrit_jjb_deploy_job_triggers: - comment-added-contains-event: - comment-contains-value: 'jjb-deploy[:]* (?!\*+$).+$' + comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(jjb-deploy[:]* (?!\*+$).+$)' ##################### # Job Configuration # diff --git a/releasenotes/notes/optimize-jjb-deploy-regex-5ecc4287ecbc3317.yaml b/releasenotes/notes/optimize-jjb-deploy-regex-5ecc4287ecbc3317.yaml new file mode 100644 index 00000000..8511d72c --- /dev/null +++ b/releasenotes/notes/optimize-jjb-deploy-regex-5ecc4287ecbc3317.yaml @@ -0,0 +1,18 @@ +--- +fixes: + - | + The JJB Deploy Job is configured to trigger only if the Gerrit comment + starts with the `jjb-deploy` keyword. + + Without the regex being optimized the job triggers on any occurance + of the `jjb-deploy` keyword in a Gerrit comment, with is waste infra + resources. + + Example of a valid command in Gerrit comment that triggers the job: + + ``jjb-deploy builder-jjb-*`` + + Example of a invalid command in Gerrit comment that would _not_ trigger + the job: + + ``Update the job. jjb-deploy builder-jjb-*``