Upgrade Gerrit to 2.6

Bug #1082781 reported by Monty Taylor on 2012-11-25
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
Fix Released
Medium
Khai Do

Bug Description

We need to forward port our outstanding patches to gerrit 2.6 and then upgrade our gerrit server to be based on it.

Clark Boylan (cboylan) wrote :

Gerrit 2.6 is currently going through their release candidate process. Once they have a proper release we should begin the porting and upgrading process.

summary: - Upgrade Gerrit to 2.5
+ Upgrade Gerrit to 2.6
description: updated
Changed in openstack-ci:
milestone: grizzly → havana
Khai Do (zaro0508) on 2013-05-01
Changed in openstack-ci:
assignee: nobody → Khai Do (zaro0508)
Khai Do (zaro0508) on 2013-05-07
Changed in openstack-ci:
status: Triaged → In Progress
Khai Do (zaro0508) wrote :

I reviewed gerrit 2.6 features to see if it supports the all the patches we've put into 2.4.2. I've concluded that we will be able to use gerrit 2.6 features to implements all of the patches except for the Work in Progress patch (https://github.com/openstack-infra/gerrit/commit/4212f6cb052661b7b36f7777e28e2776c1d769aa)

The problem is that gerrit 2.6 ACLs are not granular enough to make a WIP vote work. The one use case I can think of is to only allow the owner/author of a patch to set WIP.

Mordred, jeblair and I discussed what should be done. It was decided that, if it's not on the gerrit roadmap, we should try to patch upstream gerrit to add a feature that would provide more flexible ACLs. An option would be to add a feature similar to prolog submit rules, except it would be prolog ACLs.

I solicited feeback from the maintainer 'spearce_' on the #gerrit channel but did not get any feedback. I did get feedback from 'minjive1' whether making ACLs more grandular is something that is on gerrit roadmap and he said that is wasn't. He just mentioned that most of the focus has been to move to a REST backend removing more of the DB-backend so as long as the patch doesn't require adding anything to the db it should be ok.

Khai Do (zaro0508) wrote :
Khai Do (zaro0508) on 2013-07-13
Changed in openstack-ci:
status: In Progress → New
James E. Blair (corvus) on 2013-07-30
Changed in openstack-ci:
status: New → Triaged
Khai Do (zaro0508) wrote :

patches were created to support WIP votes in gerrit. They have been submitted to upstream:
https://gerrit-review.googlesource.com/#/c/48290/
https://gerrit-review.googlesource.com/#/c/48270/

Khai Do (zaro0508) wrote :

This is an update.

This patches has merged into core: https://gerrit-review.googlesource.com/#/c/48255/
This patch was submitted, but not accepted yet: https://groups.google.com/forum/#!topic/repo-discuss/YapS9Sh1qY8

mfick feels that the change owner group should work will all permissions in gerrit, not just label permissions. He suggested getting more feedback by add RFC to commit message so I did that. I also posted a RFC to the gerrit forum: https://groups.google.com/forum/#!topic/repo-discuss/YapS9Sh1qY8

Khai Do (zaro0508) wrote :
Khai Do (zaro0508) wrote :
Khai Do (zaro0508) wrote :

hallelujah!!!
upstream gerrit patch https://gerrit-review.googlesource.com/48254 has merged. issue http://code.google.com/p/gerrit/issues/detail?id=1993 is fixed.

Khai Do (zaro0508) on 2013-12-02
Changed in openstack-ci:
status: Triaged → In Progress
Khai Do (zaro0508) wrote :

This is an update. Jeremy ran a manually upgrade of review-dev from 2.4.x to 2.8. There was an error on the db schema conversion. It's probably a bug in gerrit that isn't handling some badness in the db correct. We will need to debug further.

The error:
  Exception in thread "main" com.google.gwtorm.server.OrmException: insert failure on account_group_by_id

  Caused by: java.sql.BatchUpdateException: Duplicate entry '68-d4b0cac70d6347e29a1446e2d0c6c3ff43d38b92' for key 'PRIMARY'

Khai Do (zaro0508) wrote :

I've tested the following with gerrit 2.8 (installed on review-dev.o.o). Patches are awaiting reviews.

Zuul: made zuul-dev.o.o point to review-dev.o.o. Got gate-noop job running.
regex for comment filter requires updating - https://review.openstack.org/#/c/70865

Tested Plugins: javamelody and replication, both work as expected
change to add javamelody build job - https://review.openstack.org/#/c/70014

Jeepyb: expire_old_reviews.py, manage_projects.py, update_blueprint.py, update_bug.py, welcome_message.py, openstackwatch.py.

change to fix gerrit hooks - https://review.openstack.org/#/c/69791
change to fix replicate command - https://review.openstack.org/#/c/69768

The trivial_rebase.py script was not tested because we will use the built in gerrit trivial rebase detector,
https://review.openstack.org/#/c/69800

Config: ATC Collector script (email-stats.py) work as expected.
update configuration in doc for All-Projects configs - https://review.openstack.org/#/c/70818

Reviewday: gerrit.py

Releasestatus: releasestatus.py

WIP vote config: configured a WIP label and tested it.

Tested the built in gerrit trivial rebase detector, copyAllScoresOnTrivialRebase and copyAllScoresIfNoCodeChange.

Khai Do (zaro0508) wrote :

forgot to mention that I also tested gerritbot and that seems to work fine with gerrit 2.8.

Reviewed: https://review.openstack.org/69791
Committed: https://git.openstack.org/cgit/openstack-infra/jeepyb/commit/?id=335ef39212996ef7ea8d67e70dace23a16035609
Submitter: Jenkins
Branch: master

commit 335ef39212996ef7ea8d67e70dace23a16035609
Author: Khai Do <email address hidden>
Date: Tue Jan 28 20:45:04 2014 -0800

    Fix incompatibility with gerrit 2.8

    This change updates the gerrit hook scripts to be compatible with gerrit version 2.8

    Closes-Bug: #1273947
    Partial-Bug: #1082781

    Change-Id: I529bb9fbded16ccafb020b4edc9eb2d5e641cbc7

Reviewed: https://review.openstack.org/69800
Committed: https://git.openstack.org/cgit/openstack-infra/config/commit/?id=c80681bd9ab056925c0358efd4623e84ab53b4fc
Submitter: Jenkins
Branch: master

commit c80681bd9ab056925c0358efd4623e84ab53b4fc
Author: Khai Do <email address hidden>
Date: Tue Jan 28 22:23:38 2014 -0800

    disable the jeepyb trivial rebase hook on review-dev.o.o

    This change is for the pending gerrit upgrade. Gerrit 2.8 has built-in trivial rebase
    detection[1]. This change disables the jeepyb trivial rebase hook on review-dev.o.o so
    so we can use and test gerrit's built-in rebase detector instead.

    [1] https://gerrit-review.googlesource.com/Documentation/config-labels.html#label_copyAllScoresOnTrivialRebase
    and https://gerrit-review.googlesource.com/Documentation/config-labels.html#label_copyAllScoresIfNoCodeChange

    Closes-Bug: #1273959
    Partial-Bug: #1082781

    Change-Id: Ia14d8ee86b9d59b6f79ee873231bb0d13b7f43d2

Reviewed: https://review.openstack.org/60348
Committed: https://git.openstack.org/cgit/openstack-infra/config/commit/?id=c3e2997ef81372f1dd1d05f792bdc89e42adea59
Submitter: Jenkins
Branch: master

commit c3e2997ef81372f1dd1d05f792bdc89e42adea59
Author: Khai Do <email address hidden>
Date: Thu Dec 5 20:55:42 2013 +0000

    Setup tooling and jobs for openstack Gerrit ver 2.8 and beyond

    Previous versions of Gerrit used maven as the build tool, it has since
    switched to use buck. I believe the switch happened in ver 2.7. We are
    now hosting a fork of Gerrit ver 2.8 so we need to setup tooling and
    jobs to build newer versions of gerrit. This patch sets up tooling and
    jobs required for building the openstack Gerrit ver 2.8. We now have
    two sets of jenkins jobs to build gerrit, one for Gerrit prior to ver
    2.4.x (maven) and one for Gerrit post ver 2.7 (buck).

    Notes:
    1. Buck does not have OS packages for easy installation so it needs to
    be built from source using ant (requires gcc as well).
    2. Maven jobs execute only when commits are made to 2.4.x branch.
    3. Buck jobs execute when commits are made to branches other than 2.4.x
    4. The origin post job 'gerrit-package' now publishes artifacts to
    tarballs.o.o/ci/gerrit instead of tarballs.o.o/ci
    5. Buck requires the zip package to build gerrit.
    6. Buck and gerrit clones need to be at same directory level

    Partial-Bug: #1082781
    Change-Id: I1de9f127fa6826fb0a686d12dc77c0edff34be7c

Fix proposed to branch: master
Review: https://review.openstack.org/82416

Reviewed: https://review.openstack.org/70014
Committed: https://git.openstack.org/cgit/openstack-infra/config/commit/?id=b29f7edf9688aad848d2cef87d5596e349b703db
Submitter: Jenkins
Branch: master

commit b29f7edf9688aad848d2cef87d5596e349b703db
Author: Khai Do <email address hidden>
Date: Wed Jan 29 15:23:45 2014 -0800

    Add jenkins job to build gerrit plugins

    There currently is no repository for non-core gerrit plugins so there isn't a way to
    consume gerrit plugin binaries[1]. We need to build the binary from source so that it is
    available for us to install into our gerrit deployment. This change adds a periodic job
    to build gerrit plugins.

    [1] https://groups.google.com/d/msg/repo-discuss/M5eVf40B1MU/bj0wUa-dZFEJ

    Partial-Bug: #1082781
    Change-Id: Ibd915d26baff9d6c7ca376c55b66252f3061494f

Reviewed: https://review.openstack.org/69768
Committed: https://git.openstack.org/cgit/openstack-infra/gerritlib/commit/?id=d0bca22df9025f70fdb121a640a395952abb96aa
Submitter: Jenkins
Branch: master

commit d0bca22df9025f70fdb121a640a395952abb96aa
Author: Khai Do <email address hidden>
Date: Tue Jan 28 17:19:49 2014 -0800

    add getVersion and listPlugin commands and update replicate command

    The replication command string changed after replication became a plugin in gerrit.
    This patch adds a getVersion[1] and a listPlugins[2] command to gerritlib. The listPlugin
    command is used to determine the correct replication string to execute in the replication
    command.

    [1] Only available on gerrit version >= 2.6
    [2] Only available on gerrit version >= 2.5
    Closes-Bug: #1273891
    Partial-Bug: #1082781

    Change-Id: I966037851b3f27536f415230edd1ae4e710321fb

Reviewed: https://review.openstack.org/60893
Committed: https://git.openstack.org/cgit/openstack-infra/config/commit/?id=25546d376e2c0b7fe34a5d364df64815c3a55292
Submitter: Jenkins
Branch: master

commit 25546d376e2c0b7fe34a5d364df64815c3a55292
Author: David Ostrovsky <email address hidden>
Date: Mon Dec 9 19:59:45 2013 +0100

    Gerrit-2.8: Allow encoded path separators in URLs

    Partial-Bug: #1082781
    Change-Id: Ib446a3332a3ff289cd9f6464009ce5f7416309eb

Reviewed: https://review.openstack.org/79103
Committed: https://git.openstack.org/cgit/openstack-infra/config/commit/?id=36f7bbbf2230945f7bd0ab075e37c0ea3cf4a6a9
Submitter: Jeremy Stanley (<email address hidden>)
Branch: master

commit 36f7bbbf2230945f7bd0ab075e37c0ea3cf4a6a9
Author: Khai Do <email address hidden>
Date: Fri Mar 7 14:43:29 2014 -0800

    update trigger to match new workflow label

    after upgrading gerrit to ver 2.8, review.o.o will have a new label called 'Workflow'
    that combines approved and wip labels. Updating the trigger to match the label.

    We need to keep the 'approved' label so it will continue to work with gerrit ver 2.4.4

    The gerrit workflow label is defined as:

    [label "Workflow"]
            function = MaxWithBlock
            value = -1 Work in progress
            value = 0 Ready for reviews
            value = +1 Approved

    Note: This same change has already been applied and tested on review-dev.o.o
    Ieb7e2dde49cd64f2aa3dbf939c391492d73ed886

    Partial-Bug: #1082781
    Change-Id: I849eca5f5c20a21ad0007541ea60c82e2da343e0

Reviewed: https://review.openstack.org/60080
Committed: https://git.openstack.org/cgit/openstack-infra/config/commit/?id=aa86bee7f3c44de071bb96ee26663abe38e3174d
Submitter: Jeremy Stanley (<email address hidden>)
Branch: master

commit aa86bee7f3c44de071bb96ee26663abe38e3174d
Author: David Ostrovsky <email address hidden>
Date: Wed Dec 4 23:26:42 2013 +0100

    Gerrit-2.8: Add secondary index support

    This rebuilds secondary indexes on gerrit initial-init and init. They
    are optional in gerrit 2.8, and mandatory in gerrit 2.9.

    A few common strings are refactored into variables to make this more
    concise, and less likely to get fat fingered. If desired, further
    symbolic refactoring can be done here as well.

    Question remains if we need to make this 2.8 conditional, and how we
    can get access to the gerrit revision in this part of puppet.

    Partial-Bug: #1082781
    Change-Id: Iee94934baaa220313a7e888ba0e2a6530eab0d52

Reviewed: https://review.openstack.org/79005
Committed: https://git.openstack.org/cgit/openstack-infra/config/commit/?id=f433ff085bd9c93507d326eee083d67623a8c1b2
Submitter: Jeremy Stanley (<email address hidden>)
Branch: master

commit f433ff085bd9c93507d326eee083d67623a8c1b2
Author: Khai Do <email address hidden>
Date: Fri Apr 4 10:10:53 2014 -0700

    Activate secondary index support for Gerrit

    Partial-Bug: #1082781
    Change-Id: Iba923e99875c8e8380730fae2a0e969a4eb755f9

Reviewed: https://review.openstack.org/82416
Committed: https://git.openstack.org/cgit/openstack-infra/config/commit/?id=92332233c84cbd5e8406fe5b99f46d76790d49c5
Submitter: Jeremy Stanley (<email address hidden>)
Branch: master

commit 92332233c84cbd5e8406fe5b99f46d76790d49c5
Author: Khai Do <email address hidden>
Date: Sun Mar 23 21:29:54 2014 -0700

    disable the jeepyb trivial rebase hook on review.o.o

    Gerrit 2.8 has built-in trivial rebase detection[1]. This change disables the jeepyb
    trivial rebase hook on review.o.o. It has already been disabled on review-dev.o.o
    by change Ia14d8ee86b9d59b6f79ee873231bb0d13b7f43d2

    [1] https://gerrit-review.googlesource.com/Documentation/config-labels.html#label_copyAllScoresOnTrivialRebase
    and https://gerrit-review.googlesource.com/Documentation/config-labels.html#label_copyAllScoresIfNoCodeChange

    Change-Id: I37337b9d07ace4a5202ad4d65d298af6a71abd40
    closes-Bug: #1273959
    Partial-Bug: #1082781

Khai Do (zaro0508) on 2014-04-30
Changed in openstack-ci:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.