Signed-off-by: oppiliappan me@oppi.li
+1
appview/pages/pages.go
+1
appview/pages/pages.go
+5
-7
appview/pages/templates/repo/pulls/fragments/summarizedPullHeader.html
+5
-7
appview/pages/templates/repo/pulls/fragments/summarizedPullHeader.html
···
13
13
</span>
14
14
</div>
15
15
16
-
<div class="flex-shrink-0 flex items-center">
16
+
<div class="flex-shrink-0 flex items-center gap-2">
17
17
{{ $latestRound := .LastRoundNumber }}
18
18
{{ $lastSubmission := index .Submissions $latestRound }}
19
19
{{ $commentCount := len $lastSubmission.Comments }}
20
20
{{ if and $pipeline $pipeline.Id }}
21
-
<div class="inline-flex items-center gap-2">
22
-
{{ template "repo/pipelines/fragments/pipelineSymbol" $pipeline }}
23
-
<span class="mx-2 before:content-['·'] before:select-none"></span>
24
-
</div>
21
+
{{ template "repo/pipelines/fragments/pipelineSymbol" $pipeline }}
22
+
<span class="before:content-['·'] before:select-none text-gray-500 dark:text-gray-400"></span>
25
23
{{ end }}
26
24
<span>
27
-
<div class="inline-flex items-center gap-2">
25
+
<div class="inline-flex items-center gap-1">
28
26
{{ i "message-square" "w-3 h-3 md:hidden" }}
29
27
{{ $commentCount }}
30
28
<span class="hidden md:inline">comment{{if ne $commentCount 1}}s{{end}}</span>
31
29
</div>
32
30
</span>
33
-
<span class="mx-2 before:content-['·'] before:select-none"></span>
31
+
<span class="before:content-['·'] before:select-none text-gray-500 dark:text-gray-400"></span>
34
32
<span>
35
33
<span class="hidden md:inline">round</span>
36
34
<span class="font-mono">#{{ $latestRound }}</span>
+10
-3
appview/pages/templates/repo/pulls/pulls.html
+10
-3
appview/pages/templates/repo/pulls/pulls.html
···
54
54
<span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span>
55
55
</a>
56
56
</div>
57
-
<p class="text-sm text-gray-500 dark:text-gray-400 flex flex-wrap items-center gap-1">
57
+
<div class="text-sm text-gray-500 dark:text-gray-400 flex flex-wrap items-center gap-1">
58
58
{{ $owner := index $.DidHandleMap .OwnerDid }}
59
59
{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
60
60
{{ $icon := "ban" }}
···
103
103
#{{ .LastRoundNumber }}
104
104
</span>
105
105
</span>
106
-
</p>
106
+
107
+
{{ $pipeline := index $.Pipelines .LatestSha }}
108
+
{{ if $pipeline }}
109
+
<span class="before:content-['·']"></span>
110
+
{{ template "repo/pipelines/fragments/pipelineSymbol" $pipeline }}
111
+
{{ end }}
112
+
</div>
107
113
</div>
108
114
{{ if .StackId }}
109
115
{{ $otherPulls := index $.Stacks .StackId }}
···
135
141
{{ $root := index . 1 }}
136
142
<div class="grid grid-cols-1 rounded-b border-b border-t border-gray-200 dark:border-gray-900 divide-y divide-gray-200 dark:divide-gray-900">
137
143
{{ range $pull := $list }}
144
+
{{ $pipeline := index $root.Pipelines $pull.LatestSha }}
138
145
<a href="/{{ $root.RepoInfo.FullName }}/pulls/{{ $pull.PullId }}" class="no-underline hover:no-underline hover:bg-gray-100/25 hover:dark:bg-gray-700/25">
139
146
<div class="flex gap-2 items-center px-6">
140
147
<div class="flex-grow min-w-0 w-full py-2">
141
-
{{ template "repo/pulls/fragments/summarizedHeader" (list $pull 0) }}
148
+
{{ template "repo/pulls/fragments/summarizedHeader" (list $pull $pipeline) }}
142
149
</div>
143
150
</div>
144
151
</a>
+21
appview/pulls/pulls.go
+21
appview/pulls/pulls.go
···
555
555
556
556
// we want to group all stacked PRs into just one list
557
557
stacks := make(map[string]db.Stack)
558
+
var shas []string
558
559
n := 0
559
560
for _, p := range pulls {
561
+
// store the sha for later
562
+
shas = append(shas, p.LatestSha())
560
563
// this PR is stacked
561
564
if p.StackId != "" {
562
565
// we have already seen this PR stack
···
575
578
}
576
579
pulls = pulls[:n]
577
580
581
+
repoInfo := f.RepoInfo(user)
582
+
ps, err := db.GetPipelineStatuses(
583
+
s.db,
584
+
db.FilterEq("repo_owner", repoInfo.OwnerDid),
585
+
db.FilterEq("repo_name", repoInfo.Name),
586
+
db.FilterEq("knot", repoInfo.Knot),
587
+
db.FilterIn("sha", shas),
588
+
)
589
+
if err != nil {
590
+
log.Printf("failed to fetch pipeline statuses: %s", err)
591
+
// non-fatal
592
+
}
593
+
m := make(map[string]db.Pipeline)
594
+
for _, p := range ps {
595
+
m[p.Sha] = p
596
+
}
597
+
578
598
identsToResolve := make([]string, len(pulls))
579
599
for i, pull := range pulls {
580
600
identsToResolve[i] = pull.OwnerDid
···
596
616
DidHandleMap: didHandleMap,
597
617
FilteringBy: state,
598
618
Stacks: stacks,
619
+
Pipelines: m,
599
620
})
600
621
}
601
622