config: add requirements for TryBot results and unresolved comments

See #56031.

Change-Id: I7bc24822dfc3125bf2daad0e5847a24397f3b6dc
Reviewed-on: https://go-review.googlesource.com/c/All-Projects/+/445675
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
diff --git a/project.config b/project.config
index a91243f..2aa1851 100644
--- a/project.config
+++ b/project.config
@@ -39,6 +39,7 @@
 	editHashtags = group gobot
 	labelAs-TryBot-Result = -1..-1 group trybot-result-changers
 	label-TryBot-Result = -1..+1 group gobot
+        label-TryBot-Bypass = +0..+1 group approvers
 	label-Auto-Submit = +0..+1 group approvers
 	removeReviewer = group approvers
 	abandon = group may-abandon-changes
@@ -110,6 +111,11 @@
 	value = 0 Do not automatically submit change
 	value = +1 Automatically submit change
 	copyCondition = changekind:NO_CHANGE
+[label "TryBot-Bypass"]
+	defaultValue = 0
+	value = 0 Require TryBot-Result+1 to submit
+	value = +1 Ignore missing or failing TryBot-Result
+	copyCondition = changekind:NO_CODE_CHANGE
 [commitmessage]
 	maxSubjectLength = 1000
 	maxLineLength = 1000
@@ -163,3 +169,15 @@
 	description = Changes with a Hold+1 vote are not submittable.
 	submittableIf = NOT label:Hold=1
 	canOverrideInChildProjects = false
+[submit-requirement "TryBots-Pass"]
+	description = Changes must pass TryBots unless TryBot-Bypass+1 is set.
+	submittableIf = label:TryBot-Result=MAX
+	overrideIf = label:TryBot-Bypass=MAX
+	canOverrideInChildProjects = true
+[submit-requirement "No-Unresolved-Comments"]
+	description = Changes that have unresolved comments are not submittable, unless overriden by adding the hashtag allow-unresolved-comments.
+	applicableIf = has:unresolved
+	submittableIf = -has:unresolved
+	overrideIf = hashtag:allow-unresolved-comments
+	canOverrideInChildProjects = false
+