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.

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:


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
requireChangeId = true
requireContributorAgreement = true
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
    - 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.

OpenStack-dev mailing list

Reply via email to