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

Change subject: Use --no-check-publish in php-composer-validate, create 
php-composer-package-validate
......................................................................


Use --no-check-publish in php-composer-validate, create 
php-composer-package-validate

For extensions and other things that want to use composer for development
dependencies and a test entry point, the php-composer-validate checks the
basic schema of the file.

For libraries that are published on packagist.org, the
php-composer-validate-package job has a few more checks against the schema.

Bug: T91176
Change-Id: Ib1305c8ee04a56ae7b1fecafbdba13945848c534
---
M jjb/defaults.yaml
M jjb/macro-scm.yaml
M jjb/php.yaml
M tests/test_zuul_layout.py
M zuul/layout.yaml
5 files changed, 69 insertions(+), 20 deletions(-)

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



diff --git a/jjb/defaults.yaml b/jjb/defaults.yaml
index cae4d76..5bc1304 100644
--- a/jjb/defaults.yaml
+++ b/jjb/defaults.yaml
@@ -104,6 +104,28 @@
       - timestamps
       - ansicolor
 
+- defaults:
+    name: use-remote-zuul-shallow-clone
+
+    description: |
+      <p>Job is managed by <a 
href="https://www.mediawiki.org/wiki/CI/JJB";>Jenkins Job Builder</a>.</p>
+      <p>This job is triggered by Zuul</p>
+
+    project-type: freestyle
+
+    logrotate:
+        daysToKeep: 30
+
+    scm:
+     - git-remote-zuul-shallow-clone
+
+    wrappers:
+      - timeout:
+          timeout: 30
+          fail: true
+      - timestamps
+      - ansicolor
+
 # Obsolete, should use Zuul cloner instead
 - defaults:
     name: use-zuul-for-mw-ext
diff --git a/jjb/macro-scm.yaml b/jjb/macro-scm.yaml
index 8d0b4d5..b933766 100644
--- a/jjb/macro-scm.yaml
+++ b/jjb/macro-scm.yaml
@@ -80,6 +80,18 @@
         clean: true
         disable-submodules: true
 
+- scm:
+    name: git-remote-zuul-shallow-clone
+    scm:
+     - git:
+        url: '$ZUUL_URL/$ZUUL_PROJECT'
+        branches:
+         - '$ZUUL_COMMIT'
+        refspec: '$ZUUL_REF'
+        wipe-workspace: true
+        shallow-clone: true
+
+
 # Wrapper around Zuul Cloner
 #
 # Fallback to the branch ZUUL_BRANCH.
diff --git a/jjb/php.yaml b/jjb/php.yaml
index d15c038..eb1342c 100644
--- a/jjb/php.yaml
+++ b/jjb/php.yaml
@@ -1,20 +1,12 @@
 # Generic Jobs related to PHP
 
+# Job for libraries that are published as composer packages.
+# Includes full validation that packagist.org requires.
 - job:
-    name: php-composer-validate
+    name: php-composer-package-validate
     node: contintLabsSlave && UbuntuPrecise
-    defaults: use-remote-zuul
+    defaults: use-remote-zuul-shallow-clone
     concurrent: true
-
-    # Clear workspace and use a shallow clone from Zuul
-    scm:
-     - git:
-        url: '$ZUUL_URL/$ZUUL_PROJECT'
-        branches:
-         - '$ZUUL_COMMIT'
-        refspec: '$ZUUL_REF'
-        wipe-workspace: true
-        shallow-clone: true
 
     triggers:
      - zuul
@@ -23,3 +15,19 @@
          /srv/deployment/integration/composer/vendor/bin/composer --ansi 
validate
     logrotate:
         daysToKeep: 15
+
+# Job for anything with a composer.json, but *isn't* going to be
+# published on packagist.org.
+- job:
+    name: php-composer-validate
+    node: contintLabsSlave && UbuntuPrecise
+    defaults: use-remote-zuul-shallow-clone
+    concurrent: true
+
+    triggers:
+     - zuul
+    builders:
+     - shell: |
+         /srv/deployment/integration/composer/vendor/bin/composer --ansi 
validate --no-check-publish
+    logrotate:
+        daysToKeep: 15
diff --git a/tests/test_zuul_layout.py b/tests/test_zuul_layout.py
index 601eaca..53c587c 100644
--- a/tests/test_zuul_layout.py
+++ b/tests/test_zuul_layout.py
@@ -128,7 +128,9 @@
                               'Project %s lacks %s pipeline' %
                               (mw_project, pipeline))
                 self.assertTrue(
-                    ('php-composer-validate' in project_def[pipeline]) or any(
+                    ('php-composer-validate' in project_def[pipeline]) or
+                    ('php-composer-package-validate' in
+                     project_def[pipeline]) or any(
                         [job for job in project_def[pipeline]
                             if job.endswith('-composer')]),
                     'Project %s pipeline %s must have either '
@@ -182,6 +184,7 @@
             '.*-whitespaces',
             'noop',
             'php-composer-validate',
+            'php-composer-package-validate',
         ]
         safe_jobs_re = re.compile('^(' + '|'.join(safe_jobs) + ')$')
 
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 890a42a..296438b 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -396,6 +396,10 @@
     files:
      - '^composer.json$'
 
+  - name: ^php-composer-package-validate$
+    files:
+     - '^composer.json$'
+
   - name: ^.*-phpcs(-HEAD)?$
     voting: false
     files:
@@ -1894,7 +1898,7 @@
       - mediawiki-core-jslint
       - mediawiki-core-phplint
       - mediawiki-core-ruby1.9.3lint
-      - php-composer-validate
+      - php-composer-package-validate
     test:
       - mediawiki-core-phpcs-HEAD
       - mediawiki-core-jsduck
@@ -1908,7 +1912,7 @@
         - mediawiki-core-qunit-karma
       - mediawiki-core-bundle-rubocop
       - mediawiki-core-ruby1.9.3lint
-      - php-composer-validate
+      - php-composer-package-validate
     gate-and-submit:
     # Non voting jobs are commented out
 #      - mediawiki-core-phpcs-HEAD
@@ -1923,7 +1927,7 @@
         - mediawiki-core-qunit
       - mediawiki-core-bundle-rubocop
       - mediawiki-core-ruby1.9.3lint
-      - php-composer-validate
+      - php-composer-package-validate
     postmerge:
       - mediawiki-core-jsduck-publish
       - mediawiki-core-doxygen-publish
@@ -2328,7 +2332,7 @@
   - name: mediawiki/tools/codesniffer
     check:
      - mw-tools-codesniffer-phplint
-     - php-composer-validate
+     - php-composer-package-validate
     test:
      - mw-tools-codesniffer-composer-zend
      - mw-tools-codesniffer-composer-hhvm
@@ -6101,7 +6105,7 @@
   - name: cdb
     check:
      - cdb-phplint
-     - php-composer-validate
+     - php-composer-package-validate
     test:
      - cdb-composer-hhvm
      - cdb-composer-zend
@@ -6112,7 +6116,7 @@
   - name: utfnormal
     check:
      - utfnormal-phplint
-     - php-composer-validate
+     - php-composer-package-validate
     test:
      - utfnormal-composer-hhvm
      # Zend is pretty slow so only test it on gate
@@ -6164,7 +6168,7 @@
       - oojs-ui-jslint
       - oojs-ui-phplint
       - oojs-ui-ruby2.0lint
-      - php-composer-validate
+      - php-composer-package-validate
     test:
       - oojs-ui-bundle-rubocop
       - oojs-ui-npm

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1305c8ee04a56ae7b1fecafbdba13945848c534
Gerrit-PatchSet: 5
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[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