mirror of
https://github.com/golang/go
synced 2024-11-18 18:44:42 -07:00
go.tools/dashboard/app: show main repo commits with no build results
The UI template iterates over ResultGoHashes to display the Commit rows. This was done for the sub-repository build view, where it only makes sense to show a row when there's build data for it. However, in the main page UI we do want to see if a commit has hit the dashboard but has not yet been built. This change causes the dashboard to show the commit row even if there are no build results for it yet. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://golang.org/cl/153010043
This commit is contained in:
parent
4fb5eee0bd
commit
51be54e32f
@ -215,6 +215,12 @@ func (c *Commit) Results() (results []*Result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commit) ResultGoHashes() []string {
|
func (c *Commit) ResultGoHashes() []string {
|
||||||
|
// For the main repo, just return the empty string
|
||||||
|
// (there's no corresponding main repo hash for a main repo Commit).
|
||||||
|
// This function is only really useful for sub-repos.
|
||||||
|
if c.PackagePath == "" {
|
||||||
|
return []string{""}
|
||||||
|
}
|
||||||
var hashes []string
|
var hashes []string
|
||||||
for _, r := range c.ResultData {
|
for _, r := range c.ResultData {
|
||||||
p := strings.SplitN(r, "|", 4)
|
p := strings.SplitN(r, "|", 4)
|
||||||
|
Loading…
Reference in New Issue
Block a user