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

Side by Side Diff: go/src/infra/tools/kitchen/cook.go

Issue 2173313002: kitchen: fix emission of annotations (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 main 5 package main
6 6
7 import ( 7 import (
8 "encoding/json" 8 "encoding/json"
9 "fmt" 9 "fmt"
10 "io/ioutil" 10 "io/ioutil"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 props, err := parseProperties(c.Properties, c.PropertiesFile) 220 props, err := parseProperties(c.Properties, c.PropertiesFile)
221 if err != nil { 221 if err != nil {
222 fmt.Fprintf(os.Stderr, "could not parse properties: %s", err) 222 fmt.Fprintf(os.Stderr, "could not parse properties: %s", err)
223 return 1 223 return 1
224 } 224 }
225 225
226 // Let infra_path recipe module know that we are using swarmbucket paths . 226 // Let infra_path recipe module know that we are using swarmbucket paths .
227 // Relevant code: 227 // Relevant code:
228 // https://chromium.googlesource.com/chromium/tools/depot_tools/+/248331 450c05c59c8e966c806f00bd2475e36603/recipe_modules/infra_paths/api.py#12 228 // https://chromium.googlesource.com/chromium/tools/depot_tools/+/248331 450c05c59c8e966c806f00bd2475e36603/recipe_modules/infra_paths/api.py#12
229 // https://chromium.googlesource.com/chromium/tools/depot_tools/+/248331 450c05c59c8e966c806f00bd2475e36603/recipe_modules/infra_paths/path_config.py#57 229 // https://chromium.googlesource.com/chromium/tools/depot_tools/+/248331 450c05c59c8e966c806f00bd2475e36603/recipe_modules/infra_paths/path_config.py#57
230 if _, ok := props["path_config"]; ok {
231 fmt.Fprintln(os.Stderr, `"path_config" property must not be set; it is reserved by kitchen`)
232 }
230 props["path_config"] = "swarmbucket" 233 props["path_config"] = "swarmbucket"
231 234
232 // If we're not using LogDog, send out annotations. 235 // If we're not using LogDog, send out annotations.
233 bootstapSuccess := true 236 bootstapSuccess := true
234 » if !c.logdog.emitAnnotations() { 237 » if c.logdog.emitAnnotations() {
235 if c.Timestamps { 238 if c.Timestamps {
236 annotateTime(ctx) 239 annotateTime(ctx)
237 } 240 }
238 annotate("SEED_STEP", BootstrapStepName) 241 annotate("SEED_STEP", BootstrapStepName)
239 annotate("STEP_CURSOR", BootstrapStepName) 242 annotate("STEP_CURSOR", BootstrapStepName)
240 if c.Timestamps { 243 if c.Timestamps {
241 annotateTime(ctx) 244 annotateTime(ctx)
242 } 245 }
243 annotate("STEP_STARTED") 246 annotate("STEP_STARTED")
244 defer func() { 247 defer func() {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 305 }
303 306
304 func annotateTime(ctx context.Context) { 307 func annotateTime(ctx context.Context) {
305 timestamp := clock.Get(ctx).Now().Unix() 308 timestamp := clock.Get(ctx).Now().Unix()
306 annotate("CURRENT_TIMESTAMP", strconv.FormatInt(timestamp, 10)) 309 annotate("CURRENT_TIMESTAMP", strconv.FormatInt(timestamp, 10))
307 } 310 }
308 311
309 func annotate(args ...string) { 312 func annotate(args ...string) {
310 fmt.Printf("@@@%s@@@\n", strings.Join(args, "@")) 313 fmt.Printf("@@@%s@@@\n", strings.Join(args, "@"))
311 } 314 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698