<div dir="ltr"><div>Forwarding to QA list, in case somebody is subscribed to wikitech-l.<br><br></div>Željko<br><div><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Antoine Musso</b> <span dir="ltr"><<a href="mailto:hashar%2Bwmf@free.fr">hashar+wmf@free.fr</a>></span><br>Date: Thu, Nov 19, 2015 at 2:19 PM<br>Subject: [Wikitech-l] CI and cross repository dependencies<br>To: <a href="mailto:wikitech-l@lists.wikimedia.org">wikitech-l@lists.wikimedia.org</a><br><br><br>Hello,<br>
<br>
We often have the case of a change to an extension depending on a<br>
pending patch to MediaWiki core.  I have upgraded our CI scheduler -<br>
Zuul - a couple weeks ago and it now supports marking dependencies even<br>
in different repositories.<br>
<br>
<br>
Why does it matter?  To make sure the dependency is fulfilled one<br>
usually either:<br>
<br>
* CR-2 the patch until dependent change is merged<br>
* write a test that exercise the required patch in MediaWiki.<br>
<br>
With the first solution (lack of test), once both are merged, nothing<br>
prevent one from cherry picking a patch without its dependent patch.<br>
For example for MediaWiki minor releases or Wikimedia deployment branches.<br>
<br>
When a test covers the dependency, it will fail until the dependent one<br>
is merged which is rather annoying.<br>
<br>
<br>
Zuul now recognizes the header 'Depends-On' in git messages, similar to<br>
'Change-Id' and 'Bug'.  'Depends-On' takes as parameter a change-id and<br>
multiple ones can be added.<br>
<br>
When a patch is proposed in Gerrit, Zuul looks for Gerrit changes<br>
matching the 'Depends-On' and verify whether any are still open. In such<br>
a case, it will craft references for the open patches so all the<br>
dependencies can be tested as if they got merged.<br>
<br>
<br>
Real world example<br>
------------------<br>
<br>
The ContentTranslation extension is tested with the Wikidata one and was<br>
not passing the test.  Wikidata created a patch and we did not want to<br>
merge it until we confirm the ContentTranslation one is passing properly.<br>
<br>
The Wikidata patch is <a href="https://gerrit.wikimedia.org/r/#/c/252227/" rel="noreferrer" target="_blank">https://gerrit.wikimedia.org/r/#/c/252227/</a><br>
Change-Id: I0312c23628d706deb507b5534b868480945b6163<br>
<br>
On ContentTranslation we indicated the dependency:<br>
<a href="https://gerrit.wikimedia.org/r/#/c/252172/1..2//COMMIT_MSG" rel="noreferrer" target="_blank">https://gerrit.wikimedia.org/r/#/c/252172/1..2//COMMIT_MSG</a><br>
+ Depends-On: I0312c23628d706deb507b5534b868480945b6163<br>
<br>
Which is the Wikidata patch.<br>
<br>
<br>
Zuul:<br>
* received the patch for ContentTranslation<br>
* looked up the change-id and found the Wikidata<br>
* created git references in both repo to point to the proper patches<br>
<br>
Jenkins:<br>
* zuul-cloner cloned both repos and fetched the references created by<br>
the Zuul service<br>
* run tests<br>
* SUCCESS<br>
<br>
That confirmed us the Wikidata patch was actually fixing the issue for<br>
ContentTranslation. Hence we CR+2 both and all merged fine.<br>
<br>
<br>
Please take a moment to read upstream documentation:<br>
<br>
<a href="http://docs.openstack.org/infra/zuul/gating.html#cross-repository-dependencies" rel="noreferrer" target="_blank">http://docs.openstack.org/infra/zuul/gating.html#cross-repository-dependencies</a><br>
<br>
Wikidata/ContentTranslation task:<br>
<a href="https://phabricator.wikimedia.org/T118263" rel="noreferrer" target="_blank">https://phabricator.wikimedia.org/T118263</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Antoine "hashar" Musso<br>
<br>
<br>
_______________________________________________<br>
Wikitech-l mailing list<br>
<a href="mailto:Wikitech-l@lists.wikimedia.org">Wikitech-l@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/wikitech-l" rel="noreferrer" target="_blank">https://lists.wikimedia.org/mailman/listinfo/wikitech-l</a></font></span></div><br></div></div></div>