From 1bd538f42c8ec8512d864f739dd98dce3d41256a Mon Sep 17 00:00:00 2001 From: Zubin Mithra Date: Thu, 1 Aug 2019 13:53:11 -0700 Subject: dashboard/app: remove duplicate code inside bug.html template * Introduce "bisect_results" inside templates.html to take in a uiJob and shows its contents. * Modify bug.html to use "bisect_results" to show BisectCause and BisectFix uiJob. --- dashboard/app/bug.html | 71 ++------------------------------------------------ 1 file changed, 2 insertions(+), 69 deletions(-) (limited to 'dashboard/app/bug.html') diff --git a/dashboard/app/bug.html b/dashboard/app/bug.html index 2efb75a8c..829c0b172 100644 --- a/dashboard/app/bug.html +++ b/dashboard/app/bug.html @@ -25,75 +25,8 @@ Page with details about a single bug. {{end}} First crash: {{formatLateness $.Now $.Bug.FirstTime}}, last: {{formatLateness $.Now $.Bug.LastTime}}
- {{with $bisect := .BisectCause}}
- {{if $bisect.ErrorLink}} - Bisection: {{link $bisect.ErrorLink "error"}} - ({{link $bisect.LogLink "bisect log"}})
- {{else if $bisect.Commit}}{{with $com := $bisect.Commit}} - Bisection: introduced by - ({{link $bisect.LogLink "bisect log"}}):
-
- commit {{$com.Hash}}
- Author: {{$com.Author}}
- Date: {{formatKernelTime $com.Date}}
-
-   {{$com.Title}}
-

- {{end}}{{else if $bisect.Commits}}{{with $bisect.Commits}} - Bisection: the first bad commit could be any of - ({{link $bisect.LogLink "bisect log"}}):
-
- {{range $com := $bisect.Commits}} -   {{formatTagHash $com.Hash}} {{$com.Title}}
- {{end}} -

- {{end}}{{else}} - Bisection: the bug happens on the oldest tested release - ({{link $bisect.LogLink "bisect log"}})
- {{end}} - Tree: {{$bisect.KernelAlias}}
- {{if $bisect.CrashLogLink}} - Crash: {{link $bisect.CrashReportLink $bisect.CrashTitle}} ({{link $bisect.CrashLogLink "log"}})
- {{end}} - Repro: {{optlink $bisect.Crash.ReproCLink "C"}} - {{optlink $bisect.Crash.ReproSyzLink "syz"}} - {{optlink $bisect.Crash.KernelConfigLink ".config"}}
- {{end}} - - {{with $bisect := .BisectFix}}
- {{if $bisect.ErrorLink}} - Bisection: {{link $bisect.ErrorLink "error"}} - ({{link $bisect.LogLink "bisect log"}})
- {{else if $bisect.Commit}}{{with $com := $bisect.Commit}} - Bisection: fixed by - ({{link $bisect.LogLink "bisect log"}}):
-
- commit {{$com.Hash}}
- Author: {{$com.Author}}
- Date: {{formatKernelTime $com.Date}}
-
-   {{$com.Title}}
-

- {{end}}{{else if $bisect.Commits}}{{with $bisect.Commits}} - Bisection: the fix commit could be any of - ({{link $bisect.LogLink "bisect log"}}):
-
- {{range $com := $bisect.Commits}} -   {{formatTagHash $com.Hash}} {{$com.Title}}
- {{end}} -

- {{end}}{{else}} - Bisection: the bug occurs on the newest tested release - ({{link $bisect.LogLink "bisect log"}})
- {{end}} - Tree: {{$bisect.KernelAlias}}
- {{if $bisect.CrashLogLink}} - Crash: {{link $bisect.CrashReportLink $bisect.CrashTitle}} ({{link $bisect.CrashLogLink "log"}})
- {{end}} - Repro: {{optlink $bisect.Crash.ReproCLink "C"}} - {{optlink $bisect.Crash.ReproSyzLink "syz"}} - {{optlink $bisect.Crash.KernelConfigLink ".config"}}
- {{end}} + {{template "bisect_results" .BisectCause}} + {{template "bisect_results" .BisectFix}} {{template "bug_list" .DupOf}} {{template "bug_list" .Dups}} -- cgit mrf-deployment