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

Unified Diff: client/cmd/kitchen/cook.go

Issue 1868553006: kitchen: emit valid JSON for SET_BUILD_PROPERTY annotations (Closed) Base URL: https://github.com/luci/luci-go.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/kitchen/cook.go
diff --git a/client/cmd/kitchen/cook.go b/client/cmd/kitchen/cook.go
index fc6eb923562dfd66a434065bf3671a6c3793a0b1..3ed4b453994eff416ec95a0b99754850a30b97f7 100644
--- a/client/cmd/kitchen/cook.go
+++ b/client/cmd/kitchen/cook.go
@@ -182,7 +182,12 @@ func (c *cookRun) Run(a subcommands.Application, args []string) (exitCode int) {
}
for k, v := range props {
// Order is not stable, but that is okay.
- annotate("SET_BUILD_PROPERTY", k, fmt.Sprintf("%v", v))
+ jv, err := json.Marshal(v)
+ if err != nil {
+ fmt.Fprintln(os.Stderr, err)
+ return 1
+ }
+ annotate("SET_BUILD_PROPERTY", k, string(jv))
}
recipeExitCode, err := c.run(app.Context)
« 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