Sa�a �ivkov wrote:
> On Thu, Nov 15, 2012 at 8:01 PM, Phil Hord <
ho...@cisco.com> wrote:
>
>> I may have some things wrong here because it feels like most of this stuff
>> is un-/poorly-documented. But I am trying to add a new approval category
>> to our Gerrit instance. Here's what I did:
>>
>> insert into approval_categories(name, abbreviated_name, position,
>> function_name, copy_min_score, category_id) VALUES('Flags', 'F', 2,
>> 'NoBlock', 'N', 'FLAG');
>> insert into approval_category_values(name, category_id, value)
>> VALUES('No flags', 'FLAG', 0);
>> insert into approval_category_values(name, category_id, value)
>> VALUES('Flag: revisit for cleanup', 'FLAG', 1);
>>
>> It seems to be working now.
>> I can add the permission.
>> I can see the 'Flags' column on changes.
>> I can set a flag on a change in review.
>> I can see the 'F' column on the change list.
>> I can search for 'Flags+1' and find the correct hits.
>>
>> However:
>> The 'F' column is empty on the changes screen.
>>
> this is strange. What do you find in the patchset_approvals table for a
> patch set
> which has a vote in the Flags category.
value | granted | change_open | change_sort_key |
change_id | patch_set_id | account_id | category_id
------+----------------------------+-------------+------------------+-----------+--------------+------------+------------
-2 | 2012-11-12 14:22:56.861-05 | Y | 00211b4300000c3d |
3133 | 1 | 1000002 | CRVW
1 | 2012-11-15 12:07:22.764-05 | Y | 00211b4300000c3d |
3133 | 1 | 1000002 | FLAG
0 | 2012-11-12 14:22:56.861-05 | Y | 00211b4300000c3d |
3133 | 1 | 1000002 | VRIF
0 | 2012-11-12 14:20:34.177-05 | Y | 00211b4300000c3d |
3133 | 1 | 1000011 | CRVW
(4 rows; 2 ms)
Here's the result of the JSON query for "Flags+1":
$ ssh gerrit gerrit query --current-patch-set --format=JSON "Flags+1"
{"project":"core","branch":"3.0","id":"If015d35cd8f23ff175b2b3b938cf98ddd55e7ebd","number":"3133","subject":"Update
this project for 3.0","owner":{"name":"Phil
Hord","email":"
ho...@cisco.com","username":"hordp"},"url":"
https://grt.cisco.com/gerrit/3133","createdOn":1352747668,"lastUpdated":1352999242,"sortKey":"00211b4300000c3d","open":true,"status":"NEW","currentPatchSet":{"number":"1","revision":"527b0f1f8676d2573b79556a012a5836a729fb02","parents":["4d2d19f8e2f5487a6e72c0a342a1af7fe26d653f"],"ref":"refs/changes/33/3133/1","uploader":{"name":"Phil
Hord","email":"
ho...@cisco.com","username":"hordp"},"createdOn":1352747668,"approvals":[{"type":"CRVW","description":"Code
Review","value":"-2","grantedOn":1352748176,"by":{"name":"Phil
Hord","email":"
ho...@cisco.com","username":"hordp"}},{"type":"FLAG","description":"Flags","value":"1","grantedOn":1352999242,"by":{"name":"Phil
Hord","email":"
ho...@cisco.com","username":"hordp"}}]}}
{"type":"stats","rowCount":1,"runTimeMilliseconds":155}
It shows the FLAG value is 1, but it still does not show this in the web
page.
> The "Flags+1" approval does not show up in the refs/notes/review
> this is probably a consequence of the previous issue.
Or it may be that the patch was rebased just before it was merged so my
flag was lost. I'll try to recreate that issue on another commit.