summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-04-01 14:54:49 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-04-01 17:23:50 +0100
commitfc2eb105834ee33d2010acb0fcf18f72efa63ac5 (patch)
tree46934886ee9df926cc02c233f2a85ab832f12a9d
parentc7edd49d23fa3f1179c611b52d946ff194039723 (diff)
downloadinfrastructure-fc2eb105834ee33d2010acb0fcf18f72efa63ac5.tar.gz
gerrit: Allow Lorry to force-push to branches other than 'master'
Commit c7edd49d23fa3f1179c611b52d946ff194039723 tried to express this using regular expressions but it actually blocked all force-pushes. I spent some time trying figure out how to get java.util.regex to do the right thing but I think it's a lost cause. Instead, it now uses a BLOCK rule to remove the +force permission from refs/heads/master for Mirroring Tools. Change-Id: Idb4802ed176184168b928f1e3b79061bd3f408f0
-rw-r--r--baserock_gerrit/All-Projects/project.config11
1 files changed, 7 insertions, 4 deletions
diff --git a/baserock_gerrit/All-Projects/project.config b/baserock_gerrit/All-Projects/project.config
index e1c44040..e418ac0b 100644
--- a/baserock_gerrit/All-Projects/project.config
+++ b/baserock_gerrit/All-Projects/project.config
@@ -66,13 +66,16 @@
create = group Mirroring Tools
forgeAuthor = group Mirroring Tools
forgeCommitter = group Mirroring Tools
- push = group Mirroring Tools
+ push = +force group Mirroring Tools
+
-# Allow Lorry to force-push to personal branches, but don't ever let
+# We allow Lorry to force-push to personal branches, but don't ever let
# it force-push to master as this may undo merges that Gerrit just did
# and really confuse things.
-[access "^refs/heads/(?!master$)"]
- push = +force group Mirroring Tools
+[access "refs/heads/master"]
+ exclusiveGroupPermissions = push
+ push = block +force group Mirroring Tools
+
[access "refs/tags/*"]
pushTag = group Release Team