Enable MCR/NO

Bug: b/203797520
Change-Id: If4dc71a0220419befc1c5b4278e81ff27fe19bfe
Reviewed-on: https://webrtc-review.googlesource.com/c/All-Projects/+/237640
Reviewed-by: Anthony Polito <apolito@google.com>
diff --git a/code-owners.config b/code-owners.config
new file mode 100644
index 0000000..c1afc90
--- /dev/null
+++ b/code-owners.config
@@ -0,0 +1,6 @@
+[codeOwners]
+	overrideApproval = Owners-Override+1
+	rejectNonResolvableCodeOwners = false
+	pathExpressions = SIMPLE
+	disabled = false
+	fallbackCodeOwners = ALL_USERS
\ No newline at end of file
diff --git a/project.config b/project.config
index 22af3ce..2d9d030 100644
--- a/project.config
+++ b/project.config
@@ -18,6 +18,11 @@
 	copyAllScoresIfNoCodeChange = true
 	value = 0 Do not send CL to CQ automatically after approval
 	value = +1 Send CL to CQ automatically after approval
+[label "Bot-Commit"]
+	defaultValue = 0
+	value = 0 No score
+	value = +1 Looks good to me
+	function = NoBlock
 [label "Code-Review"]
 	value = -1 Don't submit as-is
 	value = 0 No score
@@ -28,6 +33,15 @@
 	copyMaxScore = true
 	copyAllScoresOnTrivialRebase = true
 	copyAllScoresIfNoCodeChange = true
+	ignoreSelfApproval = true
+[label "Owners-Override"]
+	defaultValue = 0
+	value = 0 No score
+	value = +1 Looks good to me
+	function = NoBlock
+	copyAllScoresOnTrivialRebase = true
+	copyAllScoresIfNoCodeChange = true
+	copyAllScoresIfListOfFilesDidNotChange = true
 [label "Commit-Queue"]
 	function = MaxWithBlock
 	defaultValue = 0
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).