Skip to content

Commit

Permalink
cmd/gerritbot: use the new repos package for repo policy
Browse files Browse the repository at this point in the history
The only behavior change is that "gofrontend" is now included, which
is arguably a bug fix (an example of our various lists of repos
getting out of sync). At least, I don't recall any discussion of
omitting that repo. Ian +1'd this CL, so keeping them on.

If we want to exclude a repo from gerritbot in the future we'll need
to add some policy fields/methods to the repos package.

Updates golang/go#36047

Change-Id: I877cd3b6c292ac888863523e05799208e247499f
Reviewed-on: https://go-review.googlesource.com/c/build/+/210741
Reviewed-by: Alexander Rakoczy <[email protected]>
  • Loading branch information
bradfitz committed Dec 10, 2019
1 parent 46d55d5 commit e50995e
Showing 1 changed file with 11 additions and 37 deletions.
48 changes: 11 additions & 37 deletions cmd/gerritbot/gerritbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"golang.org/x/build/internal/https"
"golang.org/x/build/maintner"
"golang.org/x/build/maintner/godata"
"golang.org/x/build/repos"
"golang.org/x/oauth2"
)

Expand Down Expand Up @@ -189,43 +190,16 @@ const (
)

// Gerrit projects we accept PRs for.
var gerritProjectWhitelist = map[string]bool{
"arch": true,
"benchmarks": true,
"blog": true,
"build": true,
"crypto": true,
"debug": true,
"dl": true,
"example": true,
"exp": true,
"gddo": true,
"go": true,
"image": true,
"lint": true,
"mobile": true,
"mod": true,
"net": true,
"oauth2": true,
"perf": true,
"playground": true,
"proposal": true,
"protobuf": true,
"review": true,
"scratch": true,
"sublime-build": true,
"sublime-config": true,
"sync": true,
"sys": true,
"talks": true,
"term": true,
"text": true,
"time": true,
"tools": true,
"tour": true,
"vgo": true,
"website": true,
"xerrors": true,
var gerritProjectWhitelist = genProjectWhitelist()

func genProjectWhitelist() map[string]bool {
m := make(map[string]bool)
for p, r := range repos.ByGerritProject {
if r.MirrorToGitHub {
m[p] = true
}
}
return m
}

type cachedPullRequest struct {
Expand Down

0 comments on commit e50995e

Please sign in to comment.