AAP-79952 - feat: add Konflux contract validation pipeline#454
AAP-79952 - feat: add Konflux contract validation pipeline#454dmzoneill wants to merge 1 commit into
Conversation
Add PipelinesAsCode configuration and Dockerfile for automated billing contract validation. When a PR is opened against devel, Konflux builds an image containing automation-analytics-backend with the PR's schemas installed, deploys to an ephemeral namespace, and runs the billing test suite to validate contract compliance. New files: - .tekton/contract-validation-pull-request.yaml: PipelineRun triggered on PRs to devel via PipelinesAsCode - Dockerfile.contract-validation: Builds test image with backend code and the PR branch of metrics-utility installed
📝 WalkthroughSummary by CodeRabbit
WalkthroughTwo new files are added: ChangesContract-validation CI build pipeline
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.tekton/contract-validation-pull-request.yaml (1)
43-44: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConsider pinning the pipeline bundle to a specific version.
Using
:latestmeans pipeline behavior can change unexpectedly when the upstream catalog is updated, potentially breaking builds. Pinning to a digest or release tag improves reproducibility.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.tekton/contract-validation-pull-request.yaml around lines 43 - 44, The bundle parameter in the pipeline configuration is using the :latest tag which causes unpredictable behavior since it will pull whatever version is currently latest from the upstream catalog. Replace the :latest tag in the bundle value with a specific version, release tag, or digest to ensure reproducible and stable builds. This change should be made to the bundle value assignment to pin it to a known stable version instead of dynamically resolving to whatever is latest.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.tekton/contract-validation-pull-request.yaml:
- Around line 43-44: The bundle parameter in the pipeline configuration is using
the :latest tag which causes unpredictable behavior since it will pull whatever
version is currently latest from the upstream catalog. Replace the :latest tag
in the bundle value with a specific version, release tag, or digest to ensure
reproducible and stable builds. This change should be made to the bundle value
assignment to pin it to a known stable version instead of dynamically resolving
to whatever is latest.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: aab864ef-16cb-479a-a555-dec69378348f
📒 Files selected for processing (2)
.tekton/contract-validation-pull-request.yamlDockerfile.contract-validation
|
| ARG METRICS_UTILITY_REF=devel | ||
|
|
||
| WORKDIR /opt/app-root/src | ||
| RUN git clone --depth 1 https://gitlab.cee.redhat.com/automation-analytics/automation-analytics-backend.git . |
There was a problem hiding this comment.
this seems to make upstream tests dependent on the state of a private gitlab repo .. that doesn't sounds right
iff this were to be used for failing PR checks, it would be a wrong thing to depend on a private repo
iff this is used to notify us or analytics of incompatible changes, it shouldn't be a problem
PR description seems to indicate the former, discussions the latter 🤷
| RUN pip install --no-deps git+https://github.com/ansible/metrics-utility.git@${METRICS_UTILITY_REF} | ||
|
|
||
| EXPOSE 8080 | ||
| CMD ["./launcher"] |
There was a problem hiding this comment.
assuming this is inteded to run launcher with APP="billing-validator", how?
Nothing sets APP in this PR, and nothing uses the billing-validator string that launcher checks for?
(or is contract-validation different from billing-validator and just not there yet?)
(or is this always overriden by pytest -m billing?)
Claude seems to think there's a whole bonfire clowdapp setup around it that eventually ends up running the equivalent of pytest -m billing somewhere, which matches the PR description, so probably this is fine.
himdel
left a comment
There was a problem hiding this comment.
in konflux-release-data:
c-contract-validation.yamlconfigure-pacmeans this reports as a github checkits-contract-billing.yamlhas atest.appstudio.openshift.io/optional: "false"label, making this a required check
upstream should not have required checks depending on private repos
|
TLDR on what it does, from
The I wonder if this should only run a subset? Cc @hunterkepley , the scope of what's being tested is probably relevant to the contract too :) |



Summary
.tekton/contract-validation-pull-request.yaml) to trigger billing contract validation on PRs todevelDockerfile.contract-validationthat builds a test image containing automation-analytics-backend with the PR's version of metrics-utility installedHow it works
When a PR is opened against
devel:aap-aa-contract-tenantKonflux namespacepytest -m billingPrerequisites
aap-aa-contract-tenantmust be created in konflux-release-data (separate MR)METRICS_UTILITY_REFbuild arg (separate MR)Related
Generated with Claude Code