Thcipriani has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351131 )

Change subject: Create SWAT gate and submit pipeline
......................................................................

Create SWAT gate and submit pipeline

This creates a new pipeline for wmf branches. Using branch regular
expressions with a negative lookahead allows you to duplicate the
gate and submit pipeline for all job templates and if the change is
being made to a wmf branch, then have that change be handled in a
different pipeline. This ensures that during SWAT changes to wmf
branches will fall into the gate-and-submit-swat pipeline while still
allowing changes to run as normal on the gate-and-submit pipeline.

Bug: T160668

Change-Id: I7f1ececaef4acf5729c8f3d9ba93c0617f27ca0c
---
M tests/test_zuul_scheduler.py
M zuul/layout.yaml
2 files changed, 81 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/31/351131/1

diff --git a/tests/test_zuul_scheduler.py b/tests/test_zuul_scheduler.py
index b41aa54..926bf31 100644
--- a/tests/test_zuul_scheduler.py
+++ b/tests/test_zuul_scheduler.py
@@ -343,6 +343,23 @@
         self.assertEquals(expected, actual,
                           "No project have unsafe jobs in check* pipelines")
 
+    def test_gate_and_submit_swat(self):
+        gs_swat_manager = self.getPipeline('gate-and-submit-swat').manager
+        gs_manager = self.getPipeline('gate-and-submit').manager
+
+        change = zuul.model.Change('mediawiki/core')
+        change.branch = 'wmf/1.29.0-wmf.20'
+
+        event = zuul.model.TriggerEvent()
+        event.type = 'comment-added'
+        event.comment = 'Patch Set 1: Code-Review+2'
+        event.branch = change.branch
+        event.approvals = [{
+            'description': 'Code-Review', 'type': 'CRVW', 'value': '2'}]
+
+        self.assertTrue(gs_swat_manager.eventMatches(event, change))
+        self.assertFalse(gs_manager.eventMatches(event, change))
+
     def test_recheck_comment_trusted_user(self):
         test_manager = self.getPipeline('test').manager
 
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 1cb74ce..9576270 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -559,7 +559,8 @@
   #
   # WARNING: Also update the "gate" pipeline when changing this one.
   #
-  - name: gate-and-submit
+  - &gate_and_submit_pipeline
+    name: gate-and-submit
     description: >
       Patchsets that have been reviewed. Will be merged by Jenkins if tests 
pass.
     manager: DependentPipelineManager
@@ -570,7 +571,8 @@
     trigger:
       gerrit:
         - event: comment-added
-          branch: (?!^refs/meta/config)
+          branch:
+           - (?!^(refs/meta/config|wmf/\d\.\d{2}\.\d-wmf\.\d{1,2}))
           email:
            - ^(?!l10n-bot@translatewiki\.net).*$
           approval:
@@ -588,6 +590,17 @@
     failure:
       gerrit:
         verified: -1
+
+  - !!merge : *gate_and_submit_pipeline
+    name: gate-and-submit-swat
+    trigger:
+      gerrit:
+        - event: comment-added
+          branch: wmf/\d\.\d{2}\.\d-wmf\.\d{1,2}
+          email:
+           - ^(?!l10n-bot@translatewiki\.net).*$
+          approval:
+            - code-review: 2
 
   - name: postmerge
     description: Jobs triggered after a change has been merged.
@@ -889,10 +902,11 @@
      - mwext-testextension-hhvm-composer-jessie
     php5:
      - mwext-testextension-php55-composer-trusty
-    gate-and-submit:
+    gate-and-submit: &extension-unittests-composer-gate-and-submit
      - mwgate-php55lint
      - mwext-testextension-php55-composer-trusty
      - mwext-testextension-hhvm-composer-jessie
+    gate-and-submit-swat: *extension-unittests-composer-gate-and-submit
     experimental:
      - mwext-qunit-composer-jessie
      - mwgate-npm-node-6-jessie
@@ -911,8 +925,11 @@
     php5:
      - mwext-testextension-php55-composer-trusty-non-voting
     gate-and-submit:
+     &extension-unittests-composer-non-voting-gate-and-submit
      - mwgate-php55lint
      - mwgate-composer-validate
+    gate-and-submit-swat:
+     *extension-unittests-composer-non-voting-gate-and-submit
     experimental:
      - mwext-qunit-composer-jessie
      - mwgate-composer-hhvm-jessie
@@ -930,12 +947,13 @@
      - mwgate-composer-validate
     php5:
      - mwext-testextension-php55-trusty
-    gate-and-submit:
+    gate-and-submit: &extension-unittests-generic-gate-and-submit
      - mwgate-php55lint
      # Extensions tests with core+vendor
      - mwext-testextension-php55-trusty
      - mwext-testextension-hhvm-jessie
      - mwgate-composer-validate
+    gate-and-submit-swat: *extension-unittests-generic-gate-and-submit
     experimental:
       - mediawiki-extensions-hhvm-jessie
       - mediawiki-extensions-qunit-jessie
@@ -956,10 +974,11 @@
      - mwgate-composer-validate
     php5:
      - mwext-testextension-php55-trusty-non-voting
-    gate-and-submit:
+    gate-and-submit: &extension-unittests-non-voting-gate-and-submit
      - noop
      - mwgate-php55lint
      - mwgate-composer-validate
+    gate-and-submit-swat: *extension-unittests-non-voting-gate-and-submit
     experimental:
       - mediawiki-extensions-hhvm-jessie
       - mediawiki-extensions-qunit-jessie
@@ -979,8 +998,9 @@
   - name: extension-selenium-gate
     test:
       - mwext-mw-selenium-jessie
-    gate-and-submit:
+    gate-and-submit: &extension-selenium-gate-gate-and-submit
       - mwext-mw-selenium-jessie
+    gate-and-submit-swat: *extension-selenium-gate-gate-and-submit
 
   - name: extension-gate
     test:
@@ -988,45 +1008,51 @@
       - mediawiki-extensions-qunit-jessie
     php5:
       - mediawiki-extensions-php55-trusty
-    gate-and-submit:
+    gate-and-submit: &extension-gate-gate-and-submit
       - mediawiki-extensions-hhvm-jessie
       - mediawiki-extensions-php55-trusty
       - mediawiki-extensions-qunit-jessie
+    gate-and-submit-swat: *extension-gate-gate-and-submit
 
   - name: extension-phan-generic
     test:
      - mwext-php70-phan-jessie
-    gate-and-submit:
+    gate-and-submit: &extension-phan-generic
      - mwext-php70-phan-jessie
+    gate-and-submit-swat: *extension-phan-generic
 
   # Template for MediaWiki extensions.
   # Triggers qunit jobs
   - name: extension-qunit
     test:
       - 'mwext-{name}-qunit'
-    gate-and-submit:
+    gate-and-submit: &extension-qunit-gate-and-submit
       - 'mwext-{name}-qunit'
+    gate-and-submit-swat: *extension-qunit-gate-and-submit
 
   # Triggers the generic mwext-qunit job
   - name: extension-qunit-generic
     test:
       - mwext-qunit-jessie
-    gate-and-submit:
+    gate-and-submit: &extension-qunit-generic
       - mwext-qunit-jessie
+    gate-and-submit-swat: *extension-qunit-generic
     experimental:
       - mwext-qunit-composer-jessie
 
   - name: extension-qunit-composer
     test:
       - mwext-qunit-composer-jessie
-    gate-and-submit:
+    gate-and-submit: &extension-qunit-composer-gate-and-submit
       - mwext-qunit-composer-jessie
+    gate-and-submit-swat: *extension-qunit-composer-gate-and-submit
 
   - name: skin-tests
     test:
       - mw-testskin
-    gate-and-submit:
+    gate-and-submit: &skin-tests-gate-and-submit
       - mw-testskin
+    gate-and-submit-swat: *skin-tests-gate-and-submit
 
   - name: skin-tests-non-voting
     test:
@@ -1051,9 +1077,10 @@
     test:
      - mwgate-php55lint
      - mwgate-composer-validate
-    gate-and-submit:
+    gate-and-submit: &mw-checks-test-gate-and-submit
      - mwgate-php55lint
      - mwgate-composer-validate
+    gate-and-submit-swat: *mw-checks-test-gate-and-submit
     experimental:
      - mwgate-npm-node-6-jessie
      - mwgate-composer-hhvm-jessie
@@ -1067,9 +1094,10 @@
     test:
       - composer-php55-trusty
       - composer-hhvm-jessie
-    gate-and-submit:
+    gate-and-submit: &composer-test-gate-and-submit
       - composer-php55-trusty
       - composer-hhvm-jessie
+    gate-and-submit-swat: *composer-test-gate-and-submit
     experimental:
       - composer-php70-jessie
 
@@ -1080,19 +1108,21 @@
     test:
       - mwgate-composer-php55-trusty
       - mwgate-composer-hhvm-jessie
-    gate-and-submit:
+    gate-and-submit: &mwgate-composer-gate-and-submit
       - mwgate-composer-php55-trusty
       - mwgate-composer-hhvm-jessie
     experimental:
       - mwgate-composer-php70-jessie
+    gate-and-submit-swat: *mwgate-composer-gate-and-submit
 
   - name: php55lint
     check:
       - php55lint
     test:
       - php55lint
-    gate-and-submit:
+    gate-and-submit: &php55lint-gate-and-submit
       - php55lint
+    gate-and-submit-swat: *php55lint-gate-and-submit
 
   - name: composer-test-package
     check:
@@ -1110,8 +1140,9 @@
   - name: npm
     test:
       - npm-node-6-jessie
-    gate-and-submit:
+    gate-and-submit: &npm-gate-and-submit
       - npm-node-6-jessie
+    gate-and-submit-swat: *npm-gate-and-submit
 
   - name: mwgate-npm
     test:
@@ -1122,8 +1153,9 @@
   - name: rake
     test:
       - rake-jessie
-    gate-and-submit:
+    gate-and-submit: &rake-gate-and-submit
       - rake-jessie
+    gate-and-submit-swat: *rake-gate-and-submit
 
   - name: mwgate-rake
     test:
@@ -1279,7 +1311,7 @@
     php5:
       # Comment "check php5" to manually run this
       - mediawiki-phpunit-php55-trusty
-    gate-and-submit:
+    gate-and-submit: &mediawiki-core-gate-and-submit
       - mediawiki-core-jsduck
       - mediawiki-core-npm-node-6-jessie
       - mediawiki-core-php55lint
@@ -1290,6 +1322,7 @@
       - mediawiki-core-qunit-selenium-jessie
       - composer-package-validate
       - mediawiki-core-php70-phan-jessie
+    gate-and-submit-swat: *mediawiki-core-gate-and-submit
     postmerge:
       - mediawiki-core-jsduck-publish
       - mediawiki-core-doxygen-publish
@@ -1322,12 +1355,13 @@
       - mediawiki-phpunit-hhvm-jessie
     php5:
       - mediawiki-phpunit-php55-trusty
-    gate-and-submit:
+    gate-and-submit: &mediawiki-vendor-gate-and-submit
       - mwgate-php55lint
       - mediawiki-phpunit-hhvm-jessie
       - mediawiki-phpunit-php55-trusty
       - mediawiki-core-qunit-selenium-jessie
       - mwgate-composer-validate
+    gate-and-submit-swat: *mediawiki-vendor-gate-and-submit
     experimental:
       - mwgate-composer-hhvm-jessie
       - mwgate-composer-php55-trusty
@@ -1831,8 +1865,9 @@
      - name: skin-tests
     test:
      - mediawiki-core-qunit-selenium-jessie
-    gate-and-submit:
+    gate-and-submit: &mediawiki-skins-vector-gate-and-submit
      - mediawiki-core-qunit-selenium-jessie
+    gate-and-submit-swat: *mediawiki-skins-vector-gate-and-submit
 
   - name: mediawiki/skins/VectorV2
     template:
@@ -6483,8 +6518,9 @@
       - name: mwgate-npm
     test:
       - mwext-PoolCounter-build-jessie
-    gate-and-submit:
+    gate-and-submit: &mediawiki-extensions-poolcounter-gate-and-submit
       - mwext-PoolCounter-build-jessie
+    gate-and-submit-swat: *mediawiki-extensions-poolcounter-gate-and-submit
 
   - name: mediawiki/extensions/Popups
     template:
@@ -6939,9 +6975,10 @@
     test:
       - mwext-VisualEditor-npm-node-6-jessie
       - mwext-VisualEditor-jsduck
-    gate-and-submit:
+    gate-and-submit: &mediawiki-extensions-visualeditor-gate-and-submit
       - mwext-VisualEditor-npm-node-6-jessie
       - mwext-VisualEditor-jsduck
+    gate-and-submit-swat: *mediawiki-extensions-visualeditor-gate-and-submit
     postmerge:
       - mwext-VisualEditor-publish
 
@@ -6979,7 +7016,7 @@
       - mwext-Wikibase-repo-tests-sqlite-hhvm-jessie
       - mwext-Wikibase-client-tests-mysql-hhvm-jessie
       - mwext-Wikibase-client-tests-sqlite-hhvm-jessie
-    gate-and-submit:
+    gate-and-submit: &mediawiki-extensions-wikibase-gate-and-submit
       - mwext-mw-selenium-composer-jessie
       - mwext-Wikibase-repo-tests-sqlite-php55-trusty
       - mwext-Wikibase-repo-tests-sqlite-hhvm-jessie
@@ -6987,6 +7024,7 @@
       - mwext-Wikibase-client-tests-sqlite-php55-trusty
       - mwext-Wikibase-client-tests-mysql-hhvm-jessie
       - mwext-Wikibase-client-tests-sqlite-hhvm-jessie
+    gate-and-submit-swat: *mediawiki-extensions-wikibase-gate-and-submit
     experimental:
       - mwext-php70-phan-jessie
     postmerge:
@@ -7007,8 +7045,9 @@
       - name: extension-gate
     test:
       - mwext-testextension-hhvm-jessie
-    gate-and-submit:
+    gate-and-submit: &mediawiki-extensions-wikidata-gate-and-submit
       - mwext-testextension-hhvm-jessie
+    gate-and-submit-swat: *mediawiki-extensions-wikidata-gate-and-submit
 
   - name: mediawiki/extensions/Wikidata.org
     template:

-- 
To view, visit https://gerrit.wikimedia.org/r/351131
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f1ececaef4acf5729c8f3d9ba93c0617f27ca0c
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Thcipriani <tcipri...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to