Skip to content

Commit 1ca44b1

Browse files
committed
Fix package links in HTML report
1 parent b5584c5 commit 1ca44b1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/leeway/reporter.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ func (r *WerftReporter) PackageBuildFinished(pkg *Package, rep *PackageBuildRepo
278278
}
279279

280280
type HTMLPackageReport struct {
281+
ID string
281282
logs strings.Builder
282283
start time.Time
283284
duration time.Duration
@@ -363,7 +364,10 @@ func (r *HTMLReporter) getReport(pkg *Package) *HTMLPackageReport {
363364
return rep
364365
}
365366

366-
rep = &HTMLPackageReport{status: PackageNotBuiltYet}
367+
rep = &HTMLPackageReport{
368+
ID: pkg.FilesystemSafeName(),
369+
status: PackageNotBuiltYet,
370+
}
367371
r.reports[name] = rep
368372
r.mu.Unlock()
369373
}
@@ -425,14 +429,14 @@ func (r *HTMLReporter) Report() {
425429
<td>{{ $report.StatusIcon }}</td>
426430
<td>{{ $pkg }}</td>
427431
<td>{{ $report.DurationInSeconds -}}</td>
428-
<td><a href="#{{ $pkg }}">See below</td>
432+
<td><a href="#{{ $report.ID }}">See below</td>
429433
</tr>
430434
{{- end }}
431435
</tbody>
432436
<table>
433-
<p>For details around each package, see below<p>
437+
<p>For details about each package, see below<p>
434438
{{- range $pkg, $report := .Packages }}
435-
<h2 id="{{ $pkg }}">{{ $pkg }}</h2>
439+
<h2 id="{{ $report.ID }}">{{ $report.StatusIcon }} {{ $pkg }}</h2>
436440
{{ if $report.HasError -}}
437441
<details open>
438442
<summary>Error message</summary>

0 commit comments

Comments
 (0)