| OLD | NEW |
| 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 buildbot | 5 package buildbot |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "encoding/json" | 8 "encoding/json" |
| 9 "errors" | 9 "errors" |
| 10 "fmt" | 10 "fmt" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 | 387 |
| 388 // blame extracts the commit and blame information from a buildbot build and | 388 // blame extracts the commit and blame information from a buildbot build and |
| 389 // returns it as a list of Commits. | 389 // returns it as a list of Commits. |
| 390 func blame(b *buildbotBuild) (result []*resp.Commit) { | 390 func blame(b *buildbotBuild) (result []*resp.Commit) { |
| 391 for _, c := range b.Sourcestamp.Changes { | 391 for _, c := range b.Sourcestamp.Changes { |
| 392 files := c.GetFiles() | 392 files := c.GetFiles() |
| 393 result = append(result, &resp.Commit{ | 393 result = append(result, &resp.Commit{ |
| 394 AuthorEmail: c.Who, | 394 AuthorEmail: c.Who, |
| 395 Repo: c.Repository, | 395 Repo: c.Repository, |
| 396 » » » CommitTime: time.Unix(int64(c.When), 0), | 396 » » » CommitTime: time.Unix(int64(c.When), 0).UTC(), |
| 397 Revision: &resp.Link{ | 397 Revision: &resp.Link{ |
| 398 URL: c.Revlink, | 398 URL: c.Revlink, |
| 399 Label: c.Revision, | 399 Label: c.Revision, |
| 400 }, | 400 }, |
| 401 Description: c.Comments, | 401 Description: c.Comments, |
| 402 Title: strings.Split(c.Comments, "\n")[0], | 402 Title: strings.Split(c.Comments, "\n")[0], |
| 403 File: files, | 403 File: files, |
| 404 }) | 404 }) |
| 405 } | 405 } |
| 406 return | 406 return |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 var newAliases map[string][]*buildbotLinkAlias | 643 var newAliases map[string][]*buildbotLinkAlias |
| 644 if l := remainingAliases.Len(); l > 0 { | 644 if l := remainingAliases.Len(); l > 0 { |
| 645 newAliases = make(map[string][]*buildbotLinkAlias, l) | 645 newAliases = make(map[string][]*buildbotLinkAlias, l) |
| 646 remainingAliases.Iter(func(v string) bool { | 646 remainingAliases.Iter(func(v string) bool { |
| 647 newAliases[v] = s.Aliases[v] | 647 newAliases[v] = s.Aliases[v] |
| 648 return true | 648 return true |
| 649 }) | 649 }) |
| 650 } | 650 } |
| 651 s.Aliases = newAliases | 651 s.Aliases = newAliases |
| 652 } | 652 } |
| OLD | NEW |