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

Unified Diff: milo/buildsource/rawpresentation/logDogBuild.go

Issue 2984143002: Milo Swarmbucket: Use got_revision as revision (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/buildsource/rawpresentation/logDogBuild.go
diff --git a/milo/buildsource/rawpresentation/logDogBuild.go b/milo/buildsource/rawpresentation/logDogBuild.go
index c4a3de6e6b98b6472a02af48afabe2f13979e7e5..668c66d8a419da805f0aacc8ff98163e983ab1bc 100644
--- a/milo/buildsource/rawpresentation/logDogBuild.go
+++ b/milo/buildsource/rawpresentation/logDogBuild.go
@@ -15,6 +15,7 @@
package rawpresentation
import (
+ "encoding/json"
"fmt"
"time"
@@ -205,6 +206,7 @@ func AddLogDogToBuild(
// TODO(hinoka): This is totes cachable.
buildCompletedTime := google.TimeFromProto(mainAnno.Ended)
build.Summary = *(miloBuildStep(ub, mainAnno, true, buildCompletedTime, now)[0])
+ propMap := map[string]string{}
for _, substepContainer := range mainAnno.Substep {
anno := substepContainer.GetStep()
if anno == nil {
@@ -225,6 +227,7 @@ func AddLogDogToBuild(
Key: prop.Name,
Value: prop.Value,
})
+ propMap[prop.Name] = prop.Value
}
build.PropertyGroup = append(build.PropertyGroup, propGroup)
}
@@ -237,8 +240,23 @@ func AddLogDogToBuild(
Key: prop.Name,
Value: prop.Value,
})
+ propMap[prop.Name] = prop.Value
}
build.PropertyGroup = append(build.PropertyGroup, propGroup)
+ // HACK(hinoka,iannucci): Extract revision out of properties.
+ if jrev, ok := propMap["got_revision"]; ok {
+ // got_revision is a json string, so it looks like "aaaaaabbcc123..."
+ var rev string
+ err := json.Unmarshal([]byte(jrev), &rev)
+ if err == nil {
+ if build.SourceStamp == nil {
+ build.SourceStamp = &resp.SourceStamp{}
+ }
+ build.SourceStamp.Revision = resp.NewLink(
+ rev, fmt.Sprintf("https://crrev.com/%s", rev))
+ }
+ }
+
return
}
« 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