Skip to content

Commit faa0b51

Browse files
committed
cmd/gerritbot: add all Gerrit projects to whitelist
Update golang/go#18517 Change-Id: I5ea227896265d5612b5efa60850f9e03b9025db6 Reviewed-on: https://go-review.googlesource.com/92937 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent f0cb684 commit faa0b51

File tree

1 file changed

+34
-13
lines changed

1 file changed

+34
-13
lines changed

Diff for: cmd/gerritbot/gerritbot.go

+34-13
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,38 @@ const (
183183
prefixGitFooterChangeID = "Change-Id:"
184184
)
185185

186-
var (
187-
// GitHub repos we accept PRs for, mirroring them into Gerrit CLs.
188-
githubRepoWhitelist = map[string]bool{
189-
"golang/scratch": true,
190-
}
191-
// Gerrit projects we accept PRs for.
192-
gerritProjectWhitelist = map[string]bool{
193-
"scratch": true,
194-
}
195-
)
186+
// Gerrit projects we accept PRs for.
187+
var gerritProjectWhitelist = map[string]bool{
188+
"benchmarks": true,
189+
"blog": true,
190+
"arch": true,
191+
"build": true,
192+
"crypto": true,
193+
"debug": true,
194+
"example": true,
195+
"exp": true,
196+
"gddo": true,
197+
"go": true,
198+
"image": true,
199+
"mobile": true,
200+
"net": true,
201+
"oauth2": true,
202+
"perf": true,
203+
"playground": true,
204+
"proposal": true,
205+
"review": true,
206+
"scratch": true,
207+
"sublime-build": true,
208+
"sublime-config": true,
209+
"sync": true,
210+
"sys": true,
211+
"talks": true,
212+
"term": true,
213+
"text": true,
214+
"time": true,
215+
"tools": true,
216+
"tour": true,
217+
}
196218

197219
type bot struct {
198220
githubClient *github.Client
@@ -276,14 +298,13 @@ func (b *bot) checkPullRequests() {
276298

277299
if err := b.corpus.GitHub().ForeachRepo(func(ghr *maintner.GitHubRepo) error {
278300
id := ghr.ID()
279-
ownerRepo := id.Owner + "/" + id.Repo
280-
if !githubRepoWhitelist[ownerRepo] {
301+
if id.Owner != "golang" || !gerritProjectWhitelist[id.Repo] {
281302
return nil
282303
}
283304
return ghr.ForeachIssue(func(issue *maintner.GitHubIssue) error {
284305
if issue.PullRequest && issue.Closed {
285306
// Clean up any reference of closed CLs within pendingCLs.
286-
shortLink := fmt.Sprintf("%s#%d", ownerRepo, issue.Number)
307+
shortLink := fmt.Sprintf("%s#%d", id.Owner+"/"+id.Repo, issue.Number)
287308
delete(b.pendingCLs, shortLink)
288309
return nil
289310
}

0 commit comments

Comments
 (0)