jenkins-bot has submitted this change and it was merged.

Change subject: check pipelines should only have lint jobs
......................................................................


check pipelines should only have lint jobs

Remove from check, check-voter, check-only pipelines any job that are
executing code.
Add test to ensure the pipelines only have jobs listed in a whitelist.

Change-Id: I9b0e575d061f55406a720ebe77318879ab3578f5
---
M tests/test_zuul_layout.py
M zuul/layout.yaml
2 files changed, 71 insertions(+), 37 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/test_zuul_layout.py b/tests/test_zuul_layout.py
index 50c1719..9eaceeb 100644
--- a/tests/test_zuul_layout.py
+++ b/tests/test_zuul_layout.py
@@ -161,3 +161,41 @@
         self.assertTrue(rel_job.changeMatches(ref))
         ref.ref = 'refs/tags/2.0'
         self.assertTrue(rel_job.changeMatches(ref))
+
+    def test_valid_jobs_in_check_pipelines(self):
+        check_pipelines = [p.name for p in self.getPipelines()
+                           if p.name.startswith('check')]
+
+        # Uniq list of projects having a check* pipeline defined
+        actual = {}
+        # List of jobs allowed in check* pipelines
+        safe_jobs = [
+            '.*-(js|php|perl|shell|yaml|)lint',
+            '.*-(pp|erb)lint-HEAD',
+            '.*-(tabs|typos)',
+            '.*-pep8',
+            '.*-phpcs(-lenient|-strict|)-HEAD',
+            '.*-puppet-validate',
+            '.*-puppetlint-(strict|lenient)',
+            '.*-pyflakes',
+            '.*-ruby(2\.0|1\.9\.3)lint',
+            '.*-whitespaces',
+            'noop',
+            'php-composer-validate',
+        ]
+        safe_jobs_re = re.compile('^(' + '|'.join(safe_jobs) + ')$')
+
+        for check_pipeline in check_pipelines:
+            actual[check_pipeline] = {}
+            for project in self.getPipelineProjectsNames(check_pipeline):
+                jobs = self.getProjectDef(project)[check_pipeline]
+                unsafe_jobs = [j for j in jobs
+                               if not re.match(safe_jobs_re, j)]
+                if unsafe_jobs:
+                    actual[check_pipeline][project] = unsafe_jobs
+
+        self.maxDiff = None
+
+        # We expect check pipelines to have no unsafe jobs
+        expected = {k: {} for k in check_pipelines}
+        self.assertEquals(expected, actual)
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index e7bcf86..8085435 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1623,10 +1623,6 @@
   - name: 'mediawiki-ruby-api-bundle-yard-publish'
     branch: ^master$
 
-  # FIXME: work in progress
-  - name: sartoris-sphinx-doc
-    voting: false
-
   - name: mediawiki-core-jslint
     # Doesn't work in MediaWiki REL1_19 (bug 44846)
     branch: (?!REL1_19)
@@ -1739,8 +1735,6 @@
 
   - name: wikimedia-fundraising-tools-yamllint
     voting: false
-  - name: wikimedia-fundraising-SmashPig-sphinx-doc
-    voting: false
 
 
 project-templates:
@@ -1832,11 +1826,9 @@
     check-voter:
       - '{prefix}-pep8'
       - '{prefix}-pyflakes'
-      - '{prefix}-sphinx-doc'
     gate-and-submit:
       - '{prefix}-pep8'
       - '{prefix}-pyflakes'
-      - '{prefix}-sphinx-doc'
 
   - name: python-lint
     check-voter:
@@ -1865,7 +1857,6 @@
   # Run Ruby linter.
   - name: extension-rubylint
     check:
-     - 'mwext-{name}-bundle-rubocop'
      - 'mwext-{name}-ruby1.9.3lint'
     test:
      - 'mwext-{name}-bundle-rubocop'
@@ -1881,8 +1872,7 @@
 
   - name: integration/config
     check:
-      - integration-zuul-layoutdiff
-      - integration-zuul-layoutvalidation
+      - noop
     test:
       - integration-config-tox-flake8
       - integration-config-tox-py27
@@ -2004,7 +1994,7 @@
         prefix: 'analytics-asana-stats'
 
   - name: analytics/aggregator
-    check-voter:
+    test:
      - analytics-aggregator-tox-flake8
      - analytics-aggregator-tox-flake8-bin
      - analytics-aggregator-tox-py27
@@ -2014,7 +2004,7 @@
      - analytics-aggregator-tox-py27
 
   - name: analytics/blog
-    check-voter:
+    test:
      - analytics-blog-tox-flake8
      - analytics-blog-tox-py27
     gate-and-submit:
@@ -2022,7 +2012,7 @@
      - analytics-blog-tox-py27
 
   - name: analytics/geowiki
-    check-voter:
+    test:
      - analytics-geowiki-tox-flake8
     gate-and-submit:
      - analytics-geowiki-tox-flake8
@@ -2038,7 +2028,7 @@
         prefix: 'analytics-glass'
 
   - name: analytics/quarry/web
-    check-voter:
+    test:
       - analytics-quarry-web-tox-flake8
     gate-and-submit:
       - analytics-quarry-web-tox-flake8
@@ -2061,19 +2051,19 @@
      - analytics-libanon
 
   - name: analytics/limn-mobile-data
-    check-voter:
+    test:
      - analytics-limn-mobile-data-tox-flake8
     gate-and-submit:
      - analytics-limn-mobile-data-tox-flake8
 
   - name: analytics/limn-language-data
-    check-voter:
+    test:
      - analytics-limn-language-data-tox-flake8
     gate-and-submit:
      - analytics-limn-language-data-tox-flake8
 
   - name: analytics/multimedia
-    check-voter:
+    test:
      - analytics-multimedia-tox-flake8
     gate-and-submit:
      - analytics-multimedia-tox-flake8
@@ -2103,13 +2093,13 @@
      - analytics-wikistats
 
   - name: analytics/wikimetrics
-    check-voter:
+    test:
      - analytics-wikimetrics-tox-flake8
     gate-and-submit:
      - analytics-wikimetrics-tox-flake8
 
   - name: analytics/wp-zero
-    check-voter:
+    test:
      - analytics-wp-zero-tox-flake8
     gate-and-submit:
      - analytics-wp-zero-tox-flake8
@@ -2121,7 +2111,9 @@
       - apps-android-commons-build
 
   - name: apps/android/wikipedia
-    check-voter:
+    check:
+      - apps-android-wikipedia-jslint
+    test:
       - apps-android-wikipedia-jslint
       - apps-android-wikipedia-tox-flake8
       - apps-android-wikipedia-maven-checkstyle
@@ -2184,7 +2176,7 @@
      - labs-tools-grrrit-yamllint
 
   - name: labs/tools/wikibugs2
-    check-voter:
+    test:
      - labs-tools-wikibugs2-tox-channels-trusty
      - labs-tools-wikibugs2-tox-flake8-trusty
     gate-and-submit:
@@ -2610,13 +2602,13 @@
       - operations-software-pyflakes
 
   - name: operations/software/ircyall
-    check-voter:
+    test:
       - operations-software-ircyall-tox-flake8-trusty
     gate-and-submit:
       - operations-software-ircyall-tox-flake8-trusty
 
   - name: operations/software/labsdb-auditor
-    check-voter:
+    test:
       - operations-software-labsdb-auditor-tox-flake8-trusty
     gate-and-submit:
       - operations-software-labsdb-auditor-tox-flake8-trusty
@@ -2648,7 +2640,9 @@
       - wikimedia-bugzilla-wikibugs-perllint
 
   - name: wikimedia/fundraising/dash
-    check-voter:
+    check:
+      - wikimedia-fundraising-dash-jslint
+    test:
       - wikimedia-fundraising-dash-jslint
       - wikimedia-fundraising-dash-npm
     gate-and-submit:
@@ -2715,10 +2709,8 @@
        prefix: 'wikimedia-fundraising-SmashPig'
     check-voter:
       - wikimedia-fundraising-SmashPig-phplint
-      - wikimedia-fundraising-SmashPig-sphinx-doc
     gate-and-submit:
       - wikimedia-fundraising-SmashPig-phplint
-      - wikimedia-fundraising-SmashPig-sphinx-doc
 
   - name: wikimedia/iegreview
     check:
@@ -3041,7 +3033,14 @@
       - mwext-ConfirmEdit-pyflakes
 
   - name: mediawiki/extensions/ContentTranslation
-    check-only:
+    check:
+      - mwext-ContentTranslation-phpcs-strict-HEAD # Experiment, bug 48420
+      - mwext-ContentTranslation-jslint
+      - mwext-ContentTranslation-lint
+      - mwext-ContentTranslation-ruby1.9.3lint
+      - mwext-ContentTranslation-yamllint
+      - php-composer-validate
+    test:
       - mwext-ContentTranslation-phpcs-strict-HEAD # Experiment, bug 48420
       - mwext-ContentTranslation-jslint
       - mwext-ContentTranslation-lint
@@ -3220,9 +3219,6 @@
     template:
       - name: extension-unittests
       - name: extension-qunit
-    check:
-      - mwext-EventLogging-tox-flake8
-      - mwext-EventLogging-tox-flake8-bin
     test:
       - mwext-EventLogging-tox-flake8
       - mwext-EventLogging-tox-flake8-bin
@@ -3562,7 +3558,6 @@
     check:
       - mwext-MultimediaViewer-lint
       - mwext-MultimediaViewer-jslint
-      - mwext-MultimediaViewer-doc-test
       - php-composer-validate
     test:
       - mwext-MultimediaViewer-lint
@@ -5184,7 +5179,7 @@
 # End of new currently disabled extensions checks from mass extension import - 
Addshore
 
   - name: mediawiki/services/cxserver
-    check-voter:
+    test:
       - cxserver-npm
     gate-and-submit:
       - cxserver-npm
@@ -5192,7 +5187,7 @@
       - beta-cxserver-update-eqiad
 
   - name: mediawiki/services/cxserver/deploy
-    check-voter:
+    test:
       - cxserver-npm
     gate-and-submit:
       - cxserver-npm
@@ -6046,7 +6041,9 @@
         prefix: 'pywikibot-compat'
 
   - name: pywikibot/core
-    check-voter:
+    check:
+      - noop
+    test:
       - 'pywikibot-core-tox-flake8'
       - 'pywikibot-core-tox-flake8-docstrings'
       - 'pywikibot-core-tox-flake8-docstrings-mandatory'
@@ -6160,7 +6157,6 @@
   - name: VisualEditor/VisualEditor
     check:
       - VisualEditor-jslint
-      - VisualEditor-bundle-rubocop
       - VisualEditor-ruby1.9.3lint
     test:
       - VisualEditor-npm
@@ -6180,7 +6176,7 @@
       - wikidata-gremlin
 
   - name: wikimedia/bots/jouncebot
-    check-voter:
+    test:
       - wikimedia-bots-jouncebot-tox-flake8
       - wikimedia-bots-jouncebot-yamllint
     gate-and-submit:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b0e575d061f55406a720ebe77318879ab3578f5
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to