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}}
+
+
+
+ +
+ + ▶ + Pipeline Runs + {{if .PipelinesError}} + error + {{else if .AllPipelinesPassed}} + passed + {{else}} + failed + {{end}} + + {{if not .PipelineGroups}} +

No pipeline runs found.

+ {{else}} + {{range .PipelineGroups}} +
+ + ▶ + {{.Name}} + {{if .AllPassed}} + passed + {{else}} + failed + {{end}} + ({{len .PipelineRuns}}) + + + + + + + + + + + + + {{range .PipelineRuns}} + + + + + + + + {{end}} + +
NameCreatedEvent TypeStatusReason
{{.Name}}{{.CreationTimestamp.Format "2006-01-02 15:04:05"}}{{.EventType}} + {{if .Succeeded}} + Succeeded + {{else}} + Failed + {{end}} + {{.Reason}}
+
+ {{end}} + {{end}} +
+ +
+ + ▶ + Conforma Violations + {{if .ViolationsError}} + error + {{else if .HasViolations}} + {{len .Violations}} violation(s) + {{else}} + none + {{end}} + + {{if .ViolationsError}} +

Failed to fetch conforma violations. See errors above.

+ {{else if not .Violations}} +

No violations found.

+ {{else}} +
+ + +
+ + + + + + + + + {{range .Violations}} + + + + + {{end}} + +
ImageViolation
{{.Image}}{{.Violation}}
+ + {{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

+
+ + +
diff --git a/cmd/relacs/serve/templates/static/style.css b/cmd/relacs/serve/templates/static/style.css index c958c28..996ebf9 100644 --- a/cmd/relacs/serve/templates/static/style.css +++ b/cmd/relacs/serve/templates/static/style.css @@ -84,12 +84,14 @@ 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"] { +input[type="text"], input[type="number"], select { padding: 0.5rem 0.75rem; border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.95rem; width: 100%; + font-family: inherit; + background: var(--color-surface); } button { padding: 0.5rem 1.25rem; diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 96a7783..07aabf8 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -1,9 +1,9 @@ {{template "base.html" .}} -{{define "title"}} - Tag: {{.Tag}}{{end}} +{{define "title"}} - {{.Repo}}: {{.Tag}}{{end}} {{define "content"}} -

Tag: {{.Tag}}

+

{{.Repo}}: {{.Tag}}

{{if .Errors}}
@@ -38,6 +38,7 @@

Status

{{end}} + {{if eq .Repo "stackrox"}}
Conforma violations
@@ -50,6 +51,7 @@

Status

{{end}}
+ {{end}}
@@ -58,6 +60,7 @@

Artifacts

GitHub Commit
{{if .CommitSHA}}{{slice .CommitSHA 0 12}}{{else}}unavailable{{end}}
+ {{if eq .Repo "stackrox"}}
Custom Snapshot
{{if .SnapshotName}}{{.SnapshotName}}{{else}}unavailable{{end}}
@@ -70,6 +73,7 @@

Artifacts

Operator Index Image
{{if .OperatorIndexImage}}{{.OperatorIndexImage}}{{else}}unavailable{{end}}
+ {{end}}
@@ -133,6 +137,7 @@

Artifacts

{{end}} +{{if eq .Repo "stackrox"}}
▶ @@ -186,4 +191,16 @@

Artifacts

{{end}}
+{{else}} +
+

Conforma Violations

+

Not yet supported for this repository. To review Conforma violations manually:

+
    +
  1. Follow a link to a PipelineRun above
  2. +
  3. Click on the linked Snapshot
  4. +
  5. Click on PipelineRuns
  6. +
  7. Click on acs-dev-conforma-..., then Violations
  8. +
+
+{{end}} {{end}} diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index eca3909..dcdb42c 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -36,7 +36,8 @@ type Violation struct { } type TagData struct { - Tag string + Tag string + Repo string OverallStatus string // "passed", "failed", "warning" AllPipelinesPassed bool @@ -163,13 +164,14 @@ func convertViolations(v konflux.Violations) []Violation { return out } -func FetchTagData(ctx context.Context, c *client.Client, tag string) TagData { +func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagData { org := config.GitHubOrganization - repo := config.MainGitHubRepository appPrefix := config.KonfluxApplicationPrefix + isMainRepo := repo == config.MainGitHubRepository data := TagData{ - Tag: tag, + Tag: tag, + Repo: repo, } var ( @@ -188,7 +190,7 @@ func FetchTagData(ctx context.Context, c *client.Client, tag string) TagData { mu.Unlock() } - wg.Add(4) + wg.Add(2) go func() { defer wg.Done() @@ -199,15 +201,6 @@ func FetchTagData(ctx context.Context, c *client.Client, tag string) TagData { } }() - 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 @@ -220,27 +213,40 @@ func FetchTagData(ctx context.Context, c *client.Client, tag string) TagData { } }() - 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 - } + if isMainRepo { + wg.Add(2) - 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() - } - }() + 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 + 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() From db5a4d06e803bb4de5ad94b9616dd53385d514ee Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 11:47:18 +0100 Subject: [PATCH 04/28] serve: adapt to the new ListConformaViolations signature The conforma violations no longer depend on the custom snapshot, so a snapshot fetch failure no longer masks the violations section on the tag page. ListConformaViolations returns a ConformaViolations result now; use its Violations for the page. Co-Authored-By: Claude Code --- pkg/serve/tag.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index dcdb42c..d36b754 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -231,20 +231,17 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa 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) + result, violErr := konflux.ListConformaViolations(ctx, c, org, repo, tag) if violErr != nil { addError(fmt.Sprintf("Failed to list conforma violations: %v", violErr)) mu.Lock() data.ViolationsError = true mu.Unlock() + return } + viols = result.Violations }() } From 800e6443962976c49c4d936a7953310aa3a2ae43 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 11:58:03 +0100 Subject: [PATCH 05/28] serve: group conforma violations by component version with arch filter Group the Conforma Violations widget by the "-- " prefix of the image names (e.g. "operator-5-0" for "operator-5-0-sha256:-ppc64le"). Groups are collapsible and collapsed by default. Each group has a "Filter by architecture" dropdown that shows only the violations of the selected architecture; it defaults to the first architecture and has no "all" option. Images without an arch suffix are labeled "multi-arch". Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 73 ++++++++++++++--------- pkg/serve/tag.go | 87 +++++++++++++++++++++++---- pkg/serve/tag_test.go | 92 +++++++++++++++++++++++++++++ 3 files changed, 213 insertions(+), 39 deletions(-) create mode 100644 pkg/serve/tag_test.go diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 07aabf8..07003fd 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -155,39 +155,54 @@

Artifacts

{{else if not .Violations}}

No violations found.

{{else}} -
- - -
- - - - - - - - - {{range .Violations}} - - - - - {{end}} - -
ImageViolation
{{.Image}}{{.Violation}}
+ {{range $i, $group := .ViolationGroups}} +
+ + ▶ + {{$group.Name}} + {{len $group.Violations}} violation(s) + ({{len $group.Archs}} architecture(s)) + +
+ + +
+ + + + + + + + + {{range $group.Violations}} + + + + + {{end}} + +
ImageViolation
{{.Image}}{{.Violation}}
+
+ {{end}} {{end}} diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index d36b754..1dc8564 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -4,6 +4,8 @@ import ( "context" "fmt" "sort" + "strconv" + "strings" "sync" "time" @@ -32,9 +34,18 @@ type PipelineRunInfo struct { type Violation struct { Image string + Arch string Violation string } +// ViolationGroup groups the conforma violations for one component version, +// e.g. all violations reported for images matching "scanner-4-10*". +type ViolationGroup struct { + Name string + Archs []string + Violations []Violation +} + type TagData struct { Tag string Repo string @@ -53,8 +64,8 @@ type TagData struct { PipelineGroups []PipelineGroup PipelinesError bool Violations []Violation + ViolationGroups []ViolationGroup ViolationsError bool - ViolationImages []string Errors []string } @@ -77,17 +88,73 @@ func computeTagOverallStatus(data *TagData) { } } -func uniqueViolationImages(violations []Violation) []string { - seen := map[string]bool{} - var images []string +// violationImageGroup extracts the "--" prefix of an +// image name, e.g. "scanner-4-10" from "scanner-4-10-s390x". Components may +// themselves contain hyphens ("scanner-db-4-10"). Images without a numeric +// major-minor version form their own group. +func violationImageGroup(image string) string { + parts := strings.Split(image, "-") + for i := 1; i < len(parts)-1; i++ { + if isNumeric(parts[i]) && isNumeric(parts[i+1]) { + return strings.Join(parts[:i+2], "-") + } + } + return image +} + +// violationImageArch extracts the architecture of an image relative to its +// group prefix. Image names look like +// "operator-5-0-sha256:-ppc64le", so the remainder after the group is +// "[-]": the digest contains no hyphens, and the arch may +// ("x86-64"). Images without an arch suffix are the multi-arch image. +func violationImageArch(image, group string) string { + remainder := strings.TrimPrefix(strings.TrimPrefix(image, group), "-") + _, arch, found := strings.Cut(remainder, "-") + if !found || arch == "" { + return "multi-arch" + } + return arch +} + +func isNumeric(s string) bool { + _, err := strconv.Atoi(s) + return err == nil +} + +// groupViolations groups violations by their image's component version prefix +// and annotates each violation with its image's architecture. Groups are +// sorted by name, and each group lists its distinct architectures sorted. +func groupViolations(violations []Violation) []ViolationGroup { + groupMap := map[string][]Violation{} + var groupOrder []string for _, v := range violations { - if !seen[v.Image] { - seen[v.Image] = true - images = append(images, v.Image) + name := violationImageGroup(v.Image) + if _, exists := groupMap[name]; !exists { + groupOrder = append(groupOrder, name) + } + groupMap[name] = append(groupMap[name], v) + } + sort.Strings(groupOrder) + + groups := make([]ViolationGroup, 0, len(groupOrder)) + for _, name := range groupOrder { + seen := map[string]bool{} + var archs []string + for i := range groupMap[name] { + groupMap[name][i].Arch = violationImageArch(groupMap[name][i].Image, name) + if !seen[groupMap[name][i].Arch] { + seen[groupMap[name][i].Arch] = true + archs = append(archs, groupMap[name][i].Arch) + } } + sort.Strings(archs) + groups = append(groups, ViolationGroup{ + Name: name, + Archs: archs, + Violations: groupMap[name], + }) } - sort.Strings(images) - return images + return groups } // ComputeGroupStatus sets AllPassed on each group based on the most recently @@ -288,7 +355,7 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa } data.Violations = convertViolations(viols) - data.ViolationImages = uniqueViolationImages(data.Violations) + data.ViolationGroups = groupViolations(data.Violations) computeTagOverallStatus(&data) diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go new file mode 100644 index 0000000..ab98a4b --- /dev/null +++ b/pkg/serve/tag_test.go @@ -0,0 +1,92 @@ +package serve + +import ( + "reflect" + "testing" +) + +func TestViolationImageGroup(t *testing.T) { + tests := []struct { + image string + expected string + }{ + // Image names look like + // "---sha256:-". + {image: "operator-5-0-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5-ppc64le", expected: "operator-5-0"}, + {image: "main-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5-x86-64", expected: "main-4-10"}, + // Components may themselves contain hyphens. + {image: "scanner-db-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5-s390x", expected: "scanner-db-4-10"}, + // Images without a numeric major-minor version form their own group. + {image: "main", expected: "main"}, + } + + for _, test := range tests { + t.Run(test.expected, func(t *testing.T) { + if got := violationImageGroup(test.image); got != test.expected { + t.Errorf("violationImageGroup(%q) = %q, expected %q", test.image, got, test.expected) + } + }) + } +} + +func TestViolationImageArch(t *testing.T) { + tests := []struct { + image string + group string + expected string + }{ + {image: "operator-5-0-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5-ppc64le", group: "operator-5-0", expected: "ppc64le"}, + // Arch names may contain hyphens themselves. + {image: "operator-5-0-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5-x86-64", group: "operator-5-0", expected: "x86-64"}, + // Images without an arch suffix are the multi-arch image. + {image: "operator-5-0-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5", group: "operator-5-0", expected: "multi-arch"}, + } + + for _, test := range tests { + t.Run(test.expected, func(t *testing.T) { + if got := violationImageArch(test.image, test.group); got != test.expected { + t.Errorf("violationImageArch(%q, %q) = %q, expected %q", test.image, test.group, got, test.expected) + } + }) + } +} + +func TestGroupViolations(t *testing.T) { + violations := []Violation{ + {Image: "scanner-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5-s390x", Violation: "violation one"}, + {Image: "main-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5", Violation: "violation two"}, + {Image: "scanner-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5", Violation: "violation three"}, + {Image: "main-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5", Violation: "violation four"}, + } + + groups := groupViolations(violations) + + expected := []ViolationGroup{ + { + Name: "main-4-10", + Archs: []string{"multi-arch"}, + Violations: []Violation{ + {Image: "main-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5", Arch: "multi-arch", Violation: "violation two"}, + {Image: "main-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5", Arch: "multi-arch", Violation: "violation four"}, + }, + }, + { + Name: "scanner-4-10", + Archs: []string{"multi-arch", "s390x"}, + Violations: []Violation{ + {Image: "scanner-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5-s390x", Arch: "s390x", Violation: "violation one"}, + {Image: "scanner-4-10-sha256:f0c5ee9a4de4d26e02d84154e2cd2856f133661e44c5e9dfb1867c75cd8069c5", Arch: "multi-arch", Violation: "violation three"}, + }, + }, + } + + if !reflect.DeepEqual(groups, expected) { + t.Errorf("groupViolations() = %+v, expected %+v", groups, expected) + } +} + +func TestGroupViolations_Empty(t *testing.T) { + if groups := groupViolations(nil); len(groups) != 0 { + t.Errorf("groupViolations(nil) = %+v, expected no groups", groups) + } +} From 6fc3e21b802589c61e1bc2d13298533d17f05828 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 12:02:51 +0100 Subject: [PATCH 06/28] serve: note that conforma violations are for the dev policy only The list-conforma-* commands only consider runs triggered on the tag's commit, which use the acs-conforma-dev policy. Add an info note to the Status card and the Conforma Violations widget on the tag page pointing to the Conforma run attached to the custom snapshot for acs-conforma-prod-like policy results. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/static/style.css | 1 + cmd/relacs/serve/templates/tag.html | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/cmd/relacs/serve/templates/static/style.css b/cmd/relacs/serve/templates/static/style.css index 996ebf9..74a9770 100644 --- a/cmd/relacs/serve/templates/static/style.css +++ b/cmd/relacs/serve/templates/static/style.css @@ -83,6 +83,7 @@ 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; } +.note { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 8px; padding: 0.75rem 1rem; margin: 0.5rem 0; font-size: 0.85rem; color: var(--color-text-secondary); } .errors li { margin-left: 1.25rem; color: var(--color-failed); } input[type="text"], input[type="number"], select { padding: 0.5rem 0.75rem; diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 07003fd..816a5ee 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -2,6 +2,13 @@ {{define "title"}} - {{.Repo}}: {{.Tag}}{{end}} +{{define "conforma-policy-note"}} +
+ Conforma violations here are for the acs-conforma-dev policy only.
+ For the acs-conforma-prod-like policy results, review the Conforma run attached to the custom snapshot. +
+{{end}} + {{define "content"}}

{{.Repo}}: {{.Tag}}

@@ -51,6 +58,7 @@

Status

{{end}} + {{template "conforma-policy-note" .}} {{end}}
@@ -150,6 +158,7 @@

Artifacts

none {{end}} + {{template "conforma-policy-note" .}} {{if .ViolationsError}}

Failed to fetch conforma violations. See errors above.

{{else if not .Violations}} From 686d93e13c06932ad6f6efdaf3597c016443dbbc Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 12:10:18 +0100 Subject: [PATCH 07/28] serve: render conforma violations for all repositories The conforma violations are fetched via pipelines-as-code runs on the tag's commit, which works for any repository, not just the main one. Fetch them for every repo and render the same Conforma Violations widget; drop the "not yet supported" fallback card. The acs-conforma-dev policy note stays limited to the main repository, and the custom snapshot and operator images remain main-repo-only. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 227 ++++++++++++++-------------- pkg/serve/tag.go | 24 +-- 2 files changed, 127 insertions(+), 124 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 816a5ee..212254f 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -4,7 +4,8 @@ {{define "conforma-policy-note"}}
- Conforma violations here are for the acs-conforma-dev policy only.
+ Conforma violations here are for the acs-conforma-dev policy only and only for components defined in + this repository (no results from retag-* pipelines).
For the acs-conforma-prod-like policy results, review the Conforma run attached to the custom snapshot.
{{end}} @@ -26,38 +27,38 @@

{{.Repo}}: {{.Tag}}

Status

{{if eq .OverallStatus "passed"}} - Passed + Passed {{else if eq .OverallStatus "failed"}} - Failed + Failed {{else}} - Warning + Warning {{end}}
Pipelines
{{if .PipelinesError}} - Error fetching data + Error fetching data {{else if .AllPipelinesPassed}} - All passed + All passed {{else}} - Some failed + Some failed {{end}}
- {{if eq .Repo "stackrox"}}
Conforma violations
{{if .ViolationsError}} - Error fetching data + Error fetching data {{else if .HasViolations}} - {{len .Violations}} violation(s) + {{len .Violations}} violation(s) {{else}} - None + None {{end}}
+ {{if eq .Repo "stackrox"}} {{template "conforma-policy-note" .}} {{end}} @@ -66,20 +67,24 @@

Status

Artifacts

GitHub Commit
-
{{if .CommitSHA}}{{slice .CommitSHA 0 12}}{{else}}unavailable{{end}}
+
{{if .CommitSHA}}{{slice .CommitSHA 0 12}}{{else}}unavailable{{end}}
{{if eq .Repo "stackrox"}}
Custom Snapshot
-
{{if .SnapshotName}}{{.SnapshotName}}{{else}}unavailable{{end}}
+
{{if .SnapshotName}}{{.SnapshotName}}{{else}}unavailable{{end}}
Operator Bundle Image
-
{{if .OperatorBundleImage}}{{.OperatorBundleImage}}{{else}}unavailable{{end}}
+
{{if .OperatorBundleImage}}{{.OperatorBundleImage}}{{else}}unavailable{{end}}
Operator Index Image
-
{{if .OperatorIndexImage}}{{.OperatorIndexImage}}{{else}}unavailable{{end}}
+
{{if .OperatorIndexImage}}{{.OperatorIndexImage}}{{else}}unavailable{{end}}
{{end}} @@ -90,115 +95,121 @@

Artifacts

▶ Pipeline Runs {{if .PipelinesError}} - error + error {{else if .AllPipelinesPassed}} - passed + passed {{else}} - failed + failed {{end}} {{if not .PipelineGroups}} -

No pipeline runs found.

+

No pipeline runs found.

{{else}} - {{range .PipelineGroups}} -
- - ▶ - {{.Name}} - {{if .AllPassed}} - passed - {{else}} - failed + {{range .PipelineGroups}} +
+ + ▶ + {{.Name}} + {{if .AllPassed}} + passed + {{else}} + failed + {{end}} + ({{len + .PipelineRuns}}) + + + + + + + + + + + + + {{range .PipelineRuns}} + + + + + + + {{end}} - ({{len .PipelineRuns}}) - -
NameCreatedEvent TypeStatusReason
{{.Name}}{{.CreationTimestamp.Format "2006-01-02 15:04:05"}}{{.EventType}} + {{if .Succeeded}} + Succeeded + {{else}} + Failed + {{end}} + {{.Reason}}
- - - - - - - - - - - {{range .PipelineRuns}} - - - - - - - - {{end}} - -
NameCreatedEvent TypeStatusReason
{{.Name}}{{.CreationTimestamp.Format "2006-01-02 15:04:05"}}{{.EventType}} - {{if .Succeeded}} - Succeeded - {{else}} - Failed - {{end}} - {{.Reason}}
-
- {{end}} + + +
+ {{end}} {{end}} -{{if eq .Repo "stackrox"}}
▶ Conforma Violations {{if .ViolationsError}} - error + error {{else if .HasViolations}} - {{len .Violations}} violation(s) + {{len .Violations}} violation(s) {{else}} - none + none {{end}} + {{if eq .Repo "stackrox"}} {{template "conforma-policy-note" .}} + {{end}} {{if .ViolationsError}} -

Failed to fetch conforma violations. See errors above.

+

Failed to fetch conforma violations. See errors above.

{{else if not .Violations}} -

No violations found.

+

No violations found.

{{else}} - {{range $i, $group := .ViolationGroups}} -
- - ▶ - {{$group.Name}} - {{len $group.Violations}} violation(s) - ({{len $group.Archs}} architecture(s)) - -
- - -
- - - - - - - - - {{range $group.Violations}} - - - - - {{end}} - -
ImageViolation
{{.Image}}{{.Violation}}
-
- {{end}} - + {{end}}
-{{else}} -
-

Conforma Violations

-

Not yet supported for this repository. To review Conforma violations manually:

-
    -
  1. Follow a link to a PipelineRun above
  2. -
  3. Click on the linked Snapshot
  4. -
  5. Click on PipelineRuns
  6. -
  7. Click on acs-dev-conforma-..., then Violations
  8. -
-
-{{end}} {{end}} diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index 1dc8564..b43429c 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -280,6 +280,20 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa } }() + wg.Add(1) + go func() { + defer wg.Done() + result, violErr := konflux.ListConformaViolations(ctx, c, org, repo, tag) + if violErr != nil { + addError(fmt.Sprintf("Failed to list conforma violations: %v", violErr)) + mu.Lock() + data.ViolationsError = true + mu.Unlock() + return + } + viols = result.Violations + }() + if isMainRepo { wg.Add(2) @@ -299,16 +313,6 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa if err != nil { addError(fmt.Sprintf("Failed to get custom snapshot: %v", err)) } - - result, violErr := konflux.ListConformaViolations(ctx, c, org, repo, tag) - if violErr != nil { - addError(fmt.Sprintf("Failed to list conforma violations: %v", violErr)) - mu.Lock() - data.ViolationsError = true - mu.Unlock() - return - } - viols = result.Violations }() } From 7b3dbb6b0ebb83a03688435094e243c6bc8466ac Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 12:13:44 +0100 Subject: [PATCH 08/28] serve: render the conforma policy note for all repositories The acs-conforma-dev policy limitation applies to every repository, not just the main one, so drop the repo condition around the note. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 212254f..db8e505 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -6,7 +6,8 @@
Conforma violations here are for the acs-conforma-dev policy only and only for components defined in this repository (no results from retag-* pipelines).
- For the acs-conforma-prod-like policy results, review the Conforma run attached to the custom snapshot. + For release like acs-conforma-prod-like policy results, review the Conforma run attached to the custom + snapshot for the tag in the stackrox repository.
{{end}} @@ -58,9 +59,7 @@

Status

{{end}} - {{if eq .Repo "stackrox"}} {{template "conforma-policy-note" .}} - {{end}}
@@ -163,9 +162,7 @@

Artifacts

none {{end}} - {{if eq .Repo "stackrox"}} {{template "conforma-policy-note" .}} - {{end}} {{if .ViolationsError}}

Failed to fetch conforma violations. See errors above.

{{else if not .Violations}} From c5c01a9ce7fbf3f249fb4fadfa209011c7f5f31d Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 12:16:39 +0100 Subject: [PATCH 09/28] serve: link the custom snapshot in the conforma policy note When the custom snapshot is available, link "the custom snapshot" in the policy note to its Konflux UI pipelineruns filtered by the acs-conforma-prod-like pipeline; otherwise keep the plain text. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index db8e505..8f243eb 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -6,8 +6,9 @@
Conforma violations here are for the acs-conforma-dev policy only and only for components defined in this repository (no results from retag-* pipelines).
- For release like acs-conforma-prod-like policy results, review the Conforma run attached to the custom - snapshot for the tag in the stackrox repository. + For release like acs-conforma-prod-like policy results, review the Conforma run attached to {{if + .SnapshotURL}}the custom + snapshot{{else}}the custom snapshot{{end}} for the tag in the stackrox repository.
{{end}} From cb09132c94523cf897fd1ec2f12eee4fc9027027 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 12:17:57 +0100 Subject: [PATCH 10/28] serve: reword the conforma policy note Say "for a preview of the release like acs-conforma-prod-like policy results" to clarify that the custom snapshot run is a preview. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 8f243eb..1c0159a 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -6,9 +6,10 @@
Conforma violations here are for the acs-conforma-dev policy only and only for components defined in this repository (no results from retag-* pipelines).
- For release like acs-conforma-prod-like policy results, review the Conforma run attached to {{if + For a preview of the release like acs-conforma-prod-like policy results, review the Conforma run + attached to {{if .SnapshotURL}}the custom - snapshot{{else}}the custom snapshot{{end}} for the tag in the stackrox repository. + snapshot{{else}}the custom snapshot{{end}} for the tag in the stackrox repository.
{{end}} From 82c1585f8f6eb797e0bfdf8c483bae10bba5b939 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 12:36:34 +0100 Subject: [PATCH 11/28] serve: pass the conforma scenario explicitly ListConformaViolations now requires the scenario; the serve tag page uses the default acs-conforma-dev scenario. Co-Authored-By: Claude Code --- pkg/serve/tag.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index b43429c..a821069 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -283,7 +283,7 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa wg.Add(1) go func() { defer wg.Done() - result, violErr := konflux.ListConformaViolations(ctx, c, org, repo, tag) + result, violErr := konflux.ListConformaViolations(ctx, c, org, repo, tag, konflux.ConformaScenarioDev) if violErr != nil { addError(fmt.Sprintf("Failed to list conforma violations: %v", violErr)) mu.Lock() From 0fb95c2a08e5778d91d7b95f6e633656a1308b87 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 12:46:21 +0100 Subject: [PATCH 12/28] conforma: carry URL and reason for skipped and in-progress runs ConformaViolations.SkippedRuns and InProgressRuns now hold ConformaRunInfo entries with the pipeline run's Konflux UI URL and, for skipped runs, the reason the report was unavailable, instead of bare run names. The list-conforma-violations output adapts accordingly. The serve Conforma Violations widget renders this as three tabs under the policy note: Completed (the grouped violations), In progress (links to the running pipeline runs) and Skipped (links with reasons), each tab title showing its count. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/static/style.css | 4 ++ cmd/relacs/serve/templates/tag.html | 50 ++++++++++++++++++++- pkg/serve/tag.go | 23 ++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/cmd/relacs/serve/templates/static/style.css b/cmd/relacs/serve/templates/static/style.css index 74a9770..bcc5ed5 100644 --- a/cmd/relacs/serve/templates/static/style.css +++ b/cmd/relacs/serve/templates/static/style.css @@ -84,6 +84,10 @@ 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; } .note { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 8px; padding: 0.75rem 1rem; margin: 0.5rem 0; font-size: 0.85rem; color: var(--color-text-secondary); } +.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--color-border); margin: 0.75rem 0; } +.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 0.5rem 0.75rem; font-size: 0.9rem; font-weight: 500; color: var(--color-text-secondary); cursor: pointer; } +.tab:hover { color: var(--color-text); } +.tab.active { color: var(--color-text); border-bottom-color: var(--color-link); } .errors li { margin-left: 1.25rem; color: var(--color-failed); } input[type="text"], input[type="number"], select { padding: 0.5rem 0.75rem; diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 1c0159a..821f31b 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -167,10 +167,22 @@

Artifacts

{{template "conforma-policy-note" .}} {{if .ViolationsError}}

Failed to fetch conforma violations. See errors above.

- {{else if not .Violations}} + {{else if and (not .Violations) (not .InProgressRuns) (not .SkippedRuns)}}

No violations found.

{{else}} - {{range $i, $group := .ViolationGroups}} +
+ + + +
+
+ {{if not .ViolationGroups}} +

No violations found.

+ {{else}} + {{range $i, $group := .ViolationGroups}}
▶ @@ -208,7 +220,41 @@

Artifacts

{{end}} + {{end}} +
+ + - {{end}} - + } + // Apply the initially selected architecture (the first option) to each + // group, since the dropdown has no "all" option. + var archFilters = document.querySelectorAll('select[id$="-arch-filter-"]'); + for (var i = 0; i < archFilters.length; i++) { + filterViolations(archFilters[i]); + } + {{end}} diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index 23aac55..a3bb2c5 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -28,6 +28,7 @@ type PipelineRunInfo struct { CreationTimestamp time.Time EventType string Succeeded bool + Running bool Reason string URL string } @@ -63,6 +64,40 @@ func convertConformaRuns(runs []konflux.ConformaRunInfo) []ConformaRun { return out } +// ConformaResults holds the results of one conforma scenario for a tag. +type ConformaResults struct { + Violations []Violation + Groups []ViolationGroup + InProgressRuns []ConformaRun + SkippedRuns []ConformaRun + Error bool +} + +func convertConformaResult(result konflux.ConformaViolations) ConformaResults { + violations := convertViolations(result.Violations) + return ConformaResults{ + Violations: violations, + Groups: groupViolations(violations), + InProgressRuns: convertConformaRuns(result.InProgressRuns), + SkippedRuns: convertConformaRuns(result.SkippedRuns), + } +} + +// ConformaTabData is the data for one conforma widget's tab content, +// identified by a prefix that namespaces its element ids. +type ConformaTabData struct { + Prefix string + Results ConformaResults +} + +func (t TagData) DevTabs() ConformaTabData { + return ConformaTabData{Prefix: "dev", Results: t.ConformaDev} +} + +func (t TagData) PreviewTabs() ConformaTabData { + return ConformaTabData{Prefix: "preview", Results: t.ConformaReleasePreview} +} + type TagData struct { Tag string Repo string @@ -78,17 +113,18 @@ type TagData struct { OperatorBundleImage string OperatorIndexImage string - PipelineGroups []PipelineGroup - PipelinesError bool - Violations []Violation - ViolationGroups []ViolationGroup - InProgressRuns []ConformaRun - SkippedRuns []ConformaRun - ViolationsError bool - Errors []string + PipelineGroups []PipelineGroup + PipelinesError bool + + // ConformaDev holds the acs-conforma-dev results, ConformaReleasePreview + // the acs-conforma-prod-like results (main repository only). + ConformaDev ConformaResults + ConformaReleasePreview ConformaResults + + Errors []string } -func computeTagOverallStatus(data *TagData) { +func computeTagOverallStatus(data *TagData, isMainRepo bool) { data.AllPipelinesPassed = len(data.PipelineGroups) > 0 for _, g := range data.PipelineGroups { if !g.AllPassed { @@ -96,14 +132,48 @@ func computeTagOverallStatus(data *TagData) { break } } - data.HasViolations = len(data.Violations) > 0 + data.HasViolations = len(data.ConformaDev.Violations) > 0 + + // The overall status is "error" when any data could not be retrieved, + // "failed" when prod-like violations were found, prod-like runs were + // skipped or the latest run of a build pipeline run group did not + // succeed, "waiting" while conforma or build pipeline runs are still in + // progress, and "green" only when every build pipeline run group's latest + // run succeeded and, for the main repository, the custom snapshot and the + // operator bundle and index images are present and there are no prod-like + // violations. For other repositories, green build pipeline runs are + // sufficient. + if data.PipelinesError || data.ConformaDev.Error || + (isMainRepo && (data.ConformaReleasePreview.Error || data.SnapshotName == "" || + data.OperatorBundleImage == "" || data.OperatorIndexImage == "")) { + data.OverallStatus = "error" + return + } - if data.PipelinesError || data.ViolationsError || !data.AllPipelinesPassed { + failed := isMainRepo && (len(data.ConformaReleasePreview.Violations) > 0 || len(data.ConformaReleasePreview.SkippedRuns) > 0) + waiting := isMainRepo && len(data.ConformaReleasePreview.InProgressRuns) > 0 + for _, g := range data.PipelineGroups { + if len(g.PipelineRuns) == 0 { + continue + } + latest := g.PipelineRuns[0] + if latest.Succeeded { + continue + } + if latest.Running { + waiting = true + } else { + failed = true + } + } + + switch { + case failed: data.OverallStatus = "failed" - } else if data.HasViolations { - data.OverallStatus = "warning" - } else { - data.OverallStatus = "passed" + case waiting: + data.OverallStatus = "waiting" + default: + data.OverallStatus = "green" } } @@ -207,6 +277,7 @@ func convertPipelineRun(plr kflx.PipelineRun) (PipelineRunInfo, error) { CreationTimestamp: *plr.Metadata.CreationTimestamp, EventType: plr.Metadata.Labels["pipelinesascode.tekton.dev/event-type"], Succeeded: condition.Status == "True", + Running: condition.Status == "Unknown", Reason: condition.Reason, URL: utils.Application{Name: plr.Metadata.Labels["appstudio.openshift.io/application"]}.GetPipelineRunURL(plr.Metadata.Name), }, nil @@ -266,7 +337,6 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa commit github.CommitInfo snap kflx.Snapshot plrs []kflx.PipelineRun - viols konflux.Violations indexImg konflux.OperatorIndexImage ) @@ -306,19 +376,32 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa if violErr != nil { addError(fmt.Sprintf("Failed to list conforma violations: %v", violErr)) mu.Lock() - data.ViolationsError = true + data.ConformaDev.Error = true mu.Unlock() return } - viols = result.Violations mu.Lock() - data.InProgressRuns = convertConformaRuns(result.InProgressRuns) - data.SkippedRuns = convertConformaRuns(result.SkippedRuns) + data.ConformaDev = convertConformaResult(result) mu.Unlock() }() if isMainRepo { - wg.Add(2) + wg.Add(3) + + go func() { + defer wg.Done() + result, violErr := konflux.ListConformaViolations(ctx, c, org, repo, tag, konflux.ConformaScenarioProdLike) + if violErr != nil { + addError(fmt.Sprintf("Failed to list conforma release preview violations: %v", violErr)) + mu.Lock() + data.ConformaReleasePreview.Error = true + mu.Unlock() + return + } + mu.Lock() + data.ConformaReleasePreview = convertConformaResult(result) + mu.Unlock() + }() go func() { defer wg.Done() @@ -381,10 +464,7 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa } } - data.Violations = convertViolations(viols) - data.ViolationGroups = groupViolations(data.Violations) - - computeTagOverallStatus(&data) + computeTagOverallStatus(&data, isMainRepo) return data } diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go index ab98a4b..60ab97c 100644 --- a/pkg/serve/tag_test.go +++ b/pkg/serve/tag_test.go @@ -90,3 +90,165 @@ func TestGroupViolations_Empty(t *testing.T) { t.Errorf("groupViolations(nil) = %+v, expected no groups", groups) } } + +func TestComputeTagOverallStatus(t *testing.T) { + buildGroup := func(name string, succeeded, running bool) PipelineGroup { + return PipelineGroup{Name: name, PipelineRuns: []PipelineRunInfo{{Succeeded: succeeded, Running: running}}} + } + mainRepoGreen := TagData{ + PipelineGroups: []PipelineGroup{buildGroup("build", true, false)}, + SnapshotName: "snap", + OperatorBundleImage: "bundle", + OperatorIndexImage: "index", + ConformaReleasePreview: ConformaResults{}, + } + + tests := []struct { + name string + isMainRep bool + data TagData + expected string + }{ + { + name: "green when everything is satisfied", + isMainRep: true, + data: mainRepoGreen, + expected: "green", + }, + { + name: "error when pipeline runs could not be retrieved", + isMainRep: true, + data: TagData{PipelinesError: true}, + expected: "error", + }, + { + name: "error when dev conforma results could not be retrieved", + isMainRep: true, + data: TagData{ConformaDev: ConformaResults{Error: true}}, + expected: "error", + }, + { + name: "error when release preview results could not be retrieved", + isMainRep: true, + data: TagData{ConformaReleasePreview: ConformaResults{Error: true}}, + expected: "error", + }, + { + name: "error when the custom snapshot is missing", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.SnapshotName = "" + return d + }(), + expected: "error", + }, + { + name: "error when the operator bundle image is missing", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.OperatorBundleImage = "" + return d + }(), + expected: "error", + }, + { + name: "error when the operator index image is missing", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.OperatorIndexImage = "" + return d + }(), + expected: "error", + }, + { + name: "failed when there are release preview violations", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.ConformaReleasePreview.Violations = []Violation{{Image: "main-4-10", Violation: "v"}} + return d + }(), + expected: "failed", + }, + { + name: "failed when release preview runs were skipped", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.ConformaReleasePreview.SkippedRuns = []ConformaRun{{Name: "run"}} + return d + }(), + expected: "failed", + }, + { + name: "failed when the latest build pipeline run failed", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.PipelineGroups = []PipelineGroup{buildGroup("build", false, false)} + return d + }(), + expected: "failed", + }, + { + name: "waiting when release preview runs are in progress", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.ConformaReleasePreview.InProgressRuns = []ConformaRun{{Name: "run"}} + return d + }(), + expected: "waiting", + }, + { + name: "waiting when the latest build pipeline run is running", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.PipelineGroups = []PipelineGroup{buildGroup("build", false, true)} + return d + }(), + expected: "waiting", + }, + { + name: "failed takes precedence over waiting", + isMainRep: true, + data: func() TagData { + d := mainRepoGreen + d.PipelineGroups = []PipelineGroup{buildGroup("a", false, true), buildGroup("b", false, false)} + return d + }(), + expected: "failed", + }, + { + name: "green for other repositories with only green builds", + isMainRep: false, + data: TagData{PipelineGroups: []PipelineGroup{buildGroup("build", true, false)}}, + expected: "green", + }, + { + name: "waiting for other repositories with a running build", + isMainRep: false, + data: TagData{PipelineGroups: []PipelineGroup{buildGroup("build", false, true)}}, + expected: "waiting", + }, + { + name: "failed for other repositories with a failed build", + isMainRep: false, + data: TagData{PipelineGroups: []PipelineGroup{buildGroup("build", false, false)}}, + expected: "failed", + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + computeTagOverallStatus(&test.data, test.isMainRep) + if test.data.OverallStatus != test.expected { + t.Errorf("computeTagOverallStatus() = %q, expected %q", test.data.OverallStatus, test.expected) + } + }) + } +} From d58fa5d3e563ef54fcfd44bfe3d2a90c05a4d39a Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 13:06:24 +0100 Subject: [PATCH 14/28] serve: point the conforma policy note at the Release Preview widget The note no longer links to the custom snapshot's Konflux UI page but refers to the Conforma Release Preview widget on the same page. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index cb8e42f..f14aed2 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -6,10 +6,8 @@
Conforma violations here are for the acs-conforma-dev policy only and only for components defined in this repository (no results from retag-* pipelines).
- For a preview of the release like acs-conforma-prod-like policy results, review the Conforma run - attached to {{if - .SnapshotURL}}the custom - snapshot{{else}}the custom snapshot{{end}} for the tag in the stackrox repository. + For a preview of the release like acs-conforma-prod-like policy results, review the Conforma Release + Preview tab for the tag in the stackrox repository.
{{end}} From 7c73e9137ea82ac1fce8e13400ab2d8a2a502838 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 13:15:29 +0100 Subject: [PATCH 15/28] serve: sort pipeline run groups into release milestones The Pipeline Runs widget groups the pipeline run groups into three milestones in order: all others, operator-bundle-on-push, and operator-index-on-push + create-custom-snapshot. Each milestone is a collapsible section with a combined status (passed/running/failed, failed taking precedence over running) computed from the latest run of each of its groups. Empty milestones are dropped. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 77 ++++++++++++++--------- pkg/serve/tag.go | 88 ++++++++++++++++++++++++++- pkg/serve/tag_test.go | 94 +++++++++++++++++++++++++++++ 3 files changed, 227 insertions(+), 32 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index f14aed2..98e01b9 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -201,47 +201,64 @@

Artifacts

{{if not .PipelineGroups}}

No pipeline runs found.

{{else}} - {{range .PipelineGroups}} + {{range .PipelineMilestones}}
▶ {{.Name}} - {{if .AllPassed}} + {{if eq .Status "passed"}} passed + {{else if eq .Status "running"}} + running {{else}} failed {{end}} ({{len - .PipelineRuns}}) + .Groups}} group(s)) - - - - - - - - - - - - {{range .PipelineRuns}} - - - - - - - + {{range .Groups}} +
+ + ▶ + {{.Name}} + {{if .AllPassed}} + passed + {{else}} + failed {{end}} -
-
NameCreatedEvent TypeStatusReason
{{.Name}}{{.CreationTimestamp.Format "2006-01-02 15:04:05"}}{{.EventType}} - {{if .Succeeded}} - Succeeded - {{else}} - Failed - {{end}} - {{.Reason}}
+ ({{len + .PipelineRuns}}) + + + + + + + + + + + + + {{range .PipelineRuns}} + + + + + + + + {{end}} + +
NameCreatedEvent TypeStatusReason
{{.Name}}{{.CreationTimestamp.Format "2006-01-02 15:04:05"}}{{.EventType}} + {{if .Succeeded}} + Succeeded + {{else}} + Failed + {{end}} + {{.Reason}}
+
+ {{end}} {{end}} {{end}} diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index a3bb2c5..f18cf37 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -23,6 +23,88 @@ type PipelineGroup struct { AllPassed bool } +// PipelineMilestone sorts the pipeline run groups into the release +// milestones, in order: everything else, the operator bundle, and the +// operator index and custom snapshot. +type PipelineMilestone struct { + Name string + Status string // "passed", "running", "failed" + Groups []PipelineGroup +} + +// pipelineMilestoneOrder lists the milestones in display order. A milestone +// with no group names collects all groups that belong to no other milestone. +var pipelineMilestoneOrder = []struct { + Name string + Names []string +}{ + {Name: "Others"}, + {Name: "operator-bundle-on-push", Names: []string{"operator-bundle-on-push"}}, + {Name: "operator-index-on-push, create-custom-snapshot", Names: []string{"operator-index-on-push", "create-custom-snapshot"}}, +} + +// groupPipelineMilestones sorts the groups into the release milestones and +// computes each milestone's combined status from the latest run of each of +// its groups. Empty milestones are dropped. +func groupPipelineMilestones(groups []PipelineGroup) []PipelineMilestone { + membership := map[string]int{} + for i, milestone := range pipelineMilestoneOrder { + for _, name := range milestone.Names { + membership[name] = i + } + } + + byMilestone := make([][]PipelineGroup, len(pipelineMilestoneOrder)) + for _, g := range groups { + idx, ok := membership[g.Name] + if !ok { + idx = 0 + } + byMilestone[idx] = append(byMilestone[idx], g) + } + + var milestones []PipelineMilestone + for i, milestone := range pipelineMilestoneOrder { + if len(byMilestone[i]) == 0 { + continue + } + milestones = append(milestones, PipelineMilestone{ + Name: milestone.Name, + Status: milestoneStatus(byMilestone[i]), + Groups: byMilestone[i], + }) + } + return milestones +} + +// milestoneStatus is the combined status of a milestone's groups: "failed" +// when the latest run of any group did not succeed and is not running, +// "running" while any latest run is still running, and "passed" otherwise. +func milestoneStatus(groups []PipelineGroup) string { + failed, running := false, false + for _, g := range groups { + if len(g.PipelineRuns) == 0 { + continue + } + latest := g.PipelineRuns[0] + switch { + case latest.Succeeded: + case latest.Running: + running = true + default: + failed = true + } + } + switch { + case failed: + return "failed" + case running: + return "running" + default: + return "passed" + } +} + type PipelineRunInfo struct { Name string CreationTimestamp time.Time @@ -113,8 +195,9 @@ type TagData struct { OperatorBundleImage string OperatorIndexImage string - PipelineGroups []PipelineGroup - PipelinesError bool + PipelineGroups []PipelineGroup + PipelineMilestones []PipelineMilestone + PipelinesError bool // ConformaDev holds the acs-conforma-dev results, ConformaReleasePreview // the acs-conforma-prod-like results (main repository only). @@ -460,6 +543,7 @@ func FetchTagData(ctx context.Context, c *client.Client, repo, tag string) TagDa } else { ComputeGroupStatus(groups) data.PipelineGroups = groups + data.PipelineMilestones = groupPipelineMilestones(groups) } } } diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go index 60ab97c..8d98ef3 100644 --- a/pkg/serve/tag_test.go +++ b/pkg/serve/tag_test.go @@ -91,6 +91,100 @@ func TestGroupViolations_Empty(t *testing.T) { } } +func TestGroupPipelineMilestones(t *testing.T) { + group := func(name string, succeeded, running bool) PipelineGroup { + return PipelineGroup{Name: name, PipelineRuns: []PipelineRunInfo{{Succeeded: succeeded, Running: running}}} + } + + groups := []PipelineGroup{ + group("operator-index-on-push", true, false), + group("main-on-push", false, true), + group("create-custom-snapshot", true, false), + group("operator-bundle-on-push", false, false), + group("retag-main", true, false), + } + + milestones := groupPipelineMilestones(groups) + + expected := []PipelineMilestone{ + { + Name: "Others", + Status: "running", // main-on-push is running, retag-main passed + Groups: []PipelineGroup{group("main-on-push", false, true), group("retag-main", true, false)}, + }, + { + Name: "operator-bundle-on-push", + Status: "failed", + Groups: []PipelineGroup{group("operator-bundle-on-push", false, false)}, + }, + { + Name: "operator-index-on-push, create-custom-snapshot", + Status: "passed", + Groups: []PipelineGroup{group("operator-index-on-push", true, false), group("create-custom-snapshot", true, false)}, + }, + } + + if !reflect.DeepEqual(milestones, expected) { + t.Errorf("groupPipelineMilestones() = %+v, expected %+v", milestones, expected) + } +} + +func TestGroupPipelineMilestones_DropsEmptyMilestones(t *testing.T) { + // A non-main repository has no operator bundle/index pipelines. + groups := []PipelineGroup{{Name: "main-on-push", PipelineRuns: []PipelineRunInfo{{Succeeded: true}}}} + + milestones := groupPipelineMilestones(groups) + + if len(milestones) != 1 || milestones[0].Name != "Others" { + t.Errorf("groupPipelineMilestones() = %+v, expected only the Others milestone", milestones) + } +} + +func TestMilestoneStatus(t *testing.T) { + tests := []struct { + name string + groups []PipelineGroup + expected string + }{ + { + name: "passed when all latest runs succeeded", + groups: []PipelineGroup{{PipelineRuns: []PipelineRunInfo{{Succeeded: true}}}}, + expected: "passed", + }, + { + name: "running while a latest run is running", + groups: []PipelineGroup{{PipelineRuns: []PipelineRunInfo{{Running: true}}}}, + expected: "running", + }, + { + name: "failed when a latest run failed", + groups: []PipelineGroup{{PipelineRuns: []PipelineRunInfo{{}}}}, + expected: "failed", + }, + { + name: "failed takes precedence over running", + groups: []PipelineGroup{ + {PipelineRuns: []PipelineRunInfo{{Running: true}}}, + {PipelineRuns: []PipelineRunInfo{{}}}, + }, + expected: "failed", + }, + { + name: "passed for groups without runs", + groups: []PipelineGroup{{}}, + expected: "passed", + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + if got := milestoneStatus(test.groups); got != test.expected { + t.Errorf("milestoneStatus() = %q, expected %q", got, test.expected) + } + }) + } +} + func TestComputeTagOverallStatus(t *testing.T) { buildGroup := func(name string, succeeded, running bool) PipelineGroup { return PipelineGroup{Name: name, PipelineRuns: []PipelineRunInfo{{Succeeded: succeeded, Running: running}}} From abfe597e0759a5479aa854491453a4449d7bd673 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 13:18:04 +0100 Subject: [PATCH 16/28] serve: rename the pipeline milestones Rename the milestone sections to Operands & Operator, Operator Bundle, and Custom Snapshot & Index Image. Co-Authored-By: Claude Code --- pkg/serve/tag.go | 6 +++--- pkg/serve/tag_test.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index f18cf37..11c0950 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -38,9 +38,9 @@ var pipelineMilestoneOrder = []struct { Name string Names []string }{ - {Name: "Others"}, - {Name: "operator-bundle-on-push", Names: []string{"operator-bundle-on-push"}}, - {Name: "operator-index-on-push, create-custom-snapshot", Names: []string{"operator-index-on-push", "create-custom-snapshot"}}, + {Name: "Operands & Operator"}, + {Name: "Operator Bundle", Names: []string{"operator-bundle-on-push"}}, + {Name: "Custom Snapshot & Index Image", Names: []string{"operator-index-on-push", "create-custom-snapshot"}}, } // groupPipelineMilestones sorts the groups into the release milestones and diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go index 8d98ef3..4a2dd78 100644 --- a/pkg/serve/tag_test.go +++ b/pkg/serve/tag_test.go @@ -108,17 +108,17 @@ func TestGroupPipelineMilestones(t *testing.T) { expected := []PipelineMilestone{ { - Name: "Others", + Name: "Operands & Operator", Status: "running", // main-on-push is running, retag-main passed Groups: []PipelineGroup{group("main-on-push", false, true), group("retag-main", true, false)}, }, { - Name: "operator-bundle-on-push", + Name: "Operator Bundle", Status: "failed", Groups: []PipelineGroup{group("operator-bundle-on-push", false, false)}, }, { - Name: "operator-index-on-push, create-custom-snapshot", + Name: "Custom Snapshot & Index Image", Status: "passed", Groups: []PipelineGroup{group("operator-index-on-push", true, false), group("create-custom-snapshot", true, false)}, }, @@ -135,8 +135,8 @@ func TestGroupPipelineMilestones_DropsEmptyMilestones(t *testing.T) { milestones := groupPipelineMilestones(groups) - if len(milestones) != 1 || milestones[0].Name != "Others" { - t.Errorf("groupPipelineMilestones() = %+v, expected only the Others milestone", milestones) + if len(milestones) != 1 || milestones[0].Name != "Operands & Operator" { + t.Errorf("groupPipelineMilestones() = %+v, expected only the Operands & Operator milestone", milestones) } } From 5461d303398e629c1752dce510a383e136ad3f2f Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 13:19:51 +0100 Subject: [PATCH 17/28] serve: drop the conforma policy note from the status box The note remains in the Conforma Dev widget where it belongs. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 98e01b9..dd37753 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -156,7 +156,6 @@

Status

{{end}} - {{template "conforma-policy-note" .}}
From caa5bd4db9b2826689b785180c45fd5c39ebd8ac Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 13:22:05 +0100 Subject: [PATCH 18/28] serve: display the component label as the pipeline run group name Group headers under the milestones show the appstudio.openshift.io/component label (e.g. operator-bundle-5-0) instead of the pipeline name, falling back to the pipeline name when a run carries no component label. The pipeline name remains the grouping key and drives the milestone membership. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 2 +- pkg/serve/tag.go | 19 ++++++++-- pkg/serve/tag_test.go | 57 +++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 4 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index dd37753..f5727ee 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -219,7 +219,7 @@

Artifacts

▶ - {{.Name}} + {{.Component}} {{if .AllPassed}} passed {{else}} diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index 11c0950..9a67b6c 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -18,7 +18,13 @@ import ( ) type PipelineGroup struct { - Name string + // Name is the pipeline name (the pipelinesascode.tekton.dev/original-prname + // label); it is the grouping key and drives the milestone membership. + Name string + // Component is the group's display name: the + // appstudio.openshift.io/component label, falling back to the pipeline + // name when the runs carry no component label. + Component string PipelineRuns []PipelineRunInfo AllPassed bool } @@ -368,6 +374,7 @@ func convertPipelineRun(plr kflx.PipelineRun) (PipelineRunInfo, error) { func groupPipelineRuns(plrs []kflx.PipelineRun) ([]PipelineGroup, error) { groupMap := map[string][]PipelineRunInfo{} + components := map[string]string{} var groupOrder []string for _, plr := range plrs { @@ -381,6 +388,7 @@ func groupPipelineRuns(plrs []kflx.PipelineRun) ([]PipelineGroup, error) { } if _, exists := groupMap[name]; !exists { groupOrder = append(groupOrder, name) + components[name] = plr.Metadata.Labels["appstudio.openshift.io/component"] } groupMap[name] = append(groupMap[name], info) } @@ -388,10 +396,15 @@ func groupPipelineRuns(plrs []kflx.PipelineRun) ([]PipelineGroup, error) { sort.Strings(groupOrder) groups := make([]PipelineGroup, 0, len(groupOrder)) for _, name := range groupOrder { - groups = append(groups, PipelineGroup{ + group := PipelineGroup{ Name: name, + Component: name, PipelineRuns: groupMap[name], - }) + } + if component := components[name]; component != "" { + group.Component = component + } + groups = append(groups, group) } return groups, nil } diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go index 4a2dd78..53c32a6 100644 --- a/pkg/serve/tag_test.go +++ b/pkg/serve/tag_test.go @@ -3,6 +3,9 @@ package serve import ( "reflect" "testing" + "time" + + kflx "github.com/stackrox/relacs/pkg/client/konflux" ) func TestViolationImageGroup(t *testing.T) { @@ -91,6 +94,60 @@ func TestGroupViolations_Empty(t *testing.T) { } } +func TestGroupPipelineRuns_ComponentNames(t *testing.T) { + newPipelineRun := func(name, pipeline, component string) kflx.PipelineRun { + labels := map[string]string{ + "pipelinesascode.tekton.dev/original-prname": pipeline, + } + if component != "" { + labels["appstudio.openshift.io/component"] = component + } + created := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + return kflx.PipelineRun{ + Metadata: kflx.Metadata{ + Name: name, + CreationTimestamp: &created, + Labels: labels, + }, + Status: kflx.PipelineRunStatus{ + Conditions: []kflx.PipelineRunCondition{ + {Type: "Succeeded", Status: "True", Reason: "Succeeded"}, + }, + }, + } + } + + plrs := []kflx.PipelineRun{ + newPipelineRun("plr-1", "operator-bundle-on-push", "operator-bundle-5-0"), + newPipelineRun("plr-2", "operator-bundle-on-push", "operator-bundle-5-0"), + newPipelineRun("plr-3", "create-custom-snapshot", ""), + } + + groups, err := groupPipelineRuns(plrs) + + if err != nil { + t.Fatalf("groupPipelineRuns() unexpected error: %v", err) + } + if len(groups) != 2 { + t.Fatalf("groupPipelineRuns() returned %d groups, expected 2", len(groups)) + } + byName := map[string]PipelineGroup{} + for _, g := range groups { + byName[g.Name] = g + } + bundle := byName["operator-bundle-on-push"] + if bundle.Component != "operator-bundle-5-0" { + t.Errorf("operator-bundle-on-push component = %q, expected operator-bundle-5-0", bundle.Component) + } + if len(bundle.PipelineRuns) != 2 { + t.Errorf("operator-bundle-on-push group has %d runs, expected 2", len(bundle.PipelineRuns)) + } + snapshot := byName["create-custom-snapshot"] + if snapshot.Component != "create-custom-snapshot" { + t.Errorf("create-custom-snapshot component = %q, expected fallback to the pipeline name", snapshot.Component) + } +} + func TestGroupPipelineMilestones(t *testing.T) { group := func(name string, succeeded, running bool) PipelineGroup { return PipelineGroup{Name: name, PipelineRuns: []PipelineRunInfo{{Succeeded: succeeded, Running: running}}} From bbd9e79a0389ccb19a8e5fee726f41c49d9a761e Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 14:31:59 +0100 Subject: [PATCH 19/28] serve: add retest instructions modal to the pipeline milestones Each milestone section shows a retest button that opens a modal with one /konflux-retest tag: command per currently failed pipeline of the milestone, to be posted as a comment on the tagged commit (linked). The button is only enabled when all groups of the previous milestone succeeded; the first milestone is always enabled. Milestones without failed pipelines show no button. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/static/style.css | 5 +++ cmd/relacs/serve/templates/tag.html | 47 +++++++++++++++++--- pkg/serve/tag.go | 25 +++++++++-- pkg/serve/tag_test.go | 49 +++++++++++++++++---- 4 files changed, 108 insertions(+), 18 deletions(-) diff --git a/cmd/relacs/serve/templates/static/style.css b/cmd/relacs/serve/templates/static/style.css index bcc5ed5..bb54045 100644 --- a/cmd/relacs/serve/templates/static/style.css +++ b/cmd/relacs/serve/templates/static/style.css @@ -88,6 +88,11 @@ details[open] > summary .chevron { transform: rotate(90deg); } .tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 0.5rem 0.75rem; font-size: 0.9rem; font-weight: 500; color: var(--color-text-secondary); cursor: pointer; } .tab:hover { color: var(--color-text); } .tab.active { color: var(--color-text); border-bottom-color: var(--color-link); } +.retest-button { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0 0.25rem; margin-left: 0.5rem; } +.retest-button.disabled { opacity: 0.4; cursor: not-allowed; } +.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 100; } +.modal-content { max-width: 640px; width: 90%; } +.modal-content pre { white-space: pre-wrap; word-break: break-all; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 8px; padding: 0.75rem 1rem; } .errors li { margin-left: 1.25rem; color: var(--color-failed); } input[type="text"], input[type="number"], select { padding: 0.5rem 0.75rem; diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index f5727ee..13469c2 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -200,22 +200,30 @@

Artifacts

{{if not .PipelineGroups}}

No pipeline runs found.

{{else}} - {{range .PipelineMilestones}} + {{range $i, $m := .PipelineMilestones}}
▶ - {{.Name}} - {{if eq .Status "passed"}} + {{$m.Name}} + {{if eq $m.Status "passed"}} passed - {{else if eq .Status "running"}} + {{else if eq $m.Status "running"}} running {{else}} failed {{end}} ({{len - .Groups}} group(s)) + $m.Groups}} group(s)) + {{if $m.FailedPipelines}} + {{if $m.Retestable}} + + {{else}} + 🔁 + {{end}} + {{end}} - {{range .Groups}} + {{range $m.Groups}}
▶ @@ -258,6 +266,25 @@

Artifacts

{{end}} + {{if $m.FailedPipelines}} + + {{end}}
{{end}} {{end}} @@ -328,5 +355,13 @@

Artifacts

for (var i = 0; i < archFilters.length; i++) { filterViolations(archFilters[i]); } + function showRetestModal(id) { + document.getElementById(id).style.display = 'flex'; + } + function hideRetestModal(event, id) { + if (event.target === document.getElementById(id)) { + document.getElementById(id).style.display = 'none'; + } + } {{end}} diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index 9a67b6c..1202288 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -36,6 +36,12 @@ type PipelineMilestone struct { Name string Status string // "passed", "running", "failed" Groups []PipelineGroup + // FailedPipelines lists the pipeline names of the groups whose latest + // run failed; they are the candidates for a /konflux-retest. + FailedPipelines []string + // Retestable reports whether the milestone's retest button is enabled: + // all groups of the previous milestone succeeded. + Retestable bool } // pipelineMilestoneOrder lists the milestones in display order. A milestone @@ -74,10 +80,23 @@ func groupPipelineMilestones(groups []PipelineGroup) []PipelineMilestone { if len(byMilestone[i]) == 0 { continue } + // A milestone is retestable when all groups of the previous + // milestone succeeded; an empty previous milestone counts as passed. + retestable := i == 0 || milestoneStatus(byMilestone[i-1]) == "passed" + + var failedPipelines []string + for _, g := range byMilestone[i] { + if len(g.PipelineRuns) > 0 && !g.PipelineRuns[0].Succeeded && !g.PipelineRuns[0].Running { + failedPipelines = append(failedPipelines, g.Name) + } + } + milestones = append(milestones, PipelineMilestone{ - Name: milestone.Name, - Status: milestoneStatus(byMilestone[i]), - Groups: byMilestone[i], + Name: milestone.Name, + Status: milestoneStatus(byMilestone[i]), + Groups: byMilestone[i], + FailedPipelines: failedPipelines, + Retestable: retestable, }) } return milestones diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go index 53c32a6..3703560 100644 --- a/pkg/serve/tag_test.go +++ b/pkg/serve/tag_test.go @@ -165,19 +165,24 @@ func TestGroupPipelineMilestones(t *testing.T) { expected := []PipelineMilestone{ { - Name: "Operands & Operator", - Status: "running", // main-on-push is running, retag-main passed - Groups: []PipelineGroup{group("main-on-push", false, true), group("retag-main", true, false)}, + Name: "Operands & Operator", + Status: "running", // main-on-push is running, retag-main passed + Groups: []PipelineGroup{group("main-on-push", false, true), group("retag-main", true, false)}, + FailedPipelines: nil, // the running group is not failed + Retestable: true, }, { - Name: "Operator Bundle", - Status: "failed", - Groups: []PipelineGroup{group("operator-bundle-on-push", false, false)}, + Name: "Operator Bundle", + Status: "failed", + Groups: []PipelineGroup{group("operator-bundle-on-push", false, false)}, + FailedPipelines: []string{"operator-bundle-on-push"}, + Retestable: false, // the previous milestone is still running }, { - Name: "Custom Snapshot & Index Image", - Status: "passed", - Groups: []PipelineGroup{group("operator-index-on-push", true, false), group("create-custom-snapshot", true, false)}, + Name: "Custom Snapshot & Index Image", + Status: "passed", + Groups: []PipelineGroup{group("operator-index-on-push", true, false), group("create-custom-snapshot", true, false)}, + Retestable: false, // the previous milestone failed }, } @@ -186,6 +191,32 @@ func TestGroupPipelineMilestones(t *testing.T) { } } +func TestGroupPipelineMilestones_Retestable(t *testing.T) { + group := func(name string, succeeded, running bool) PipelineGroup { + return PipelineGroup{Name: name, PipelineRuns: []PipelineRunInfo{{Succeeded: succeeded, Running: running}}} + } + + groups := []PipelineGroup{ + group("main-on-push", true, false), + group("operator-bundle-on-push", false, false), + group("create-custom-snapshot", true, false), + } + + milestones := groupPipelineMilestones(groups) + + // The first milestone passed, so the failed Operator Bundle milestone is + // retestable; it failed, so the last milestone is not. + if !milestones[1].Retestable { + t.Error("Operator Bundle milestone expected to be retestable") + } + if !reflect.DeepEqual(milestones[1].FailedPipelines, []string{"operator-bundle-on-push"}) { + t.Errorf("Operator Bundle FailedPipelines = %v, expected [operator-bundle-on-push]", milestones[1].FailedPipelines) + } + if milestones[2].Retestable { + t.Error("Custom Snapshot & Index Image milestone expected not to be retestable") + } +} + func TestGroupPipelineMilestones_DropsEmptyMilestones(t *testing.T) { // A non-main repository has no operator bundle/index pipelines. groups := []PipelineGroup{{Name: "main-on-push", PipelineRuns: []PipelineRunInfo{{Succeeded: true}}}} From ba544dad778054b0bd0b9b47959f2c4fb7f9f21e Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 14:33:04 +0100 Subject: [PATCH 20/28] serve: right-align the pipeline milestone retest button Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/static/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/relacs/serve/templates/static/style.css b/cmd/relacs/serve/templates/static/style.css index bb54045..f25e86a 100644 --- a/cmd/relacs/serve/templates/static/style.css +++ b/cmd/relacs/serve/templates/static/style.css @@ -88,7 +88,7 @@ details[open] > summary .chevron { transform: rotate(90deg); } .tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 0.5rem 0.75rem; font-size: 0.9rem; font-weight: 500; color: var(--color-text-secondary); cursor: pointer; } .tab:hover { color: var(--color-text); } .tab.active { color: var(--color-text); border-bottom-color: var(--color-link); } -.retest-button { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0 0.25rem; margin-left: 0.5rem; } +.retest-button { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0 0.25rem; margin-left: auto; } .retest-button.disabled { opacity: 0.4; cursor: not-allowed; } .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 100; } .modal-content { max-width: 640px; width: 90%; } From ce78a1e0f6295e9fd4c07fb36ae3560b9b9439da Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 14:38:10 +0100 Subject: [PATCH 21/28] serve: show running status for pipeline groups and widget A running pipeline run group used to be badged as failed because only the latest run's success was considered. ComputeGroupStatus now also sets a group-level Running flag, the Pipeline Runs widget header shows running when at least one group is running and none failed (new PipelinesRunning flag), the run table rows and the Status card's Pipelines row distinguish running from failed as well. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 8 ++++ pkg/serve/tag.go | 12 +++++- pkg/serve/tag_test.go | 63 +++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 13469c2..1266759 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -125,6 +125,8 @@

Status

Error fetching data {{else if .AllPipelinesPassed}} All passed + {{else if .PipelinesRunning}} + Running {{else}} Some failed {{end}} @@ -193,6 +195,8 @@

Artifacts

error {{else if .AllPipelinesPassed}} passed + {{else if .PipelinesRunning}} + running {{else}} failed {{end}} @@ -230,6 +234,8 @@

Artifacts

{{.Component}} {{if .AllPassed}} passed + {{else if .Running}} + running {{else}} failed {{end}} @@ -255,6 +261,8 @@

Artifacts

{{if .Succeeded}} Succeeded + {{else if .Running}} + Running {{else}} Failed {{end}} diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index 1202288..7d84184 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -27,6 +27,8 @@ type PipelineGroup struct { Component string PipelineRuns []PipelineRunInfo AllPassed bool + // Running reports whether the group's latest run is still running. + Running bool } // PipelineMilestone sorts the pipeline run groups into the release @@ -211,7 +213,10 @@ type TagData struct { OverallStatus string // "passed", "failed", "warning" AllPipelinesPassed bool - HasViolations bool + // PipelinesRunning reports whether build pipeline runs are still running + // and none failed; it drives the Pipeline Runs widget's running status. + PipelinesRunning bool + HasViolations bool CommitSHA string CommitURL string @@ -260,6 +265,7 @@ func computeTagOverallStatus(data *TagData, isMainRepo bool) { failed := isMainRepo && (len(data.ConformaReleasePreview.Violations) > 0 || len(data.ConformaReleasePreview.SkippedRuns) > 0) waiting := isMainRepo && len(data.ConformaReleasePreview.InProgressRuns) > 0 + buildFailed, buildRunning := false, false for _, g := range data.PipelineGroups { if len(g.PipelineRuns) == 0 { continue @@ -269,11 +275,14 @@ func computeTagOverallStatus(data *TagData, isMainRepo bool) { continue } if latest.Running { + buildRunning = true waiting = true } else { + buildFailed = true failed = true } } + data.PipelinesRunning = buildRunning && !buildFailed switch { case failed: @@ -365,6 +374,7 @@ func ComputeGroupStatus(groups []PipelineGroup) { groups[i].PipelineRuns = runs if len(runs) > 0 { groups[i].AllPassed = runs[0].Succeeded + groups[i].Running = !runs[0].Succeeded && runs[0].Running } } } diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go index 3703560..cd897fb 100644 --- a/pkg/serve/tag_test.go +++ b/pkg/serve/tag_test.go @@ -434,3 +434,66 @@ func TestComputeTagOverallStatus(t *testing.T) { }) } } + +func TestComputeTagOverallStatus_PipelinesRunning(t *testing.T) { + buildGroup := func(name string, succeeded, running bool) PipelineGroup { + return PipelineGroup{Name: name, PipelineRuns: []PipelineRunInfo{{Succeeded: succeeded, Running: running}}} + } + + tests := []struct { + name string + groups []PipelineGroup + expectRunning bool + }{ + { + name: "running when all latest runs are running", + groups: []PipelineGroup{buildGroup("a", false, true), buildGroup("b", false, true)}, + expectRunning: true, + }, + { + name: "not running when a latest run failed", + groups: []PipelineGroup{buildGroup("a", false, true), buildGroup("b", false, false)}, + expectRunning: false, + }, + { + name: "not running when all latest runs succeeded", + groups: []PipelineGroup{buildGroup("a", true, false)}, + expectRunning: false, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + data := TagData{PipelineGroups: test.groups} + computeTagOverallStatus(&data, false) + if data.PipelinesRunning != test.expectRunning { + t.Errorf("PipelinesRunning = %v, expected %v", data.PipelinesRunning, test.expectRunning) + } + }) + } +} + +func TestComputeGroupStatus_Running(t *testing.T) { + newer := time.Date(2025, 2, 1, 0, 0, 0, 0, time.UTC) + older := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + + groups := []PipelineGroup{{ + Name: "scanner-on-push", + PipelineRuns: []PipelineRunInfo{ + {Name: "old", CreationTimestamp: older, Succeeded: true}, + {Name: "new", CreationTimestamp: newer, Running: true}, + }, + }} + + ComputeGroupStatus(groups) + + if groups[0].AllPassed { + t.Error("AllPassed = true, expected false for a running latest run") + } + if !groups[0].Running { + t.Error("Running = false, expected true for a running latest run") + } + if groups[0].PipelineRuns[0].Name != "new" { + t.Errorf("latest run = %q, expected the newest run to be sorted first", groups[0].PipelineRuns[0].Name) + } +} From ff75858bd7391d14edf81f45cffb74a2b0fe6be7 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 14:41:31 +0100 Subject: [PATCH 22/28] serve: compute the pipeline running status before the error return The overall status computation returns early on retrieval errors, which skipped the PipelinesRunning computation and left the Pipeline Runs widget showing failed while pipelines were running (e.g. a tag whose conforma fetch errored). Compute the build pipeline running status before the error early-return; the overall status logic now reuses the same pass. Co-Authored-By: Claude Code --- pkg/serve/tag.go | 41 +++++++++++++++++++++-------------------- pkg/serve/tag_test.go | 18 ++++++++++++++++++ 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index 7d84184..5d53687 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -247,24 +247,8 @@ func computeTagOverallStatus(data *TagData, isMainRepo bool) { } data.HasViolations = len(data.ConformaDev.Violations) > 0 - // The overall status is "error" when any data could not be retrieved, - // "failed" when prod-like violations were found, prod-like runs were - // skipped or the latest run of a build pipeline run group did not - // succeed, "waiting" while conforma or build pipeline runs are still in - // progress, and "green" only when every build pipeline run group's latest - // run succeeded and, for the main repository, the custom snapshot and the - // operator bundle and index images are present and there are no prod-like - // violations. For other repositories, green build pipeline runs are - // sufficient. - if data.PipelinesError || data.ConformaDev.Error || - (isMainRepo && (data.ConformaReleasePreview.Error || data.SnapshotName == "" || - data.OperatorBundleImage == "" || data.OperatorIndexImage == "")) { - data.OverallStatus = "error" - return - } - - failed := isMainRepo && (len(data.ConformaReleasePreview.Violations) > 0 || len(data.ConformaReleasePreview.SkippedRuns) > 0) - waiting := isMainRepo && len(data.ConformaReleasePreview.InProgressRuns) > 0 + // The pipeline widget's running status is independent of the overall + // status below, so compute it before the error early-return. buildFailed, buildRunning := false, false for _, g := range data.PipelineGroups { if len(g.PipelineRuns) == 0 { @@ -276,14 +260,31 @@ func computeTagOverallStatus(data *TagData, isMainRepo bool) { } if latest.Running { buildRunning = true - waiting = true } else { buildFailed = true - failed = true } } data.PipelinesRunning = buildRunning && !buildFailed + // The overall status is "error" when any data could not be retrieved, + // "failed" when prod-like violations were found, prod-like runs were + // skipped or the latest run of a build pipeline run group did not + // succeed, "waiting" while conforma or build pipeline runs are still in + // progress, and "green" only when every build pipeline run group's latest + // run succeeded and, for the main repository, the custom snapshot and the + // operator bundle and index images are present and there are no prod-like + // violations. For other repositories, green build pipeline runs are + // sufficient. + if data.PipelinesError || data.ConformaDev.Error || + (isMainRepo && (data.ConformaReleasePreview.Error || data.SnapshotName == "" || + data.OperatorBundleImage == "" || data.OperatorIndexImage == "")) { + data.OverallStatus = "error" + return + } + + failed := buildFailed || (isMainRepo && (len(data.ConformaReleasePreview.Violations) > 0 || len(data.ConformaReleasePreview.SkippedRuns) > 0)) + waiting := buildRunning || (isMainRepo && len(data.ConformaReleasePreview.InProgressRuns) > 0) + switch { case failed: data.OverallStatus = "failed" diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go index cd897fb..49cdf41 100644 --- a/pkg/serve/tag_test.go +++ b/pkg/serve/tag_test.go @@ -473,6 +473,24 @@ func TestComputeTagOverallStatus_PipelinesRunning(t *testing.T) { } } +func TestComputeTagOverallStatus_PipelinesRunningDespiteError(t *testing.T) { + // The overall status errors out (e.g. the conforma fetch failed), but the + // pipeline widget still needs its running status. + data := TagData{ + ConformaDev: ConformaResults{Error: true}, + PipelineGroups: []PipelineGroup{{Name: "a", PipelineRuns: []PipelineRunInfo{{Running: true}}}}, + } + + computeTagOverallStatus(&data, false) + + if data.OverallStatus != "error" { + t.Errorf("OverallStatus = %q, expected error", data.OverallStatus) + } + if !data.PipelinesRunning { + t.Error("PipelinesRunning = false, expected true despite the overall error") + } +} + func TestComputeGroupStatus_Running(t *testing.T) { newer := time.Date(2025, 2, 1, 0, 0, 0, 0, time.UTC) older := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) From f87041682f367d65efcb6f2adea16d1849edc0d4 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 14:45:37 +0100 Subject: [PATCH 23/28] serve: offer retest instructions per failed component group Each component group whose newest pipeline run failed (not running and not succeeded) shows a retest button that opens a modal with the single /konflux-retest command for that group's pipeline, gated by the same previous-milestone-passed rule as the milestone button. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 47 +++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 1266759..54874ab 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -227,20 +227,28 @@

Artifacts

{{end}} {{end}}
- {{range $m.Groups}} + {{range $j, $g := $m.Groups}}
▶ - {{.Component}} - {{if .AllPassed}} + {{$g.Component}} + {{if $g.AllPassed}} passed - {{else if .Running}} + {{else if $g.Running}} running {{else}} failed {{end}} ({{len - .PipelineRuns}}) + $g.PipelineRuns}}) + {{if and (not $g.AllPassed) (not $g.Running)}} + {{if $m.Retestable}} + + {{else}} + 🔁 + {{end}} + {{end}} @@ -272,6 +280,25 @@

Artifacts

{{end}}
+ {{if and (not $g.AllPassed) (not $g.Running)}} + + {{end}}
{{end}} {{if $m.FailedPipelines}} @@ -279,8 +306,8 @@

Artifacts

onclick="hideRetestModal(event, 'retest-modal-{{$i}}')">
@@ -333,7 +361,8 @@

Retest failed pipelines

{{template "conforma-policy-note" .}} {{if .ConformaDev.Error}} -

Failed to fetch conforma violations. See errors above.

+

Failed to fetch conforma violations. See errors above. If no pipeline runs + are finished yet, revisit this page later.

{{else}} {{template "conforma-tabs" .DevTabs}} {{end}} From 9aa3dd924fd415290057574b5850a3c456891384 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 14:55:14 +0100 Subject: [PATCH 24/28] serve: fix arch filter default and treat running conforma as waiting The initial architecture filter never applied because the element selector matched ids ending in "-arch-filter-" but the ids end in the group index; use a contains selector. The amd64 option is now explicitly selected as the default. While every conforma run is still in progress, ListConformaViolations now returns the partial result with the in-progress runs instead of erroring, so the serve page shows a running badge and the in-progress tab instead of an error box. The Conforma Dev violations row in the Status card shows Waiting while any pipeline run is still running, instead of a premature No violations. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 10 +++++-- pkg/serve/tag.go | 4 +++ pkg/serve/tag_test.go | 44 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 54874ab..480cc22 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -43,7 +43,7 @@ @@ -153,6 +153,8 @@

Status

Error fetching data {{else if .HasViolations}} {{len .ConformaDev.Violations}} violation(s) + {{else if or .ConformaDev.Waiting .PipelinesRunning}} + Waiting {{else}} No violations {{end}} @@ -335,6 +337,8 @@

Retest failed pipelines

error {{else if .ConformaReleasePreview.Violations}} {{len .ConformaReleasePreview.Violations}} violation(s) + {{else if .ConformaReleasePreview.Waiting}} + running {{else}} no violations {{end}} @@ -355,6 +359,8 @@

Retest failed pipelines

error {{else if .HasViolations}} {{len .ConformaDev.Violations}} violation(s) + {{else if .ConformaDev.Waiting}} + running {{else}} no violations {{end}} @@ -388,7 +394,7 @@

Retest failed pipelines

} // Apply the initially selected architecture (the first option) to each // group, since the dropdown has no "all" option. - var archFilters = document.querySelectorAll('select[id$="-arch-filter-"]'); + var archFilters = document.querySelectorAll('select[id*="-arch-filter-"]'); for (var i = 0; i < archFilters.length; i++) { filterViolations(archFilters[i]); } diff --git a/pkg/serve/tag.go b/pkg/serve/tag.go index 5d53687..5487de0 100644 --- a/pkg/serve/tag.go +++ b/pkg/serve/tag.go @@ -180,6 +180,9 @@ type ConformaResults struct { InProgressRuns []ConformaRun SkippedRuns []ConformaRun Error bool + // Waiting reports that the checks are still running and nothing has been + // verified yet. + Waiting bool } func convertConformaResult(result konflux.ConformaViolations) ConformaResults { @@ -189,6 +192,7 @@ func convertConformaResult(result konflux.ConformaViolations) ConformaResults { Groups: groupViolations(violations), InProgressRuns: convertConformaRuns(result.InProgressRuns), SkippedRuns: convertConformaRuns(result.SkippedRuns), + Waiting: len(result.InProgressRuns) > 0 && len(result.Violations.Violations) == 0 && len(result.SkippedRuns) == 0, } } diff --git a/pkg/serve/tag_test.go b/pkg/serve/tag_test.go index 49cdf41..2e57f57 100644 --- a/pkg/serve/tag_test.go +++ b/pkg/serve/tag_test.go @@ -6,6 +6,7 @@ import ( "time" kflx "github.com/stackrox/relacs/pkg/client/konflux" + "github.com/stackrox/relacs/pkg/konflux" ) func TestViolationImageGroup(t *testing.T) { @@ -273,6 +274,49 @@ func TestMilestoneStatus(t *testing.T) { } } +func TestConvertConformaResult_Waiting(t *testing.T) { + tests := []struct { + name string + result konflux.ConformaViolations + expected bool + }{ + { + name: "waiting when only in-progress runs", + result: konflux.ConformaViolations{InProgressRuns: []konflux.ConformaRunInfo{{Name: "run"}}}, + expected: true, + }, + { + name: "not waiting when violations were found", + result: konflux.ConformaViolations{ + Violations: konflux.Violations{Violations: []konflux.Violation{{Image: "main", Violation: "v"}}}, + InProgressRuns: []konflux.ConformaRunInfo{{Name: "run"}}, + }, + expected: false, + }, + { + name: "not waiting when runs were skipped", + result: konflux.ConformaViolations{ + SkippedRuns: []konflux.ConformaRunInfo{{Name: "run"}}, + InProgressRuns: []konflux.ConformaRunInfo{{Name: "run"}}, + }, + expected: false, + }, + { + name: "not waiting when everything was read", + result: konflux.ConformaViolations{}, + expected: false, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + if got := convertConformaResult(test.result).Waiting; got != test.expected { + t.Errorf("Waiting = %v, expected %v", got, test.expected) + } + }) + } +} + func TestComputeTagOverallStatus(t *testing.T) { buildGroup := func(name string, succeeded, running bool) PipelineGroup { return PipelineGroup{Name: name, PipelineRuns: []PipelineRunInfo{{Succeeded: succeeded, Running: running}}} From 6c199ca81e0fcec0b3fb283d3c304886245e6954 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 14:56:32 +0100 Subject: [PATCH 25/28] serve: show waiting badge on the Conforma Dev widget The Conforma Dev widget badge shows waiting instead of no violations while any pipeline run is still running, matching the Status card row. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index 480cc22..d93f877 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -359,8 +359,8 @@

Retest failed pipelines

error {{else if .HasViolations}} {{len .ConformaDev.Violations}} violation(s) - {{else if .ConformaDev.Waiting}} - running + {{else if or .ConformaDev.Waiting .PipelinesRunning}} + waiting {{else}} no violations {{end}} From 7a89f1d45818da5a9ff9170ad7a3aeae157c4eb2 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 14:58:12 +0100 Subject: [PATCH 26/28] serve: copy button for the retest instructions The retest modals have a clipboard button that copies the /konflux-retest commands to the user's clipboard, with brief visual feedback. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/static/style.css | 3 +++ cmd/relacs/serve/templates/tag.html | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/cmd/relacs/serve/templates/static/style.css b/cmd/relacs/serve/templates/static/style.css index f25e86a..9df33f0 100644 --- a/cmd/relacs/serve/templates/static/style.css +++ b/cmd/relacs/serve/templates/static/style.css @@ -93,6 +93,9 @@ details[open] > summary .chevron { transform: rotate(90deg); } .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 100; } .modal-content { max-width: 640px; width: 90%; } .modal-content pre { white-space: pre-wrap; word-break: break-all; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 8px; padding: 0.75rem 1rem; } +.copy-wrapper { position: relative; } +.copy-button { position: absolute; top: 0.5rem; right: 0.5rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px; cursor: pointer; padding: 0.25rem 0.5rem; font-size: 0.85rem; } +.copy-button:hover { opacity: 0.8; } .errors li { margin-left: 1.25rem; color: var(--color-failed); } input[type="text"], input[type="number"], select { padding: 0.5rem 0.75rem; diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index d93f877..dfb76b0 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -290,7 +290,11 @@

Retest failed pipelines

To retest the failed pipelineruns, add a comment on {{if $.CommitURL}}{{slice $.CommitSHA 0 12}}{{else}}the tagged commit{{end}}.

-
/konflux-retest {{$g.Name}} tag:{{$.Tag}}
+
+
/konflux-retest {{$g.Name}} tag:{{$.Tag}}
+ +

Note: This command was generated to retest the currently failed pipelines. Succeeded and in progress pipelines are not retested. Revisit this page to see the latest status.

@@ -311,8 +315,12 @@

Retest failed pipelines

To retest the failed pipelineruns, add a comment on {{if $.CommitURL}}{{slice $.CommitSHA 0 12}}{{else}}the tagged commit{{end}}.

-
{{range $m.FailedPipelines}}/konflux-retest {{.}} tag:{{$.Tag}}
+                
+
{{range $m.FailedPipelines}}/konflux-retest {{.}} tag:{{$.Tag}}
 {{end}}
+ +

Note: This command was generated to retest the currently failed pipelines. Succeeded and in progress pipelines are not retested. Revisit this page to see the latest status.

@@ -406,5 +414,13 @@

Retest failed pipelines

document.getElementById(id).style.display = 'none'; } } + function copyRetestCommands(id, button) { + var text = document.getElementById(id).textContent.trim(); + navigator.clipboard.writeText(text).then(function () { + var original = button.innerHTML; + button.innerHTML = '✓ Copied'; + setTimeout(function () { button.innerHTML = original; }, 1500); + }); + } {{end}} From 6194832d5ee8b26bf37d9f047df5899061553e43 Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Fri, 13 Nov 2026 15:09:48 +0100 Subject: [PATCH 27/28] serve: one retest comment per failed pipeline in the milestone modal Retesting multiple pipelines takes one comment per pipeline, each with a single /konflux-retest command, not one combined comment. The milestone modal now shows one copyable command block per failed pipeline and the note reflects the plural. Co-Authored-By: Claude Code --- cmd/relacs/serve/templates/tag.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/relacs/serve/templates/tag.html b/cmd/relacs/serve/templates/tag.html index dfb76b0..6f10b11 100644 --- a/cmd/relacs/serve/templates/tag.html +++ b/cmd/relacs/serve/templates/tag.html @@ -312,17 +312,18 @@

Retest failed pipelines

onclick="hideRetestModal(event, 'retest-modal-{{$i}}')">