| 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 := ¶ms.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
|
| }
|
|
|