Merge "Optimize the jjb-deploy trigger regex"
authorBengt Thuree <bthuree@linuxfoundation.org>
Thu, 14 Mar 2019 02:12:38 +0000 (02:12 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Thu, 14 Mar 2019 02:12:38 +0000 (02:12 +0000)
docs/jjb/lf-ci-jobs.rst
jjb/lf-ci-jobs.yaml
releasenotes/notes/optimize-jjb-deploy-regex-5ecc4287ecbc3317.yaml [new file with mode: 0644]

index a6d67c2..79c0929 100644 (file)
@@ -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.
index bdcd65e..925ec4e 100644 (file)
     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 (file)
index 0000000..8511d72
--- /dev/null
@@ -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-*``