[review] git-codereview: add GIT_CODEREVIEW_TRYBOT env var to control CI system

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Aug 25, 2023, 4:23:18 PM8/25/23
to Dmitri Shuralyov, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Heschi Kreinick, Dmitri Shuralyov, Michael Knyszek, Carlos Amedee, golang-co...@googlegroups.com

Gopher Robot submitted this change.

View Change



2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: git-codereview/doc.go
Insertions: 1, Deletions: 1.

@@ -258,7 +258,7 @@
The Go project uses this vote to start running integration tests on the CL.
During the transition between two CI systems, the environment variable
GIT_CODEREVIEW_TRYBOT can be set to one of "luci", "farmer", or "both"
-to exicitly override where the -trybot flag starts integration tests.
+to explicitly override where the -trybot flag starts integration tests.

The -autosubmit flag sets a Auto-Submit+1 vote on any uploaded changes.

```

Approvals: Heschi Kreinick: Looks good to me, approved Go LUCI: TryBots succeeded Dmitri Shuralyov: Run TryBots; Automatically submit change Dmitri Shuralyov: Looks good to me, but someone else must approve Gopher Robot: TryBots succeeded
git-codereview: add GIT_CODEREVIEW_TRYBOT env var to control CI system

The mail command has a -trybot flag, useful to start TryBots on the CL
being mailed. The new LUCI trybots are almost ready, and we'll soon be
asking contributors to consider them the new default. Prepare for that
by adding a temporary GIT_CODEREVIEW_TRYBOT environment variable which
will make it possible to override the CI system invoked by the -trybot
flag.

This CL keeps the default as the old CI system (farmer.golang.org),
and the next CL switches it to the new one (ci.chromium.org/p/golang).

The environment variable will eventually be removed once it has no use.

Change-Id: Ia20bb0cad1fee387b2d94a8438e8a3be3ec87e6b
Reviewed-on: https://go-review.googlesource.com/c/review/+/523095
Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
Run-TryBot: Dmitri Shuralyov <dmit...@golang.org>
Auto-Submit: Dmitri Shuralyov <dmit...@golang.org>
LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Heschi Kreinick <hes...@google.com>
TryBot-Result: Gopher Robot <go...@golang.org>
---
M git-codereview/doc.go
M git-codereview/mail.go
2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/git-codereview/doc.go b/git-codereview/doc.go
index 4be0c0d..0754479 100644
--- a/git-codereview/doc.go
+++ b/git-codereview/doc.go
@@ -256,6 +256,9 @@

The -trybot flag sets a Run-TryBot+1 vote on any uploaded changes.
The Go project uses this vote to start running integration tests on the CL.
+During the transition between two CI systems, the environment variable
+GIT_CODEREVIEW_TRYBOT can be set to one of "luci", "farmer", or "both"
+to explicitly override where the -trybot flag starts integration tests.

The -autosubmit flag sets a Auto-Submit+1 vote on any uploaded changes.

diff --git a/git-codereview/mail.go b/git-codereview/mail.go
index 5d385f9..4bcd85c 100644
--- a/git-codereview/mail.go
+++ b/git-codereview/mail.go
@@ -6,6 +6,7 @@

import (
"fmt"
+ "os"
"regexp"
"sort"
"strings"
@@ -47,6 +48,19 @@
exit(2)
}

+ var trybotVotes []string
+ switch os.Getenv("GIT_CODEREVIEW_TRYBOT") {
+ case "luci":
+ trybotVotes = []string{"Commit-Queue+1"}
+ case "", "farmer":
+ trybotVotes = []string{"Run-TryBot"}
+ case "both":
+ trybotVotes = []string{"Commit-Queue+1", "Run-TryBot"}
+ default:
+ fmt.Fprintf(stderr(), "GIT_CODEREVIEW_TRYBOT must be unset, blank, or one of 'luci', 'farmer', or 'both'\n")
+ exit(2)
+ }
+
b := CurrentBranch()

var c *Commit
@@ -142,8 +156,10 @@
start = ","
}
if *trybot {
- refSpec += start + "l=Run-TryBot"
- start = ","
+ for _, v := range trybotVotes {
+ refSpec += start + "l=" + v
+ start = ","
+ }
}
if *wip {
refSpec += start + "wip"

To view, visit change 523095. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: review
Gerrit-Branch: master
Gerrit-Change-Id: Ia20bb0cad1fee387b2d94a8438e8a3be3ec87e6b
Gerrit-Change-Number: 523095
Gerrit-PatchSet: 4
Gerrit-Owner: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Heschi Kreinick <hes...@google.com>
Gerrit-CC: Carlos Amedee <car...@golang.org>
Gerrit-CC: Michael Knyszek <mkny...@google.com>
Reply all
Reply to author
Forward
0 new messages