Easy script update of gerrit All-Projects

143 views
Skip to first unread message

Peter Toft

unread,
Aug 22, 2019, 3:01:20 AM8/22/19
to Repo and Gerrit Discussion
Hi all

I have a gerrit with admin/repos/All-Projects have been tweaked a bit - adding a Verified label for Jenkins and blocking anonymous access :)

I have all of my nice settings working (for gerrit 2.x) but now I need to spin up and brand new gerrit 3.0.1 instance ... and I do not like to edit via the GUI interface .... I prefer to patch files in order to document my change-flow.

I have seen this post about how to migrate settings from one instance to another 
but it does not work with the newest gerrit.

Can some of you check the post and comment on how to apply a diff like this


diff --git a/project.config b/project.config
index bef07ba..204d1c0 100644
--- a/project.config
+++ b/project.config
@@ -10,10 +10,12 @@
 [capability]
        administrateServer = group Administrators
        priority = batch group Non-Interactive Users
+       streamEvents = group Event Streaming Users
        streamEvents = group Non-Interactive Users
 [access "refs/*"]
+       read = deny group Anonymous Users
        read = group Administrators
-       read = group Anonymous Users
+       read = group Non-Interactive Users
 [access "refs/for/*"]
        addPatchSet = group Registered Users
 [access "refs/for/refs/*"]
@@ -28,12 +30,15 @@
        forgeCommitter = group Administrators
        forgeCommitter = group Project Owners
        label-Code-Review = -2..+2 group Administrators
+       label-Code-Review = -2..+2 group Non-Interactive Users
        label-Code-Review = -2..+2 group Project Owners
        label-Code-Review = -1..+1 group Registered Users
        push = group Administrators
        push = group Project Owners
        submit = group Administrators
        submit = group Project Owners
+       label-Verified = -1..+1 group Administrators
+       label-Verified = -1..+1 group Non-Interactive Users
 [access "refs/meta/config"]
        exclusiveGroupPermissions = read
        create = group Administrators
@@ -63,3 +68,9 @@
        value = 0 No score
        value = +1 Looks good to me, but someone else must approve
        value = +2 Looks good to me, approved
+[label "Verified"]
+       value = -1 Fails
+       value = 0 No score
+       value = +1 Verified
+       function = MaxWithBlock
+       defaultValue = 0

David Pursehouse

unread,
Aug 22, 2019, 3:24:17 AM8/22/19
to Peter Toft, Repo and Gerrit Discussion
On Thu, Aug 22, 2019 at 4:01 PM Peter Toft <peter...@gmail.com> wrote:
Hi all

I have a gerrit with admin/repos/All-Projects have been tweaked a bit - adding a Verified label for Jenkins and blocking anonymous access :)

I have all of my nice settings working (for gerrit 2.x) but now I need to spin up and brand new gerrit 3.0.1 instance ... and I do not like to edit via the GUI interface .... I prefer to patch files in order to document my change-flow.

I have seen this post about how to migrate settings from one instance to another 
but it does not work with the newest gerrit.


 Can you elaborate on how it doesn't work?

 
Can some of you check the post and comment on how to apply a diff like this


diff --git a/project.config b/project.config
index bef07ba..204d1c0 100644
--- a/project.config
+++ b/project.config
@@ -10,10 +10,12 @@
 [capability]
        administrateServer = group Administrators
        priority = batch group Non-Interactive Users
+       streamEvents = group Event Streaming Users

Is there an entry for the "Event Streaming Users" group in the 'groups' file?   Having a reference to a group that doesn't exist there would prevent this from working.  Looking at this diff, this is the only thing I can see that might be problematic.
 
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/91bea336-edbd-4cc6-b506-89ca8ae2dff6%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages