prep for MCR/NO

  add bot-commit label
  prep code owners and config for MCR/NOde

will turn on bot-commit group in admin ui so that the groups file is right

Bug: b/203789945
Change-Id: I02a394644d3671fbc4d2443a0645c795a6ccafad
Reviewed-on: https://boringssl-review.googlesource.com/c/All-Projects/+/50205
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
diff --git a/code-owners.config b/code-owners.config
new file mode 100644
index 0000000..63ccfa2
--- /dev/null
+++ b/code-owners.config
@@ -0,0 +1,6 @@
+[codeOwners]
+       overrideApproval = Owners-Override+1
+       rejectNonResolvableCodeOwners = false
+       pathExpressions = SIMPLE
+       disabled = true
+       fallbackCodeOwners = ALL_USERS
diff --git a/project.config b/project.config
index c3e3f6a..eee9d61 100644
--- a/project.config
+++ b/project.config
@@ -63,6 +63,11 @@
 	createSignedTag = group Project Owners
 	createSignedTag = group mdb/boringssl-committers
 	delete = group mdb/boringssl-committers
+[label "Bot-Commit"]
+	defaultValue = 0
+	value = 0 No score
+	value = +1 Looks good to me
+	function = NoBlock
 [label "Code-Review"]
 	function = MaxWithBlock
 	defaultValue = 0
@@ -75,6 +80,7 @@
 	value = 0 No score
 	value = +1 Looks good to me, but someone else must approve
 	value = +2 Looks good to me, approved
+        ignoreSelfApproval = false
 [label "Commit-Queue"]
 	function = NoBlock
 	abbreviation = CQ
@@ -82,6 +88,14 @@
 	value = +1 Dry Run
 	defaultValue = 0
 	value = +2 Ready
+[label "Owners-Override"]
+        defaultValue = 0
+        value = 0 No score
+        value = +1 Looks good to me
+        function = NoBlock
+        copyAllScoresOnTrivialRebase = true
+        copyAllScoresIfNoCodeChange = true
+        copyAllScoresIfListOfFilesDidNotChange = true
 [access "refs/heads/chromium-stable"]
 	push = +force group mdb/boringssl-committers
 [access "refs/heads/master-with-bazel"]
diff --git a/rules.pl b/rules.pl
new file mode 100644
index 0000000..55d9a60
--- /dev/null
+++ b/rules.pl
@@ -0,0 +1,22 @@
+% If Bot-Commit+1 vote exists, replace all `need(_)` votes on Code-Review and
+% Verified with `may(_)` votes.
+% `ok(_)`s and `reject(_)`s are preserved.
+% This means that Code-Review and Verified labels are never needed to submit a
+% change, but may be approved or rejected.
+submit_filter(In, Out) :-
+  gerrit:commit_label(label('Bot-Commit', 1), _),
+  !,
+  In =.. [submit | A],
+  filter_label('Code-Review', A, B),
+  filter_label('Verified', B, C),
+  Out =.. [submit | C].
+% If Bot-Commit+1 is not present, do nothing.
+submit_filter(In, In).
+% Replace instances of `label(Name, need(_))` with `label(Name, may(_))` and
+% leave the rest unchanged.
+filter_label(_, [], []).
+filter_label(Name, [label(Name, need(_)) | Ls], [label(Name, may(_)) | Rs]) :-
+  !,
+  filter_label(Name, Ls, Rs).
+filter_label(Name, [L | Ls], [L | Rs]) :-
+  filter_label(Name, Ls, Rs).