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

Unified Diff: milo/appengine/buildbucket/common.go

Issue 2768203002: Milo: Fix Gerrit CL reporting in buildbucket view (Closed)
Patch Set: Review Created 3 years, 9 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 | milo/appengine/buildbucket/properties.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbucket/common.go
diff --git a/milo/appengine/buildbucket/common.go b/milo/appengine/buildbucket/common.go
index a9a4f90b6399548e3cff53b7915ca9f13535bba5..c10d192df5c45e74620f8582246f910921dad6a4 100644
--- a/milo/appengine/buildbucket/common.go
+++ b/milo/appengine/buildbucket/common.go
@@ -104,8 +104,9 @@ func parseStatus(build *buildbucket.ApiBuildMessage) (resp.Status, error) {
}
// getChangeList tries to extract CL information from a buildbucket build.
-func getChangeList(build *buildbucket.ApiBuildMessage, params *buildParameters, resultDetails *resultDetails) *resp.Commit {
- var result *resp.Commit
+func getChangeList(
+ build *buildbucket.ApiBuildMessage, params *buildParameters,
+ resultDetails *resultDetails) (result *resp.Commit) {
prop := &params.Properties
switch prop.PatchStorage {
@@ -122,13 +123,16 @@ func getChangeList(build *buildbucket.ApiBuildMessage, params *buildParameters,
}
case "gerrit":
- if prop.GerritURL != "" && prop.GerritChangeNumber != 0 {
+ if prop.GerritPatchURL != "" && prop.GerritPatchIssue != 0 {
+ path := fmt.Sprintf("%d", prop.GerritPatchIssue)
+ if prop.GerritPatchSet != 0 {
+ path = fmt.Sprintf("%d/%d", prop.GerritPatchIssue, prop.GerritPatchSet)
+ }
result = &resp.Commit{
- Revision: prop.GerritPatchRef,
- RequestRevision: prop.GerritPatchRef,
Changelist: &resp.Link{
- Label: fmt.Sprintf("Gerrit CL %d", prop.GerritChangeNumber),
- URL: prop.GerritChangeURL,
+ Label: fmt.Sprintf("Gerrit CL %d", prop.GerritPatchIssue),
+ URL: fmt.Sprintf(
+ "%s/c/%s", prop.GerritPatchURL, path),
},
}
}
@@ -139,5 +143,5 @@ func getChangeList(build *buildbucket.ApiBuildMessage, params *buildParameters,
result.AuthorEmail = params.Changes[0].Author.Email
}
- return result
+ return
}
« no previous file with comments | « no previous file | milo/appengine/buildbucket/properties.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698