aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2023-12-27 13:53:36 +0100
committerÖzgür Kesim <oec@codeblau.de>2023-12-27 13:53:36 +0100
commit3fb0453a86f0f2f6f68d26b6fe38942c765dbbc7 (patch)
tree835c7d7849019e142c382da91306145f0eb4c608
parent475fc7c257733d04e99dfc5dea8006c234b46d7f (diff)
seperate features from issues
-rw-r--r--data.go87
-rw-r--r--list.tmpl25
-rw-r--r--table.tmpl30
3 files changed, 127 insertions, 15 deletions
diff --git a/data.go b/data.go
index 4f92795..8ee87a7 100644
--- a/data.go
+++ b/data.go
@@ -28,6 +28,8 @@ import (
"io"
"log"
"net/http"
+ "runtime/debug"
+ "sort"
"strings"
"sync"
"time"
@@ -44,6 +46,7 @@ type Data struct {
ctx context.Context
Issues Issues
+ Features Issues
Projects Projects
Timestamp time.Time
Freq time.Duration
@@ -128,14 +131,20 @@ func (d *Data) update() {
// Filter issues with old target versions out
var issues = Issues{}
+ var features = Issues{}
for _, issue := range iss.Issues {
if issue.Resolution.Name == "open" &&
strings.Compare(d.minimumVersion, issue.TargetVersion.Name) < 0 {
- issues = append(issues, issue)
+ if issue.Severity.Name == "feature" {
+ features = append(features, issue)
+ } else {
+ issues = append(issues, issue)
+ }
}
}
d.Issues = issues
- fmt.Println("got", len(issues), "issues")
+ d.Features = features
+ fmt.Println("got", len(iss.Issues), "entries: ", len(features), "features and ", len(issues), "issues")
}
func (d *Data) Loop() {
@@ -175,3 +184,77 @@ func (d *Data) printTemplate(w io.Writer, name string) {
log.Println(e)
}
}
+
+func (d *Data) TargetVersions() (tv []string) {
+ d.mux.RLock()
+ defer d.mux.RUnlock()
+
+ var m = map[string]bool{}
+ for _, s := range d.Issues.TargetVersions() {
+ m[s] = true
+ }
+ for _, s := range d.Features.TargetVersions() {
+ m[s] = true
+ }
+ for s := range m {
+ tv = append(tv, s)
+ }
+ sort.Strings(tv)
+ return
+}
+
+func (d *Data) Categories() (cs []string) {
+ d.mux.RLock()
+ defer d.mux.RUnlock()
+
+ var m = map[string]bool{}
+ for _, s := range d.Issues.Categories() {
+ m[s] = true
+ }
+ for _, s := range d.Features.Categories() {
+ m[s] = true
+ }
+ for s := range m {
+ cs = append(cs, s)
+ }
+ sort.Strings(cs)
+ return
+}
+
+func (d *Data) Tags() (ts []string) {
+ d.mux.RLock()
+ defer d.mux.RUnlock()
+
+ var m = map[string]bool{}
+ for _, s := range d.Issues.Tags() {
+ m[s] = true
+ }
+ for _, s := range d.Features.Tags() {
+ m[s] = true
+ }
+ for s := range m {
+ ts = append(ts, s)
+ }
+ sort.Strings(ts)
+ return
+}
+
+func (d *Data) Commit() string {
+ var version, timestamp = "<unknown>", "<unknown>"
+ if info, ok := debug.ReadBuildInfo(); ok {
+ for _, setting := range info.Settings {
+ switch setting.Key {
+ case "vcs.revision":
+ n := len(setting.Value)
+ if n > 8 {
+ n = 8
+ }
+ version = setting.Value[:n]
+ case "vcs.time":
+ timestamp = setting.Value
+ }
+ }
+ }
+
+ return version + " from " + timestamp
+}
diff --git a/list.tmpl b/list.tmpl
index cb8d63a..6442237 100644
--- a/list.tmpl
+++ b/list.tmpl
@@ -9,9 +9,12 @@ body {
h3 {
color: brown;
}
+h4 {
+ margin-left: 5%;
+}
details {
- margin-left: 10%;
- margin-right: 10%;
+ margin-left: 5%;
+ margin-right: 5%;
}
pre {
max-width: 100%;
@@ -25,15 +28,25 @@ pre {
Data from {{ .Timestamp.Format "02 Jan 06 15:04 MST"}}, updateting every {{ .Freq }} (no auto-refresh)
{{ with .Lasterror }}, Last error: {{ . }} {{end}}
- <!-- p>
+ {{ $top := . }}
+ {{ $features := .Features }}
{{ $issues := .Issues }}
- {{ range $issues.Tags }}
+ <!-- p>
+ {{ range $top.Tags }}
<button>{{ . }}</button>
{{ end }}
</p -->
- {{ range $cat := $issues.Categories }}
+ {{ range $cat := $top.Categories }}
<h3>{{ . }}</h3>
+ <h4>Features</h4>
+ {{ range $features.ByCategory $cat }}
+ <details>
+ <summary><a href="https://bugs.gnunet.org/view.php?id={{.Id}}" target="_blank">{{.Id}}</a> {{.Summary}}</summary>
+ <pre>{{ .Description }}</pre>
+ </details>
+ {{ end }}
+ <h4>Issues</h4>
{{ range $issues.ByCategory $cat }}
<details>
<summary><a href="https://bugs.gnunet.org/view.php?id={{.Id}}" target="_blank">{{.Id}}</a> {{.Summary}}</summary>
@@ -42,6 +55,6 @@ pre {
{{ end }}
{{ end }}
<p>
- <i>end of dashboard - <a href="https://git.kesim.org/taler/taler-dashboard">https://git.kesim.org/taler/taler-dashboard</a> </i>
+ <i>taler-dashboard - version: {{.Commit}} - <a href="https://git.kesim.org/taler/taler-dashboard">https://git.kesim.org/taler/taler-dashboard</a> </i>
</body>
</html>
diff --git a/table.tmpl b/table.tmpl
index 60ca873..886d466 100644
--- a/table.tmpl
+++ b/table.tmpl
@@ -28,11 +28,16 @@ tr:hover {
.normal {
font-weight: normal;
}
-.data {
+.feature {
background: #cde;
border-radius: 5px;
padding: 8px;
}
+.issue {
+ background: #edc;
+ border-radius: 5px;
+ padding: 8px;
+}
details {
max-width: 30em;
overflow-x: auto;
@@ -50,9 +55,11 @@ details {
Data from {{ .Timestamp.Format "02 Jan 06 15:04 MST"}}, updateting every {{ .Freq }} (no auto-refresh)
{{ with .Lasterror }}, Last error: {{ . }} {{end}}
+ {{ $top := . }}
+ {{ $features := .Features }}
{{ $issues := .Issues }}
<!--p>
- {{ range $issues.Tags }}
+ {{ range $top.Tags }}
<button>{{ . }}</button>
{{ end }}
</p-->
@@ -60,7 +67,7 @@ details {
<table>
<tr>
<th class="side"></th>
- {{ range $issues.TargetVersions }}
+ {{ range $top.TargetVersions }}
<th>
<details>
<summary>{{ . }}</summary>
@@ -71,13 +78,22 @@ details {
</th>
{{ end }}
</tr>
- {{ range $cat := $issues.Categories }}
+ {{ range $cat := $top.Categories }}
<tr>
<th class="side">{{ . }}</th>
- {{ range $tar := $issues.TargetVersions }}
+ {{ range $tar := $top.TargetVersions }}
<td>
+ {{ with $features.ByCategoryAndTarget $cat $tar }}
+ <details class="feature">
+ <summary>{{ $l := len .}} {{ if lt 1 $l }} {{ $l }} features {{ else }} 1 feature {{ end }} </summary>
+ {{ range . }}
+ <a href="https://bugs.gnunet.org/view.php?id={{.Id}}" target="_blank">{{.Id}}</a> {{.Summary}}<br>
+ {{ end }}
+ </details>
+ {{ end }}
+
{{ with $issues.ByCategoryAndTarget $cat $tar }}
- <details class="data">
+ <details class="issue">
<summary>{{ $l := len .}} {{ if lt 1 $l }} {{ $l }} issues {{ else }} 1 issue {{ end }} </summary>
{{ range . }}
<a href="https://bugs.gnunet.org/view.php?id={{.Id}}" target="_blank">{{.Id}}</a> {{.Summary}}<br>
@@ -91,6 +107,6 @@ details {
</table>
<p>
- <i>end of dashboard - <a href="https://git.kesim.org/taler/taler-dashboard">https://git.kesim.org/taler/taler-dashboard</a> </i>
+ <i>taler-dashboard - version: {{.Commit}} - <a href="https://git.kesim.org/taler/taler-dashboard">https://git.kesim.org/taler/taler-dashboard</a> </i>
</body>
</html>