meta/config and groups

999 views
Skip to first unread message

Peter Niederlag

unread,
Mar 13, 2012, 7:34:56 AM3/13/12
to repo-discuss
Hi,

i added a group via the ssh gerrit create-group.

now I'd like to use this group to assign a permission to it via editing
project.config. However when I try to push I run into:

remote: error: project.config: group "TYPO3v4/Extensions/recycler" not
in groups

I have noticed other projects got a file group in meta/config that was
created by the update/init process.

Do I have to create this file? If so how can I figure out the proper UUID?

Thx and Greets,
Peter

P.S: we want to automate permission setup

Edwin Kempin

unread,
Mar 13, 2012, 7:53:38 AM3/13/12
to Peter Niederlag, repo-discuss
Hi Peter,

I think you need to create this file manually.
The group UUI is shown in the Gerrit WebUI when you are on the group sreeen (tab 'General')

Best regards,
Edwin

2012/3/13 Peter Niederlag <peter.n...@googlemail.com>

Mohamed Mansour

unread,
Mar 13, 2012, 8:41:46 AM3/13/12
to Edwin Kempin, Peter Niederlag, repo-discuss
Hi Peter,

You would need to create a "groups" file in the same location of "project.config" file in refs/config.

The groups file is basically a two column text of UUID and Group Name separated by a tab. To get the Group UUIDs for a group name, you can use gsql to fetch it:

SELECT name, group_uuid FROM account_groups WHERE name in ('FOO', 'Some Group A', 'Some Group B')

Then you create a file called "groups" in meta/config where each line is formatted like "UUID\tGROUP_NAME\n"

Then you can create your project.conf where the groups in that config map to the groups file. Just remember that the keys in project.conf are case sensitive  :)

Kind regards,
Mohamed Mansour

Peter Niederlag

unread,
Mar 14, 2012, 5:08:07 AM3/14/12
to repo-discuss
Hi,

big thanx for all of your valuable feedback.

but what do I have to do if I need to rename my groups?

would I have to update all project.conf and groups files by hand, or is
there some easy scriptable "rename group" solution around the corner?

We would like to bulk rename our current groups into xyz/Member and add
a separate xyz/Owner.

Thx and Greets,
Peter

Edwin Kempin

unread,
Mar 14, 2012, 5:44:46 AM3/14/12
to Peter Niederlag, repo-discuss
There is an SSH command to rename groups [1] and rename is also possible in the WebUI (group screen, tab 'General').
Setting a new owner for a group is only possible in the WebUI (group screen, tab 'General').

[1] https://gerrit-review.googlesource.com/Documentation/cmd-rename-group.html

2012/3/14 Peter Niederlag <peter.n...@googlemail.com>

Shawn Pearce

unread,
Mar 14, 2012, 10:12:43 AM3/14/12
to Peter Niederlag, repo-discuss
On Wed, Mar 14, 2012 at 02:08, Peter Niederlag
<peter.n...@googlemail.com> wrote:
> big thanx for all of your valuable feedback.
>
> but what do I have to do if I need to rename my groups?

The group names in project.config and groups file are only used to
connect the two files together. Internally Gerrit uses the UUID to
connect the group you meant in the configuration to the group in the
server. This allows the names of the groups in groups/project.config
to lag behind the server and be stale when the server renames a group.
Access still works as expected for the group.

When you view a stale project.config in the Project > Admin > Access
tab the server will update the groups automatically in the
groups/project.config file and commit that back to the repository.

> would I have to update all project.conf and groups files by hand, or is
> there some easy scriptable "rename group" solution around the corner?

As Edwin said, if you rename these groups using the server's tools
(e.g. rename in the web UI or the rename SSH command) the server will
do the batch work in the background to rename the groups in the
refs/meta/config branches. This may take seconds to several minutes
depending on how many groups there are to rename and how many projects
are impacted. IIRC it shows as a task in `gerrit show-queue` so you
can monitor this and keep the server running until the rename tasks
are no longer running.

Reply all
Reply to author
Forward
0 new messages