Skip to content

Add Codecov CI upload and project configuration#229

Open
ibm-adarsh wants to merge 3 commits into
kubernetes-sigs:mainfrom
ibm-adarsh:add-codecov-integration
Open

Add Codecov CI upload and project configuration#229
ibm-adarsh wants to merge 3 commits into
kubernetes-sigs:mainfrom
ibm-adarsh:add-codecov-integration

Conversation

@ibm-adarsh
Copy link
Copy Markdown
Contributor

@ibm-adarsh ibm-adarsh commented Jun 4, 2026

#130
Upload cover.out from unit tests on pull requests and main pushes.

Summary by CodeRabbit

  • New Features

    • Automated code coverage uploads on pushes and pull requests with branch/patch checks, coverage thresholds, and PR comments showing coverage and diffs.
  • Documentation

    • Contributing guide updated to explain the automated coverage workflow and threshold expectations.
  • Chores

    • Added CI workflow and coverage configuration, including coverage precision, reporting ranges, and ignored paths.

Upload cover.out from unit tests on pull requests and main pushes.
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2026
@k8s-ci-robot k8s-ci-robot requested review from aliok and jaideepr97 June 4, 2026 14:14
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ibm-adarsh
Once this PR has been reviewed and has the lgtm label, please assign mrunalp for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 4, 2026

Deploy Preview for mcp-lifecycle-operator ready!

Name Link
🔨 Latest commit f1223d7
🔍 Latest deploy log https://app.netlify.com/projects/mcp-lifecycle-operator/deploys/6a22594600cad3000876f05d
😎 Deploy Preview https://deploy-preview-229--mcp-lifecycle-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 4, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @ibm-adarsh. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 4, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1109a44-1805-4f7b-b046-45aaa3d6fa57

📥 Commits

Reviewing files that changed from the base of the PR and between d4d85eb and 6c0ed14.

📒 Files selected for processing (3)
  • .codecov.yml
  • .github/workflows/codecov.yaml
  • site-src/contributing/index.md
✅ Files skipped from review due to trivial changes (1)
  • site-src/contributing/index.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .codecov.yml

📝 Walkthrough

Walkthrough

Adds Codecov integration: a GitHub Actions workflow runs tests and uploads cover.out on pushes and PRs to main. A .codecov.yml file defines reporting rules, PR comment layout, and ignores generated/applyconfiguration files. Contributor docs note the CI coverage behavior.

Changes

Codecov Integration

Layer / File(s) Summary
CI workflow for Codecov uploads
.github/workflows/codecov.yaml
Workflow triggers on push and PR to main, checks out code, sets up Go from go.mod, runs go mod tidy and make test to generate coverage, then uploads cover.out to Codecov with a pinned action (codecov/codecov-action v6.0.0).
Codecov reporting configuration
.codecov.yml
Sets coverage precision to 2 decimals with downward rounding, configures status checks for project and patch (enabled with targets), disables per-change status evaluation, sets PR comment layout (header, diff), notifies after 1 build, and ignores **/zz_generated.*.go and **/applyconfiguration/**.
Contributing documentation update
site-src/contributing/index.md
Adds a CI coverage bullet explaining that pushes and PRs to main upload cover.out to Codecov and lists the configured coverage thresholds.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through coverage lands,
With Codecov's banner in its hands,
Each test run leaves a shining trace,
Generated code finds a gentle place,
Contributors follow the mapped-out strands.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding Codecov CI upload configuration and project setup files (.codecov.yml and codecov.yaml workflow).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@ibm-adarsh
Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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 @.github/workflows/codecov.yaml:
- Around line 34-35: The CODECOV_TOKEN environment is being set unconditionally
for the codecov/codecov-action upload step which fails on fork PRs where the
secret is unavailable; update the upload step (the step that sets CODECOV_TOKEN)
to skip execution when the token is empty by adding a conditional guard (e.g.,
an if that checks secrets.CODECOV_TOKEN != '' or similar) so the upload is
skipped for forked PRs, leaving the rest of the workflow intact.
- Around line 19-20: The checkout step named "Clone the code" currently uses
actions/checkout without disabling credential persistence; update that step (the
actions/checkout@... usage) to include a with: persist-credentials: false
setting so GITHUB_TOKEN is not left configured for later Git commands.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f8b7262-ea14-406b-ba7c-0eefcbe59868

📥 Commits

Reviewing files that changed from the base of the PR and between b7521b0 and d4d85eb.

📒 Files selected for processing (3)
  • .codecov.yml
  • .github/workflows/codecov.yaml
  • site-src/contributing/index.md

Comment thread .github/workflows/codecov.yaml Outdated
Comment thread .github/workflows/codecov.yaml Outdated
@ibm-adarsh ibm-adarsh changed the title [WIP]: Add Codecov CI upload and project configuration Add Codecov CI upload and project configuration Jun 4, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2026
Add harden-runner and persist-credentials: false, rely on the Codecov
GitHub App for upload, and enforce project/patch coverage gates.
@ibm-adarsh
Copy link
Copy Markdown
Contributor Author

#130 Upload cover.out from unit tests on pull requests and main pushes.

Summary by CodeRabbit

  • New Features

    • Automated code coverage uploads triggered on pull requests and pushes to main, with PR comments displaying coverage metrics and file-level diffs.
    • Configurable coverage precision and reporting ranges with threshold policies.
  • Documentation

    • Updated contributing guide to document the automated coverage workflow for developers.
  • Chores

    • Added Codecov configuration and GitHub Actions workflow for coverage reporting.

Reference: https://github.com/kubernetes-sigs/secrets-store-csi-driver/blob/main/.github/workflows/codecov.yaml

@ibm-adarsh
Copy link
Copy Markdown
Contributor Author

Govul check fix: #228

@ibm-adarsh
Copy link
Copy Markdown
Contributor Author

@aliok , Please take a look once you get sometime.

@Cali0707
Copy link
Copy Markdown
Member

Cali0707 commented Jun 5, 2026

@ibm-adarsh can you add the codecov into the existing test workflow? Otherwise we are duplicating that test execution between two workflows for no need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants