| OLD | NEW |
| 1 // Copyright 2017 The LUCI Authors. | 1 // Copyright 2017 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return nil, err | 60 return nil, err |
| 61 } | 61 } |
| 62 tGitiles := clock.Now(c) | 62 tGitiles := clock.Now(c) |
| 63 logging.Debugf(c, "Loading commits took %s.", tGitiles.Sub(tStart)) | 63 logging.Debugf(c, "Loading commits took %s.", tGitiles.Sub(tStart)) |
| 64 | 64 |
| 65 builderNames := make([]string, len(def.Builders)) | 65 builderNames := make([]string, len(def.Builders)) |
| 66 builders := make([]resp.BuilderRef, len(def.Builders)) | 66 builders := make([]resp.BuilderRef, len(def.Builders)) |
| 67 for i, b := range def.Builders { | 67 for i, b := range def.Builders { |
| 68 builderNames[i] = b | 68 builderNames[i] = b |
| 69 builders[i].Name = b | 69 builders[i].Name = b |
| 70 » » // TODO(hinoka): Add Categories and ShortNames back in. | 70 » » _, _, builders[i].ShortName, _ = buildsource.BuilderID(b).Split(
) |
| 71 » » // TODO(hinoka): Add Categories back in. |
| 71 } | 72 } |
| 72 | 73 |
| 73 commitNames := make([]string, len(commitInfo.Commits)) | 74 commitNames := make([]string, len(commitInfo.Commits)) |
| 74 for i, commit := range commitInfo.Commits { | 75 for i, commit := range commitInfo.Commits { |
| 75 commitNames[i] = hex.EncodeToString(commit.Hash) | 76 commitNames[i] = hex.EncodeToString(commit.Hash) |
| 76 } | 77 } |
| 77 rows, err := buildsource.GetConsoleRows(c, project, def, commitNames, bu
ilderNames) | 78 rows, err := buildsource.GetConsoleRows(c, project, def, commitNames, bu
ilderNames) |
| 78 tConsole := clock.Now(c) | 79 tConsole := clock.Now(c) |
| 79 logging.Debugf(c, "Loading the console took a total of %s.", tConsole.Su
b(tGitiles)) | 80 logging.Debugf(c, "Loading the console took a total of %s.", tConsole.Su
b(tGitiles)) |
| 80 if err != nil { | 81 if err != nil { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 193 } |
| 193 | 194 |
| 194 // ConsoleMainHandler is a redirect handler that redirects the user to the main | 195 // ConsoleMainHandler is a redirect handler that redirects the user to the main |
| 195 // console for a particular project. | 196 // console for a particular project. |
| 196 func ConsoleMainHandler(ctx *router.Context) { | 197 func ConsoleMainHandler(ctx *router.Context) { |
| 197 w, r, p := ctx.Writer, ctx.Request, ctx.Params | 198 w, r, p := ctx.Writer, ctx.Request, ctx.Params |
| 198 proj := p.ByName("project") | 199 proj := p.ByName("project") |
| 199 http.Redirect(w, r, fmt.Sprintf("/console/%s/main", proj), http.StatusMo
vedPermanently) | 200 http.Redirect(w, r, fmt.Sprintf("/console/%s/main", proj), http.StatusMo
vedPermanently) |
| 200 return | 201 return |
| 201 } | 202 } |
| OLD | NEW |