feat: support custom cli image for verify-enterprise-contract task#9
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe pipeline adds optional custom ChangesCustom ec CLI support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
452ba84 to
c11681f
Compare
01f5fe8 to
400ba73
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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.
Inline comments:
In @.tekton/pipelines/conforma-e2e/pipeline.yaml:
- Around line 252-253: The image tag generation in the pipeline is using
CUSTOM_EC_CLI_REVISION directly, which can be a branch name and produce invalid
tags like cli-pr-feature/foo. Update the tagging logic in the pipeline step that
sets CLI_SHA and CUSTOM_IMAGE to derive the short SHA from the checked-out
commit after checkout (using the checked-out commit’s revision) instead of
slicing the raw revision string. Keep the existing variables, but ensure the tag
is always based on a valid commit hash.
- Line 244: The credentialed pipeline step currently installs crane with a
moving `@latest` tag, which makes the build non-reproducible and can pull unvetted
binaries. Update the install in the pipeline step to use a specific vetted
release/version instead of `@latest`, and keep the change localized to the crane
installation command in the Tekton pipeline definition.
In `@tests/contract/contract.go`:
- Around line 190-193: The contract test setup is overriding the generator with
customTaskSpec, which forces task embedding and bypasses TaskRef. Remove that
override from the shared BeforeEach in contract.go so the release-policy cases
continue to exercise the TaskRef path via tekton.VerifyEnterpriseContract and
pkg/utils/tekton/generators.go, and keep the custom task spec only in tests that
explicitly verify embedded task behavior.
- Around line 177-187: The custom EC CLI setup in the contract test currently
falls back to verify_ec_task_bundle when only one of CUSTOM_EC_CLI_IMAGE or
CUSTOM_EC_TASK_YAML is set, which hides misconfiguration. Update the logic in
contract.go around the customImage/taskYAML handling to explicitly detect
partial configuration and fail fast with an assertion or fatal error if exactly
one env var is present. Keep the existing LoadAndPatchTaskImage path for the
full custom setup and the ConfigMap fallback only when both env vars are unset.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: a96157ef-8984-445e-9d15-21cca2e2781d
📒 Files selected for processing (4)
.tekton/pipelines/conforma-e2e/pipeline.yamlpkg/utils/tekton/generators.gopkg/utils/tekton/task_override.gotests/contract/contract.go
55e7065 to
02e1dce
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
02e1dce to
cb9f415
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
test pass with ec vesion same as custom-ec-cli-revision |
When CUSTOM_EC_CLI_IMAGE and CUSTOM_EC_TASK_YAML env vars are set, the e2e tests load the task definition from disk, replace all quay.io/conforma/cli step images with the custom image, and embed the patched task inline instead of resolving it from a bundle. This enables cli PRs to be validated against their own code rather than the mainline release. The pipeline accepts optional custom-ec-cli-url and custom-ec-cli-revision params. When provided, it clones the cli repo, builds the binary, layers it onto the base image with crane, and pushes a throwaway tag for tests. docs: add custom cli testing instructions to README Ref: EC-1913 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cb9f415 to
303becd
Compare
robnester-rh
left a comment
There was a problem hiding this comment.
Looks good, my only comment would have been pinning crane for reproducibility, but your explanation makes sense as to why it's not a concern.
When CUSTOM_EC_CLI_IMAGE and CUSTOM_EC_TASK_YAML env vars are set, the e2e tests load the task definition from disk, replace all quay.io/conforma/cli step images with the custom image, and embed the patched task inline instead of resolving it from a bundle. This enables CLI PRs to be validated against their own code rather than the mainline release.
Ref: EC-1913