[openstack-dev] [infra][all] New Zuul Depends-On syntax

Ben Nemec openstack at nemebean.com
Thu Jan 25 20:55:35 UTC 2018



On 01/24/2018 02:31 PM, Monty Taylor wrote:
> On 01/24/2018 02:25 PM, David Shrewsbury wrote:
>> This is a (the?) killer feature.
>>
>>
>> On Wed, Jan 24, 2018 at 11:33 AM, James E. Blair <corvus at inaugust.com 
>> <mailto:corvus at inaugust.com>> wrote:
>>
>>     Hi,
>>
>>     We recently introduced a new URL-based syntax for Depends-On: footers
>>     in commit messages:
>>
>>        Depends-On: https://review.openstack.org/535851
>>     <https://review.openstack.org/535851>
>>
>>     The old syntax will continue to work for a while, but please begin 
>> using
>>     the new syntax on new changes.
>>
>>     Why are we changing this?  Zuul has grown the ability to interact 
>> with
>>     multiple backend systems (Gerrit, GitHub, and plain Git so far), 
>> and we
>>     have extended the cross-repo-dependency feature to support multiple
>>     systems.  But Gerrit is the only one that uses the change-id syntax.
>>     URLs, on the other hand, are universal.
>>
>>     That means you can write, as in https://review.openstack.org/535541
>>     <https://review.openstack.org/535541>, a
>>     commit message such as:
>>
>>        Depends-On:
>>     https://github.com/ikalnytskyi/sphinxcontrib-openapi/pull/17
>>     <https://github.com/ikalnytskyi/sphinxcontrib-openapi/pull/17>
>>
>>     Or in a Github pull request like
>>     https://github.com/ansible/ansible/pull/20974
>>     <https://github.com/ansible/ansible/pull/20974>, you can write:
>>
>>        Depends-On: https://review.openstack.org/536159
>>     <https://review.openstack.org/536159>
>>
>>     But we're getting a bit ahead of ourselves here -- we're just getting
>>     started with Gerrit <-> GitHub dependencies and we haven't worked
>>     everything out yet.  While you can Depends-On any GitHub URL, you 
>> can't
>>     add any project to required-projects yet, and we need to establish a
>>     process to actually report on GitHub projects.  But cool things are
>>     coming.
>>
>>     We will continue to support the Gerrit-specific syntax for a while,
>>     probably for several months at least, so you don't need to update the
>>     commit messages of changes that have accumulated precious +2s.  
>> But do
>>     please start using the new syntax now, so that we can age the old 
>> syntax
>>     out.
>>
>>     There are a few differences in using the new syntax:
>>
>>     * Rather than copying the change-id from a commit message, you'll 
>> need
>>        to get the URL from Gerrit.  That means the dependent change 
>> already
>>        needs to be uploaded.  In some complex situations, this may 
>> mean that
>>        you need to amend an existing commit message to add in the URL 
>> later.
>>
>>        If you're uploading both changes, Gerrit will output the URL 
>> when you
>>        run git-review, and you can copy it from there.  If you are
>>     looking at
>>        an existing change in Gerrit, you can copy the URL from the 
>> permalink
>>        at the top left of the page.  Where it says "Change 535855 - Needs
>>        ..." the change number itself is the permalink of the change.
>>
>>
>>
>> Is the permalink the only valid format here for gerrit? Or does the fully
>> expanded link also work. E.g.,
>>
>>     Depends-On: https://review.openstack.org/536540
>>
>> versus
>>
>>     Depends-On: https://review.openstack.org/#/c/536540/
> 
> The fully expanded one works too. See:
> 
>    https://review.openstack.org/#/c/520812/
> 
> for an example of a patch with expanded links.

I'm curious what this means as far as best practices for inter-patch 
references.  In the past my understanding was the the change id was 
preferred, both because if gerrit changed its URL format the change id 
links would be updated appropriately, and also because change ids can be 
looked up offline in git commit messages.  Would that still be the case 
for everything except depends-on now?



More information about the OpenStack-dev mailing list