Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(839)

Unified Diff: milo/appengine/buildbot/master.go

Issue 2271453002: Milo: Internal buildbot masters support (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: More places Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: milo/appengine/buildbot/master.go
diff --git a/milo/appengine/buildbot/master.go b/milo/appengine/buildbot/master.go
index a31cf96fcec93116d35ee2c3fdb35f783fdc9ac3..5f1990cf538e31cccd990450c3ad73996f7678eb 100644
--- a/milo/appengine/buildbot/master.go
+++ b/milo/appengine/buildbot/master.go
@@ -60,8 +60,6 @@ func GetAllBuilders(c context.Context) (*resp.Module, error) {
// Fetch all Master entries from datastore
ds := datastore.Get(c)
q := datastore.NewQuery("buildbotMasterEntry")
- // TODO(hinoka): Support internal queries.
- q = q.Eq("Internal", false)
// TODO(hinoka): Maybe don't look past like a month or so?
entries := []*buildbotMasterEntry{}
err := ds.GetAll(q, &entries)
@@ -72,6 +70,13 @@ func GetAllBuilders(c context.Context) (*resp.Module, error) {
// Add each builder from each master entry into the result.
// TODO(hinoka): FanInOut this?
for _, entry := range entries {
+ if entry.Internal {
+ // Bypass the master if it's an internal master and the user is not
+ // part of the buildbot-private project.
+ if !settings.IsAllowed(c, "buildbot-private") {
Vadim Sh. 2016/08/23 18:53:06 errors like this is why its better to deduplicate
Ryan Tseng 2016/08/23 22:00:15 doh
+ continue
+ }
+ }
master := &buildbotMaster{}
err = decodeMasterEntry(c, entry, master)
if err != nil {
@@ -79,7 +84,6 @@ func GetAllBuilders(c context.Context) (*resp.Module, error) {
continue
}
ml := resp.MasterListing{Name: entry.Name}
- // TODO(hinoka): Sort
// Sort the builder listing.
sb := make([]string, 0, len(master.Builders))
for bn := range master.Builders {

Powered by Google App Engine
This is Rietveld 408576698