From e76f02fc52edc439531549611dd5635a59a62763 Mon Sep 17 00:00:00 2001
From: Tom Martensen
Date: Tue, 3 Nov 2026 11:37:15 +0100
Subject: [PATCH 01/28] add relacs serve command with tag page
Adds a local HTTP server (relacs serve) that presents release
information as web pages. The tag page at /tag?tag= shows pipeline
runs, artifacts, conforma violations, and the operator index image
fetched live from Konflux.
Co-Authored-By: Claude Opus 4.6
---
cmd/relacs/main.go | 2 +
cmd/relacs/serve/cmd.go | 95 +++++++
cmd/relacs/serve/handlers.go | 43 +++
cmd/relacs/serve/templates/base.html | 17 ++
cmd/relacs/serve/templates/home.html | 26 ++
cmd/relacs/serve/templates/static/style.css | 108 ++++++++
cmd/relacs/serve/templates/tag.html | 189 +++++++++++++
pkg/serve/tag.go | 288 ++++++++++++++++++++
8 files changed, 768 insertions(+)
create mode 100644 cmd/relacs/serve/cmd.go
create mode 100644 cmd/relacs/serve/handlers.go
create mode 100644 cmd/relacs/serve/templates/base.html
create mode 100644 cmd/relacs/serve/templates/home.html
create mode 100644 cmd/relacs/serve/templates/static/style.css
create mode 100644 cmd/relacs/serve/templates/tag.html
create mode 100644 pkg/serve/tag.go
diff --git a/cmd/relacs/main.go b/cmd/relacs/main.go
index 5c9763a..5986e0c 100644
--- a/cmd/relacs/main.go
+++ b/cmd/relacs/main.go
@@ -10,6 +10,7 @@ import (
"github.com/spf13/cobra"
"github.com/stackrox/relacs/cmd/relacs/github"
"github.com/stackrox/relacs/cmd/relacs/konflux"
+ "github.com/stackrox/relacs/cmd/relacs/serve"
"github.com/stackrox/relacs/cmd/relacs/version"
"github.com/stackrox/relacs/pkg/versioncheck"
)
@@ -46,6 +47,7 @@ func main() {
rootCmd.AddCommand(version.VersionCmd)
rootCmd.AddCommand(github.GitHubCmd)
rootCmd.AddCommand(konflux.KonfluxCmd)
+ rootCmd.AddCommand(serve.ServeCmd)
// Execute root command
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
diff --git a/cmd/relacs/serve/cmd.go b/cmd/relacs/serve/cmd.go
new file mode 100644
index 0000000..5537595
--- /dev/null
+++ b/cmd/relacs/serve/cmd.go
@@ -0,0 +1,95 @@
+package serve
+
+import (
+ "context"
+ "embed"
+ "fmt"
+ "html/template"
+ "io/fs"
+ "log"
+ "net"
+ "net/http"
+ "time"
+
+ "github.com/spf13/cobra"
+ "github.com/stackrox/relacs/pkg/client"
+)
+
+//go:embed templates/*
+var templateFS embed.FS
+
+var (
+ homeTmpl *template.Template
+ tagTmpl *template.Template
+)
+
+var port string
+
+var ServeCmd = &cobra.Command{
+ Use: "serve",
+ Short: "Start a local web server showing release information",
+ Long: `Starts a local HTTP server that serves release information as web pages`,
+ RunE: runServe,
+}
+
+func init() {
+ ServeCmd.Flags().StringVar(&port, "port", "8080", "Port to listen on")
+}
+
+func parsePageTemplate(files ...string) (*template.Template, error) {
+ return template.ParseFS(templateFS, files...)
+}
+
+func runServe(cmd *cobra.Command, args []string) error {
+ var err error
+ homeTmpl, err = parsePageTemplate("templates/base.html", "templates/home.html")
+ if err != nil {
+ return fmt.Errorf("failed to parse home template: %w", err)
+ }
+ tagTmpl, err = parsePageTemplate("templates/base.html", "templates/tag.html")
+ if err != nil {
+ return fmt.Errorf("failed to parse tag template: %w", err)
+ }
+
+ c, err := client.NewClient()
+ if err != nil {
+ return fmt.Errorf("failed to create client: %w", err)
+ }
+
+ staticFS, err := fs.Sub(templateFS, "templates/static")
+ if err != nil {
+ return fmt.Errorf("failed to create static file system: %w", err)
+ }
+
+ mux := http.NewServeMux()
+ mux.Handle("GET /static/", http.StripPrefix("/static/", http.FileServer(http.FS(staticFS))))
+ mux.HandleFunc("GET /{$}", handleHome())
+ mux.HandleFunc("GET /tag", handleTag(c))
+
+ addr := net.JoinHostPort("localhost", port)
+ server := &http.Server{
+ Addr: addr,
+ Handler: mux,
+ ReadHeaderTimeout: 10 * time.Second,
+ }
+
+ ctx := cmd.Context()
+ shutdownDone := make(chan struct{})
+ go func() {
+ defer close(shutdownDone)
+ <-ctx.Done()
+ shutdownCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+ defer cancel()
+ if err := server.Shutdown(shutdownCtx); err != nil {
+ log.Printf("Server shutdown error: %v", err)
+ }
+ }()
+
+ log.Printf("Server listening on http://%s", addr)
+ err = server.ListenAndServe()
+ if err == http.ErrServerClosed {
+ <-shutdownDone
+ return nil
+ }
+ return err
+}
diff --git a/cmd/relacs/serve/handlers.go b/cmd/relacs/serve/handlers.go
new file mode 100644
index 0000000..736df0d
--- /dev/null
+++ b/cmd/relacs/serve/handlers.go
@@ -0,0 +1,43 @@
+package serve
+
+import (
+ "bytes"
+ "html/template"
+ "log"
+ "net/http"
+
+ "github.com/stackrox/relacs/pkg/client"
+ "github.com/stackrox/relacs/pkg/serve"
+)
+
+func renderTemplate(w http.ResponseWriter, tmpl *template.Template, data any) {
+ var buf bytes.Buffer
+ // Start rendering from the outermost template; it pulls in child-defined blocks.
+ if err := tmpl.ExecuteTemplate(&buf, "base.html", data); err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ _, err := buf.WriteTo(w)
+ if err != nil {
+ log.Printf("Failed to write template to response: %v", err)
+ }
+}
+
+func handleHome() http.HandlerFunc {
+ return func(w http.ResponseWriter, r *http.Request) {
+ renderTemplate(w, homeTmpl, nil)
+ }
+}
+
+func handleTag(c *client.Client) http.HandlerFunc {
+ return func(w http.ResponseWriter, r *http.Request) {
+ tag := r.URL.Query().Get("tag")
+ if tag == "" {
+ http.Error(w, "Missing required query parameter: tag", http.StatusBadRequest)
+ return
+ }
+
+ data := serve.FetchTagData(r.Context(), c, tag)
+ renderTemplate(w, tagTmpl, data)
+ }
+}
diff --git a/cmd/relacs/serve/templates/base.html b/cmd/relacs/serve/templates/base.html
new file mode 100644
index 0000000..0274a7c
--- /dev/null
+++ b/cmd/relacs/serve/templates/base.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+ relacs{{block "title" .}}{{end}}
+
+
+
+
+
+ {{block "content" .}}{{end}}
+
+
+
diff --git a/cmd/relacs/serve/templates/home.html b/cmd/relacs/serve/templates/home.html
new file mode 100644
index 0000000..d25f8b7
--- /dev/null
+++ b/cmd/relacs/serve/templates/home.html
@@ -0,0 +1,26 @@
+{{template "base.html" .}}
+
+{{define "title"}} - Home{{end}}
+
+{{define "content"}}
+Tags
+
+
+
Tag
+
+ View pipeline status, artifacts, and Conforma results for a specific tag.
+
+
+
+{{end}}
diff --git a/cmd/relacs/serve/templates/static/style.css b/cmd/relacs/serve/templates/static/style.css
new file mode 100644
index 0000000..c958c28
--- /dev/null
+++ b/cmd/relacs/serve/templates/static/style.css
@@ -0,0 +1,108 @@
+:root {
+ --color-bg: #f5f5f5;
+ --color-surface: #ffffff;
+ --color-text: #1a1a1a;
+ --color-text-secondary: #555;
+ --color-border: #ddd;
+ --color-passed: #16a34a;
+ --color-passed-bg: #dcfce7;
+ --color-failed: #dc2626;
+ --color-failed-bg: #fee2e2;
+ --color-warning: #ca8a04;
+ --color-warning-bg: #fef9c3;
+ --color-link: #2563eb;
+ --color-nav: #1e293b;
+}
+* { margin: 0; padding: 0; box-sizing: border-box; }
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
+ background: var(--color-bg);
+ color: var(--color-text);
+ line-height: 1.5;
+}
+nav {
+ background: var(--color-nav);
+ color: #fff;
+ padding: 0.75rem 1.5rem;
+ display: flex;
+ align-items: center;
+ gap: 1.5rem;
+}
+nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 1.1rem; }
+nav a:hover { opacity: 0.85; }
+.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
+a { color: var(--color-link); text-decoration: none; }
+a:hover { text-decoration: underline; }
+.card {
+ background: var(--color-surface);
+ border: 1px solid var(--color-border);
+ border-radius: 8px;
+ padding: 1.25rem;
+ margin-bottom: 1rem;
+}
+.card h2 { margin-bottom: 0.75rem; font-size: 1.1rem; }
+.badge {
+ display: inline-block;
+ padding: 0.25rem 0.75rem;
+ border-radius: 9999px;
+ font-size: 0.85rem;
+ font-weight: 600;
+}
+.badge-passed { background: var(--color-passed-bg); color: var(--color-passed); }
+.badge-failed { background: var(--color-failed-bg); color: var(--color-failed); }
+.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
+.badge-mock { background: #e0e7ff; color: #4338ca; font-style: italic; }
+.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
+.kv { margin-bottom: 0.5rem; }
+.kv dt { font-size: 0.8rem; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
+.kv dd { font-size: 0.95rem; word-break: break-all; }
+table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
+th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-border); }
+th { background: var(--color-bg); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-secondary); }
+.group-header {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 0.75rem 0;
+ font-weight: 600;
+ border-bottom: 1px solid var(--color-border);
+ cursor: pointer;
+}
+.group-header:hover { opacity: 0.8; }
+.section-header {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ font-size: 1.1rem;
+ font-weight: 600;
+ cursor: pointer;
+}
+.section-header:hover { opacity: 0.8; }
+details summary { list-style: none; }
+details summary::-webkit-details-marker { display: none; }
+details[open] > summary .chevron { transform: rotate(90deg); }
+.chevron { transition: transform 0.15s; display: inline-block; }
+.errors { background: var(--color-failed-bg); border: 1px solid var(--color-failed); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
+.errors li { margin-left: 1.25rem; color: var(--color-failed); }
+input[type="text"], input[type="number"] {
+ padding: 0.5rem 0.75rem;
+ border: 1px solid var(--color-border);
+ border-radius: 6px;
+ font-size: 0.95rem;
+ width: 100%;
+}
+button {
+ padding: 0.5rem 1.25rem;
+ background: var(--color-link);
+ color: #fff;
+ border: none;
+ border-radius: 6px;
+ font-size: 0.95rem;
+ cursor: pointer;
+ font-weight: 500;
+}
+button:hover { opacity: 0.9; }
+.form-row { display: flex; gap: 0.75rem; align-items: end; }
+.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
+.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--color-text-secondary); }
+@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }
diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html
new file mode 100644
index 0000000..96a7783
--- /dev/null
+++ b/cmd/relacs/serve/templates/tag.html
@@ -0,0 +1,189 @@
+{{template "base.html" .}}
+
+{{define "title"}} - Tag: {{.Tag}}{{end}}
+
+{{define "content"}}
+Tag: {{.Tag}}
+
+{{if .Errors}}
+
+
Errors occurred while fetching data:
+
+ {{range .Errors}}- {{.}}
{{end}}
+
+
+{{end}}
+
+
+
+
Status
+
+ {{if eq .OverallStatus "passed"}}
+ Passed
+ {{else if eq .OverallStatus "failed"}}
+ Failed
+ {{else}}
+ Warning
+ {{end}}
+
+
+ - Pipelines
+ -
+ {{if .PipelinesError}}
+ Error fetching data
+ {{else if .AllPipelinesPassed}}
+ All passed
+ {{else}}
+ Some failed
+ {{end}}
+
+
+
+ - Conforma violations
+ -
+ {{if .ViolationsError}}
+ Error fetching data
+ {{else if .HasViolations}}
+ {{len .Violations}} violation(s)
+ {{else}}
+ None
+ {{end}}
+
+
+
+
+
+
Artifacts
+
+ - GitHub Commit
+ - {{if .CommitSHA}}{{slice .CommitSHA 0 12}}{{else}}unavailable{{end}}
+
+
+ - Custom Snapshot
+ - {{if .SnapshotName}}{{.SnapshotName}}{{else}}unavailable{{end}}
+
+
+ - Operator Bundle Image
+ - {{if .OperatorBundleImage}}{{.OperatorBundleImage}}{{else}}unavailable{{end}}
+
+
+ - Operator Index Image
+ - {{if .OperatorIndexImage}}{{.OperatorIndexImage}}{{else}}unavailable{{end}}
+
+
+
+
+
+
+ {{if not .PipelineGroups}}
+ No pipeline runs found.
+ {{else}}
+ {{range .PipelineGroups}}
+
+
+
+
+
+ | Name |
+ Created |
+ Event Type |
+ Status |
+ Reason |
+
+
+
+ {{range .PipelineRuns}}
+
+ | {{.Name}} |
+ {{.CreationTimestamp.Format "2006-01-02 15:04:05"}} |
+ {{.EventType}} |
+
+ {{if .Succeeded}}
+ Succeeded
+ {{else}}
+ Failed
+ {{end}}
+ |
+ {{.Reason}} |
+
+ {{end}}
+
+
+
+ {{end}}
+ {{end}}
+
+
+
+
+ {{if .ViolationsError}}
+ Failed to fetch conforma violations. See errors above.
+ {{else if not .Violations}}
+ No violations found.
+ {{else}}
+
+
+
+
+
+
+
+ | Image |
+ Violation |
+
+
+
+ {{range .Violations}}
+
+ | {{.Image}} |
+ {{.Violation}} |
+
+ {{end}}
+
+
+
+ {{end}}
+
+{{end}}
diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go
new file mode 100644
index 0000000..091a1b4
--- /dev/null
+++ b/pkg/serve/tag.go
@@ -0,0 +1,288 @@
+package serve
+
+import (
+ "context"
+ "fmt"
+ "sort"
+ "sync"
+ "time"
+
+ "github.com/stackrox/relacs/pkg/client"
+ kflx "github.com/stackrox/relacs/pkg/client/konflux"
+ "github.com/stackrox/relacs/pkg/config"
+ "github.com/stackrox/relacs/pkg/github"
+ "github.com/stackrox/relacs/pkg/konflux"
+ "github.com/stackrox/relacs/pkg/utils"
+)
+
+type PipelineGroup struct {
+ Name string
+ PipelineRuns []PipelineRunInfo
+ AllPassed bool
+}
+
+type PipelineRunInfo struct {
+ Name string
+ CreationTimestamp time.Time
+ EventType string
+ Succeeded bool
+ Reason string
+ URL string
+}
+
+type Violation struct {
+ Image string
+ Violation string
+}
+
+type TagData struct {
+ Tag string
+
+ OverallStatus string // "passed", "failed", "warning"
+ AllPipelinesPassed bool
+ HasViolations bool
+
+ CommitSHA string
+ CommitURL string
+ SnapshotName string
+ SnapshotURL string
+ OperatorBundleImage string
+ OperatorIndexImage string
+
+ PipelineGroups []PipelineGroup
+ PipelinesError bool
+ Violations []Violation
+ ViolationsError bool
+ ViolationImages []string
+ Errors []string
+}
+
+func computeTagOverallStatus(data *TagData) {
+ data.AllPipelinesPassed = len(data.PipelineGroups) > 0
+ for _, g := range data.PipelineGroups {
+ if !g.AllPassed {
+ data.AllPipelinesPassed = false
+ break
+ }
+ }
+ data.HasViolations = len(data.Violations) > 0
+
+ if data.PipelinesError || data.ViolationsError || !data.AllPipelinesPassed {
+ data.OverallStatus = "failed"
+ } else if data.HasViolations {
+ data.OverallStatus = "warning"
+ } else {
+ data.OverallStatus = "passed"
+ }
+}
+
+func uniqueViolationImages(violations []Violation) []string {
+ seen := map[string]bool{}
+ var images []string
+ for _, v := range violations {
+ if !seen[v.Image] {
+ seen[v.Image] = true
+ images = append(images, v.Image)
+ }
+ }
+ sort.Strings(images)
+ return images
+}
+
+// ComputeGroupStatus sets AllPassed on each group based on the most recently
+// created PipelineRun. Runs within each group are sorted newest-first.
+func ComputeGroupStatus(groups []PipelineGroup) {
+ for i := range groups {
+ runs := groups[i].PipelineRuns
+ sort.Slice(runs, func(a, b int) bool {
+ return runs[a].CreationTimestamp.After(runs[b].CreationTimestamp)
+ })
+ groups[i].PipelineRuns = runs
+ if len(runs) > 0 {
+ groups[i].AllPassed = runs[0].Succeeded
+ }
+ }
+}
+
+func convertPipelineRun(plr kflx.PipelineRun) (PipelineRunInfo, error) {
+ var condition kflx.PipelineRunCondition
+ for _, c := range plr.Status.Conditions {
+ if c.Type == "Succeeded" {
+ condition = c
+ break
+ }
+ }
+ if condition.Type == "" {
+ return PipelineRunInfo{}, fmt.Errorf("no Succeeded condition found for pipeline run %s", plr.Metadata.Name)
+ }
+ return PipelineRunInfo{
+ Name: plr.Metadata.Name,
+ CreationTimestamp: *plr.Metadata.CreationTimestamp,
+ EventType: plr.Metadata.Labels["pipelinesascode.tekton.dev/event-type"],
+ Succeeded: condition.Status == "True",
+ Reason: condition.Reason,
+ URL: utils.Application{Name: plr.Metadata.Labels["appstudio.openshift.io/application"]}.GetPipelineRunURL(plr.Metadata.Name),
+ }, nil
+}
+
+func groupPipelineRuns(plrs []kflx.PipelineRun) ([]PipelineGroup, error) {
+ groupMap := map[string][]PipelineRunInfo{}
+ var groupOrder []string
+
+ for _, plr := range plrs {
+ info, err := convertPipelineRun(plr)
+ if err != nil {
+ return nil, err
+ }
+ name := plr.Metadata.Labels["pipelinesascode.tekton.dev/original-prname"]
+ if name == "" {
+ name = plr.Metadata.Name
+ }
+ if _, exists := groupMap[name]; !exists {
+ groupOrder = append(groupOrder, name)
+ }
+ groupMap[name] = append(groupMap[name], info)
+ }
+
+ sort.Strings(groupOrder)
+ groups := make([]PipelineGroup, 0, len(groupOrder))
+ for _, name := range groupOrder {
+ groups = append(groups, PipelineGroup{
+ Name: name,
+ PipelineRuns: groupMap[name],
+ })
+ }
+ return groups, nil
+}
+
+func convertViolations(v konflux.Violations) []Violation {
+ out := make([]Violation, len(v.Violations))
+ for i, viol := range v.Violations {
+ out[i] = Violation{Image: viol.Image, Violation: viol.Violation}
+ }
+ return out
+}
+
+func FetchTagData(ctx context.Context, c *client.Client, tag string) TagData {
+ org := config.GitHubOrganization
+ repo := config.MainGitHubRepository
+ appPrefix := config.KonfluxApplicationPrefix
+
+ data := TagData{
+ Tag: tag,
+ }
+
+ var (
+ mu sync.Mutex
+ wg sync.WaitGroup
+ commit github.CommitInfo
+ snap kflx.Snapshot
+ plrs []kflx.PipelineRun
+ viols konflux.Violations
+ indexImg konflux.OperatorIndexImage
+ )
+
+ addError := func(msg string) {
+ mu.Lock()
+ data.Errors = append(data.Errors, msg)
+ mu.Unlock()
+ }
+
+ wg.Add(4)
+
+ go func() {
+ defer wg.Done()
+ var err error
+ commit, err = github.GetCommitForTag(ctx, c, org, repo, tag)
+ if err != nil {
+ addError(fmt.Sprintf("Failed to get commit for tag: %v", err))
+ }
+ }()
+
+ go func() {
+ defer wg.Done()
+ var err error
+ indexImg, err = konflux.GetOperatorIndexImage(ctx, c, org, repo, tag)
+ if err != nil {
+ addError(fmt.Sprintf("Failed to get operator index image: %v", err))
+ }
+ }()
+
+ go func() {
+ defer wg.Done()
+ var err error
+ plrs, err = konflux.ListPipelineRunsForTag(ctx, c, org, repo, tag)
+ if err != nil {
+ addError(fmt.Sprintf("Failed to list pipeline runs: %v", err))
+ mu.Lock()
+ data.PipelinesError = true
+ mu.Unlock()
+ }
+ }()
+
+ go func() {
+ defer wg.Done()
+ var err error
+ snap, err = konflux.GetCustomSnapshot(ctx, c, appPrefix, org, repo, tag)
+ if err != nil {
+ addError(fmt.Sprintf("Failed to get custom snapshot: %v", err))
+ mu.Lock()
+ data.ViolationsError = true
+ mu.Unlock()
+ return
+ }
+
+ var violErr error
+ viols, violErr = konflux.ListConformaViolations(ctx, c, appPrefix, org, repo, tag)
+ if violErr != nil {
+ addError(fmt.Sprintf("Failed to list conforma violations: %v", violErr))
+ mu.Lock()
+ data.ViolationsError = true
+ mu.Unlock()
+ }
+ }()
+
+ wg.Wait()
+
+ if indexImg.ImageURL != "" {
+ data.OperatorIndexImage = indexImg.ImageURL + "@" + indexImg.ImageDigest
+ }
+
+ if commit.SHA != "" {
+ data.CommitSHA = commit.SHA
+ data.CommitURL = fmt.Sprintf("https://github.com/%s/%s/commit/%s", org, repo, commit.SHA)
+ }
+
+ if snap.Metadata.Name != "" {
+ data.SnapshotName = snap.Metadata.Name
+ snapshotURL, err := snap.GetURL()
+ if err == nil {
+ data.SnapshotURL = snapshotURL
+ }
+
+ bundleImage, err := snap.GetOperatorBundleImage(tag)
+ if err != nil {
+ addError(fmt.Sprintf("Failed to get operator bundle image: %v", err))
+ } else {
+ data.OperatorBundleImage = bundleImage
+ }
+ }
+
+ if plrs != nil {
+ groups, err := groupPipelineRuns(plrs)
+ if err != nil {
+ addError(fmt.Sprintf("Failed to process pipeline runs: %v", err))
+ data.PipelinesError = true
+ } else {
+ ComputeGroupStatus(groups)
+ data.PipelineGroups = groups
+ }
+ }
+
+ data.Violations = convertViolations(viols)
+ data.ViolationImages = uniqueViolationImages(data.Violations)
+
+ computeTagOverallStatus(&data)
+
+ return data
+}
From 6fdac3afa6891e182d48599e9d3bc98c167415bf Mon Sep 17 00:00:00 2001
From: Tom Martensen
Date: Tue, 3 Nov 2026 12:08:06 +0100
Subject: [PATCH 02/28] return error if no pipelinerun groups are found
---
pkg/serve/tag.go | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go
index 091a1b4..eca3909 100644
--- a/pkg/serve/tag.go
+++ b/pkg/serve/tag.go
@@ -269,13 +269,18 @@ func FetchTagData(ctx context.Context, c *client.Client, tag string) TagData {
}
if plrs != nil {
- groups, err := groupPipelineRuns(plrs)
- if err != nil {
- addError(fmt.Sprintf("Failed to process pipeline runs: %v", err))
+ if len(plrs) == 0 {
+ addError("No pipeline runs found for tag")
data.PipelinesError = true
} else {
- ComputeGroupStatus(groups)
- data.PipelineGroups = groups
+ groups, err := groupPipelineRuns(plrs)
+ if err != nil {
+ addError(fmt.Sprintf("Failed to process pipeline runs: %v", err))
+ data.PipelinesError = true
+ } else {
+ ComputeGroupStatus(groups)
+ data.PipelineGroups = groups
+ }
}
}
From f18da015a278daeb7030f464bf69ac1aaefc4d6f Mon Sep 17 00:00:00 2001
From: Tom Martensen
Date: Thu, 12 Nov 2026 16:26:11 +0100
Subject: [PATCH 03/28] add repository selector to relacs serve
Adds a repository dropdown (collector, fact, scanner, stackrox) to the
homepage with stackrox as default. The tag page adapts per repo: custom
snapshot, operator bundle/index images, and conforma violations are only
shown for stackrox. Other repos get manual instructions for reviewing
conforma violations via Konflux UI.
Co-Authored-By: Claude Opus 4.6 (1M context)
---
cmd/relacs/serve/handlers.go | 7 +-
cmd/relacs/serve/templates/home.html | 9 +++
cmd/relacs/serve/templates/static/style.css | 4 +-
cmd/relacs/serve/templates/tag.html | 21 +++++-
pkg/serve/tag.go | 74 +++++++++++----------
5 files changed, 77 insertions(+), 38 deletions(-)
diff --git a/cmd/relacs/serve/handlers.go b/cmd/relacs/serve/handlers.go
index 736df0d..56e074e 100644
--- a/cmd/relacs/serve/handlers.go
+++ b/cmd/relacs/serve/handlers.go
@@ -7,6 +7,7 @@ import (
"net/http"
"github.com/stackrox/relacs/pkg/client"
+ "github.com/stackrox/relacs/pkg/config"
"github.com/stackrox/relacs/pkg/serve"
)
@@ -36,8 +37,12 @@ func handleTag(c *client.Client) http.HandlerFunc {
http.Error(w, "Missing required query parameter: tag", http.StatusBadRequest)
return
}
+ repo := r.URL.Query().Get("repo")
+ if repo == "" {
+ repo = config.MainGitHubRepository
+ }
- data := serve.FetchTagData(r.Context(), c, tag)
+ data := serve.FetchTagData(r.Context(), c, repo, tag)
renderTemplate(w, tagTmpl, data)
}
}
diff --git a/cmd/relacs/serve/templates/home.html b/cmd/relacs/serve/templates/home.html
index d25f8b7..f99d1f2 100644
--- a/cmd/relacs/serve/templates/home.html
+++ b/cmd/relacs/serve/templates/home.html
@@ -12,6 +12,15 @@ Tag