| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. | 1 // Copyright 2016 The LUCI Authors. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 func blame(b *buildbotBuild) (result []*resp.Commit) { | 390 func blame(b *buildbotBuild) (result []*resp.Commit) { |
| 391 if b.Sourcestamp != nil { | 391 if b.Sourcestamp != nil { |
| 392 for _, c := range b.Sourcestamp.Changes { | 392 for _, c := range b.Sourcestamp.Changes { |
| 393 files := c.GetFiles() | 393 files := c.GetFiles() |
| 394 result = append(result, &resp.Commit{ | 394 result = append(result, &resp.Commit{ |
| 395 AuthorEmail: c.Who, | 395 AuthorEmail: c.Who, |
| 396 Repo: c.Repository, | 396 Repo: c.Repository, |
| 397 CommitTime: time.Unix(int64(c.When), 0).UTC(), | 397 CommitTime: time.Unix(int64(c.When), 0).UTC(), |
| 398 Revision: resp.NewLink(c.Revision, c.Revlink)
, | 398 Revision: resp.NewLink(c.Revision, c.Revlink)
, |
| 399 Description: c.Comments, | 399 Description: c.Comments, |
| 400 Title: strings.Split(c.Comments, "\n")[0], | |
| 401 File: files, | 400 File: files, |
| 402 }) | 401 }) |
| 403 } | 402 } |
| 404 } | 403 } |
| 405 return | 404 return |
| 406 } | 405 } |
| 407 | 406 |
| 408 // sourcestamp extracts the source stamp from various parts of a buildbot build, | 407 // sourcestamp extracts the source stamp from various parts of a buildbot build, |
| 409 // including the properties. | 408 // including the properties. |
| 410 func sourcestamp(c context.Context, b *buildbotBuild) *resp.SourceStamp { | 409 func sourcestamp(c context.Context, b *buildbotBuild) *resp.SourceStamp { |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 | 697 |
| 699 if b.Master == "" { | 698 if b.Master == "" { |
| 700 return nil, errors.New("Master name is required", common.CodePar
ameterError) | 699 return nil, errors.New("Master name is required", common.CodePar
ameterError) |
| 701 } | 700 } |
| 702 if b.BuilderName == "" { | 701 if b.BuilderName == "" { |
| 703 return nil, errors.New("BuilderName name is required", common.Co
deParameterError) | 702 return nil, errors.New("BuilderName name is required", common.Co
deParameterError) |
| 704 } | 703 } |
| 705 | 704 |
| 706 return Build(c, b.Master, b.BuilderName, int(num)) | 705 return Build(c, b.Master, b.BuilderName, int(num)) |
| 707 } | 706 } |
| OLD | NEW |