Skip to content

list-conforma-*: add --scenario flag for acs-conforma-prod-like - #114

Open
tommartensen wants to merge 1 commit into
tm/redo-conforma-commandsfrom
tm/conforma-followup
Open

tommartensen wants to merge 1 commit into
tm/redo-conforma-commandsfrom
tm/conforma-followup

Conversation

@tommartensen

Copy link
Copy Markdown
Contributor

Summary

Stacked on #113 (tm/redo-conforma-commands).

list-conforma-runs and list-conforma-violations currently only cover the acs-conforma-dev policy: they discover PipelineRuns via pipelines-as-code labels on the tag's commit, so the acs-conforma-prod-like runs attached to the custom snapshot are invisible to them.

This PR adds a --scenario flag to both commands:

  • acs-conforma-dev (default) — unchanged: conforma runs triggered directly on the tag's commit via pipelines-as-code.
  • acs-conforma-prod-like (only supported for the stackrox repository, otherwise the command errors) — snapshot-based flow:
    1. find the custom snapshot for the tag,
    2. derive the versioned scenario name from the snapshot's appstudio.openshift.io/application label (e.g. acs-conforma-prod-like-4-10; nightly → unversioned),
    3. list the conforma PipelineRuns attached to the snapshot (appstudio.openshift.io/snapshot + scenario labels). list-conforma-runs outputs these; list-conforma-violations feeds them into the same per-run logic as the dev flow (latest run per component+scenario, in-progress detection, report parsing).
  • Unknown scenario values error out.

The per-run violations logic was extracted into violationsFromPipelineRuns so both scenarios share it.

Testing

  • go build ./..., go vet ./..., go test ./... pass
  • New gock tests covering: prod-like violations (asserting the versioned scenario label), prod-like runs listing, prod-like on a non-stackrox repo (error), unknown scenario (error)
  • Existing dev-flow tests updated for the new signature

🤖 Generated with Claude Code

Both commands accept --scenario (default acs-conforma-dev,
alternatively acs-conforma-prod-like, only supported for the
stackrox repository). The dev scenario keeps the pipelines-as-code
discovery on the tag's commit. The prod-like scenario finds the
custom snapshot for the tag, derives the versioned scenario name
from the snapshot's application label and lists the conforma
pipeline runs attached to the snapshot; the violations command
applies the existing per-run logic to those runs. Unknown scenario
values and prod-like for non-stackrox repositories error out.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@tommartensen
tommartensen requested a review from a team as a code owner November 13, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant