[openstack-dev] [Infra][all] Synchronizing local Git and Gerrit repositories

Dolph Mathews dolph.mathews at gmail.com
Wed Oct 29 13:14:12 UTC 2014


On Wed, Oct 29, 2014 at 4:20 AM, Ondrej Wisniewski <
ondrej.wisniewski at dektech.com.au> wrote:

>  Hi Ricardo,
>
> thanks a lot for your help and detailed instructions. It will surely come
> in handy when I will need to do something like that. I am looking also into
> this possibility.
>
> But the actual reason I need to sync our central developer repo with the
> Gerrit repo is a problem when the developer tries to submit code for review
> to Gerrit. Since the central developer repo is periodically updated from
> upstream and the developers pull these changes into their own local repos
> before branching off the feature branch, then this feature branch contains
> commits from upstream that Gerrit doesn't know about. So submitting this
> feature branch to code review will include lots of commits which are not
> the developers.
>
> I have now solved this issue by granting each developer the right to push
> the master branch to refs/heads/master in the Gerrit repo. This makes sure
> that the Gerrit repos master branch is updated with the latest commits and
> when the developer submits his feature branch for review, only his own
> commits will be reviewed.
>

I've been following the conversation, probably like many others, wondering
why in the world you need such a complicated, high-maintenance workflow?
What's the use case? Why can't your developers use review.openstack.org? In
your first email, you used the phrase "trying to set up an OpenStack
development workflow in our company" but what you're building is not an
OpenStack development workflow at all - it's an expensive private island.
The community's workflow is quite well documented here:
https://wiki.openstack.org/wiki/Gerrit_Workflow


>
> Regards, Ondrej
>
>
> *On 10/27/2014 05:11 PM, Ricardo Carrillo Cruz wrote:*
>
> I think what you are trying to achieve is to have a branch that tracks
> upstream for the upstream projects, and another branch that tracks local
> development in your Gerrit project.
> You may want to check Jeepyb:
>
>  http://ci.openstack.org/jeepyb.html
>
>  That tool is what Openstack CI uses to manage gerrit repo creation.
> Let's take as an example that you wanted to have python-neutronclient
> project in your Gerrit, that tracks upstream.
>
>  You would do something like this:
>
>  1. Install jeepyb and configure the projects.ini file according to your
> environment.
> 1. Add python-neutronclient.config file to the folder your manage-projects
> expect it to find (acl-dir parameter from previous step), with contents
> similar to :
>
>  [access "refs/heads/*"]
>
>
> abandon = group neutron-core
>
>
> label-Code-Review = -2..+2 group neutron-core
>
>
> label-Workflow = -1..+1 group neutron-core
>
>
>
>
>
> [access "refs/heads/proposed/*"]
>
>
> abandon = group neutron-milestone
>
>
> label-Code-Review = -2..+2 group neutron-milestone
>
>
> label-Workflow = -1..+1 group neutron-milestone
>
>
>
>
>
> [access "refs/tags/*"]
>
>
> pushSignedTag = group neutron-release
>
>
>
>
>
> [receive]
>
>
> requireChangeId = true
>
>
> requireContributorAgreement = true
>
>
>
>
>
> [submit]
>
>
> mergeContent = true
>
>  2. Create an entry in gerrit/projects.yaml file from project-config repo
> like:
>
>  - project: openstack/python-neutronclient
>
>
>   upstream: https://git.openstack.org/openstack/python-neutronclient
>
>
>   options:
>
>
>     - track-upstream
>
>  3. Run 'manage-projects python-neutronclient'
>
>  After this, the tool would create the project 'python-neutronclient'
> with the acl defined from step 1 and set it to track upstream (as per the
> option depicted on step 2).
> After this, you could just create branches off master from the Gerrit UI
> (or define them upfront in the acl in step 1, but this way would get you
> started faster).
>
>  If you use the upstream openstack_project::review.pp manifest the
> configuration to get this going is greatly reduced (it's a mega manifest
> that installs gerrit, jeepyb and other things), I can help you with that.
>
>  Regards
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20141029/3c937058/attachment.html>


More information about the OpenStack-dev mailing list