meta/config and groups

Showing 1-6 of 6 messages
meta/config and groups Peter Niederlag 3/13/12 4:34 AM
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

Re: meta/config and groups Edwin Kempin 3/13/12 4:53 AM
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


Re: meta/config and groups Mohamed Mansour 3/13/12 5:41 AM
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
Re: meta/config and groups Peter Niederlag 3/14/12 2:08 AM
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

Re: meta/config and groups Edwin Kempin 3/14/12 2:44 AM
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>

Re: meta/config and groups Shawn Pearce 3/14/12 7:12 AM
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.