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

Unified Diff: milo/frontend/config.go

Issue 2955223002: Milo: Buildbucket PubSub ingestion outline (Closed)
Patch Set: rebase Created 3 years, 5 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
« no previous file with comments | « milo/common/pubsub_test.go ('k') | milo/frontend/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/frontend/config.go
diff --git a/milo/frontend/config.go b/milo/frontend/config.go
index 5f09ac28ed2dda7bf8251655462af8e3fff6291a..471d2638ee827145512de2b607a9256c7897b46b 100644
--- a/milo/frontend/config.go
+++ b/milo/frontend/config.go
@@ -8,6 +8,7 @@ import (
"net/http"
"cloud.google.com/go/datastore"
+ "google.golang.org/appengine"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/milo/common"
@@ -41,13 +42,21 @@ func ConfigsHandler(c *router.Context) {
// UpdateHandler is an HTTP handler that handles configuration update requests.
func UpdateConfigHandler(ctx *router.Context) {
c, h := ctx.Context, ctx.Writer
+ // Needed to access the PubSub API
+ c = appengine.WithContext(c, ctx.Request)
projErr := common.UpdateProjectConfigs(c)
if projErr != nil {
logging.WithError(projErr).Errorf(c, "project update handler encountered error")
}
- servErr := common.UpdateServiceConfig(c)
+ settings, servErr := common.UpdateServiceConfig(c)
if servErr != nil {
logging.WithError(servErr).Errorf(c, "service update handler encountered error")
+ } else {
+ servErr = common.EnsurePubSubSubscribed(c, settings)
+ if servErr != nil {
+ logging.WithError(servErr).Errorf(
+ c, "pubsub subscriber handler encountered error")
+ }
}
if projErr != nil || servErr != nil {
h.WriteHeader(http.StatusInternalServerError)
« no previous file with comments | « milo/common/pubsub_test.go ('k') | milo/frontend/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698