minutes of ESC call ...
David Ostrovsky
d.ostrovsky at gmx.de
Tue Jul 5 07:09:20 UTC 2016
On Mon, 2016-07-04 at 18:08 -0500, Norbert Thiebaud wrote:
> On Mon, Jul 4, 2016 at 3:04 PM, David Ostrovsky <d.ostrovsky at gmx.de>
> wrote:
[...]
> Have you read the minutes you answered to ?
> "if +2 __by author__ and +1 by jenkins -> auto-push"
>
> >
> > project:core
> > branch:master
> > is:open
> > is:mergeable
> > label:Code-Review+2
> > label:Verified+1,ci at libreoffice.org
> > NOT label:Code-Review-2
> > NOT label:Verified-1
>
> that does not implement the rule desired. see above
> we want Code-Review+2 _from the author_.
> that query return 4 records instead of 2 (at the time of testing)
OK, I missed that requirement. It cannot be done natively in GQL
because the data is retrieved from the secondary index, an it is stored
as list of only approvals in addition to approval,account form:
[code-review+2, verified+1, verified+1,1000000, code-review+2,1000000,
custom-label+1, custom-label+1,1000000]
There is global:Change-Owner pseudo system group in Gerrit, but it
cannot be rewritten as a valid predicate, because different changes
have different change owners.
So the way to go is still to use the query I suggested with --current
-patch-set option (use text or JSON response, what is easier for you to
parse) and filter out changes, that weren't approved by the change
owner. You have all infos necessary to preform the check.
e.g: this change that is returned by GQL query wouldn't pass this
check, because author != CRVW+2 voter:
[90018d327e9a41085585519a704f9fa07953cbf3]
ref: refs/changes/08/26308/1
uploader:
name: Mark Page
email: aptitude at btconnect.com
username: rombust
createdOn: 2016-06-15 13:10:35 UTC
author:
name: Mark Page
email: aptitude at btconnect.com
username: rombust
isDraft: false
kind: REWORK
approvals:
type: Verified
description: Verified
value: 1
grantedOn: 2016-06-15 14:21:31 UTC
by:
name: Jenkins
email: ci at libreoffice.org
username: ci
approvals:
type: Code-Review
description: Code-Review
value: 2
grantedOn: 2016-06-16 07:25:52 UTC
by:
name: Eike Rathke
email: erack at redhat.com
username: erAck
sizeInsertions: 1515
sizeDeletions: -1515
Sounds like a couple of lines of python script to me.
Alternatively, you could still use your SQL query for now (change-owner
-approval), combined with my GQL query (is:mergeable predicate):
intersecting the result sets from both queries should give you the
desired answer.
More information about the LibreOffice
mailing list