Integration of codecov on the cert-manager-operator#79334
Conversation
WalkthroughThis PR adds code coverage instrumentation to the cert-manager-operator CI pipeline. It introduces a coverage image build target, adds a coverage collection hook to the e2e operator job, and reorganizes the e2e coverage workflow with explicit setup, test execution, and publish phases. ChangesE2E Coverage Instrumentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 12✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[REHEARSALNOTIFIER]
Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals. Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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
`@ci-operator/config/openshift/cert-manager-operator/openshift-cert-manager-operator-master.yaml`:
- Around line 90-104: The presubmit job includes a post step that uploads
coverage using a secret (the post block with the step "as: collect-coverage",
"commands: hack/e2e-coverage.sh collect", and "credentials:
cert-manager-operator-codecov-token") which should not run in presubmit; remove
or disable this "collect-coverage" post step (and its credentials mount) from
the e2e-operator presubmit configuration so only the existing
"publish-e2e-coverage" postsubmit path performs coverage uploads, leaving the
rest of the post/chain: gather steps intact.
🪄 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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 54b4fe3e-af75-4416-8139-585e85de20b5
⛔ Files ignored due to path filters (2)
ci-operator/jobs/openshift/cert-manager-operator/openshift-cert-manager-operator-master-postsubmits.yamlis excluded by!ci-operator/jobs/**ci-operator/jobs/openshift/cert-manager-operator/openshift-cert-manager-operator-master-presubmits.yamlis excluded by!ci-operator/jobs/**
📒 Files selected for processing (1)
ci-operator/config/openshift/cert-manager-operator/openshift-cert-manager-operator-master.yaml
| post: | ||
| - as: collect-coverage | ||
| best_effort: true | ||
| cli: latest | ||
| commands: hack/e2e-coverage.sh collect | ||
| credentials: | ||
| - mount_path: /var/run/secrets/codecov | ||
| name: cert-manager-operator-codecov-token | ||
| namespace: test-credentials | ||
| from: src | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| timeout: 15m0s | ||
| - chain: gather |
There was a problem hiding this comment.
Avoid Codecov-token uploads in presubmit e2e-operator.
This adds secret-backed coverage upload to a presubmit path while publish-e2e-coverage already uploads coverage postsubmit. Keeping upload only in postsubmit reduces secret exposure and avoids duplicate external uploads.
Suggested diff
steps:
- post:
- - as: collect-coverage
- best_effort: true
- cli: latest
- commands: hack/e2e-coverage.sh collect
- credentials:
- - mount_path: /var/run/secrets/codecov
- name: cert-manager-operator-codecov-token
- namespace: test-credentials
- from: src
- resources:
- requests:
- cpu: 100m
- timeout: 15m0s
- - chain: gather
+ post:
+ - chain: gather📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| post: | |
| - as: collect-coverage | |
| best_effort: true | |
| cli: latest | |
| commands: hack/e2e-coverage.sh collect | |
| credentials: | |
| - mount_path: /var/run/secrets/codecov | |
| name: cert-manager-operator-codecov-token | |
| namespace: test-credentials | |
| from: src | |
| resources: | |
| requests: | |
| cpu: 100m | |
| timeout: 15m0s | |
| - chain: gather | |
| post: | |
| - chain: gather |
🤖 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
`@ci-operator/config/openshift/cert-manager-operator/openshift-cert-manager-operator-master.yaml`
around lines 90 - 104, The presubmit job includes a post step that uploads
coverage using a secret (the post block with the step "as: collect-coverage",
"commands: hack/e2e-coverage.sh collect", and "credentials:
cert-manager-operator-codecov-token") which should not run in presubmit; remove
or disable this "collect-coverage" post step (and its credentials mount) from
the e2e-operator presubmit configuration so only the existing
"publish-e2e-coverage" postsubmit path performs coverage uploads, leaving the
rest of the post/chain: gather steps intact.
|
@siddhibhor-56: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This PR integrates Codecov-based code coverage collection into the cert-manager-operator's OpenShift CI pipeline.
Affected Component:
openshift/cert-manager-operatorCI configuration (openshift-cert-manager-operator-master.yaml)Changes Made:
The PR adds comprehensive code coverage instrumentation to the cert-manager-operator's CI workflow:
Coverage Image Build: Adds a new container image build that produces a
cert-manager-operator-coverageimage fromimages/ci/Dockerfile.coverage, enabling coverage-instrumented builds during CI runs.E2E Test Coverage Collection: Expands the
e2e-operatorworkflow with coverage collection capabilities:setup-coveragestep that initializes the coverage environment before tests runteststep that runsmake test-e2ewith the existingE2E_GINKGO_LABEL_FILTERconfigurationpostphase that executeshack/e2e-coverage.sh collectto gather coverage data after test completion, with Codecov credentials injected from a mounted secretCoverage Publishing Workflow: Introduces a new
publish-e2e-coverageworkflow section that:hack/e2e-coverage.sh collectgatherstepPractical Impact: The cert-manager-operator CI pipeline now automatically collects, processes, and publishes code coverage metrics to Codecov with each e2e test run, providing improved visibility into test coverage and enabling coverage trend tracking over time without manual intervention.