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

Side by Side Diff: milo/appengine/buildbot/pubsub.go

Issue 2784073002: Milo: Fix naming of pubsub settings (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « milo/appengine/buildbot/build_test.go ('k') | milo/common/config/settings.proto » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package buildbot 5 package buildbot
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "compress/gzip" 9 "compress/gzip"
10 "compress/zlib" 10 "compress/zlib"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // Get the name of the subscription on luci-config 306 // Get the name of the subscription on luci-config
307 settings, err := common.GetSettings(c) 307 settings, err := common.GetSettings(c)
308 if err != nil { 308 if err != nil {
309 logging.WithError(err).Errorf(c, 309 logging.WithError(err).Errorf(c,
310 "Cannot load settings to check subscription name.") 310 "Cannot load settings to check subscription name.")
311 // This is a configuration error. Tell PubSub to retry until we fix our 311 // This is a configuration error. Tell PubSub to retry until we fix our
312 // configs. 312 // configs.
313 return http.StatusInternalServerError 313 return http.StatusInternalServerError
314 } 314 }
315 switch msg.Subscription { 315 switch msg.Subscription {
316 » case settings.Buildbot.PublicTopic: 316 » case settings.Buildbot.PublicSubscription:
317 internal = false 317 internal = false
318 » case settings.Buildbot.InternalTopic: 318 » case settings.Buildbot.InternalSubscription:
319 // internal = true, but that's already set. 319 // internal = true, but that's already set.
320 default: 320 default:
321 logging.Errorf( 321 logging.Errorf(
322 c, "Subscription name %s does not match %s or %s", 322 c, "Subscription name %s does not match %s or %s",
323 » » » msg.Subscription, settings.Buildbot.PublicTopic, 323 » » » msg.Subscription, settings.Buildbot.PublicSubscription,
324 » » » settings.Buildbot.InternalTopic) 324 » » » settings.Buildbot.InternalSubscription)
325 // This is a configuration error. Tell PubSub to retry until we fix our 325 // This is a configuration error. Tell PubSub to retry until we fix our
326 // configs. 326 // configs.
327 return http.StatusInternalServerError 327 return http.StatusInternalServerError
328 } 328 }
329 logging.Infof( 329 logging.Infof(
330 c, "Message ID \"%s\" from subscription %s is %d bytes long", 330 c, "Message ID \"%s\" from subscription %s is %d bytes long",
331 msg.Message.MessageID, msg.Subscription, r.ContentLength) 331 msg.Message.MessageID, msg.Subscription, r.ContentLength)
332 bbMsg, err := msg.GetData() 332 bbMsg, err := msg.GetData()
333 if err != nil { 333 if err != nil {
334 logging.WithError(err).Errorf(c, "Could not base64 decode messag e %s", err) 334 logging.WithError(err).Errorf(c, "Could not base64 decode messag e %s", err)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 405
406 } 406 }
407 if master != nil { 407 if master != nil {
408 code := doMaster(c, master, internal) 408 code := doMaster(c, master, internal)
409 if code != 0 { 409 if code != 0 {
410 return code 410 return code
411 } 411 }
412 } 412 }
413 return http.StatusOK 413 return http.StatusOK
414 } 414 }
OLDNEW
« no previous file with comments | « milo/appengine/buildbot/build_test.go ('k') | milo/common/config/settings.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698