Skip to content

ci(coverage): add Codecov integration with OIDC auth#3684

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
jkhelil:add-codecov-integration
Jul 8, 2026
Merged

ci(coverage): add Codecov integration with OIDC auth#3684
tekton-robot merged 1 commit into
tektoncd:mainfrom
jkhelil:add-codecov-integration

Conversation

@jkhelil

@jkhelil jkhelil commented Jul 8, 2026

Copy link
Copy Markdown
Member

Changes

Add Codecov integration to track and gate coverage on PRs

.codecov.yaml (new file):

  • 5% project coverage drop threshold (auto target against main)
  • Patch gating disabled — PRs only fail on overall project threshold
  • Excludes generated, vendor, test, docs, and operatorhub directories

.github/workflows/go-coverage.yml (updated):

  • Adds codecov/codecov-action@v6.0.2 upload step with OIDC auth
  • No CODECOV_TOKEN secret required — uses GitHub OIDC JWT
  • Tagged with unit-tests flag for future flag analytics
  • fail_ci_if_error: true so upload failures surface in CI
  • Keeps the existing fgrosse/go-coverage-report PR comment step

Jira: https://redhat.atlassian.net/browse/SRVKP-12309

Submitter Checklist

  • Run make test lint before submitting a PR
  • Includes tests (if functionality changed/added) — CI only change, no tests needed
  • Includes docs (if user facing) — not user facing
  • Commit messages follow commit message best practices

Release Notes

NONE

Made with Cursor

Add .codecov.yaml config mirroring the PAC project settings:
5% project threshold, patch gating disabled, generated/vendor/
test/docs/operatorhub directories excluded from coverage.

Update go-coverage.yml to upload coverage to Codecov using
OIDC (no token secret required), tagged with the unit-tests
flag, alongside the existing fgrosse/go-coverage-report step.

Signed-off-by: Jawed khelil <jkhelil@redhat.com>
Assisted-by: Claude Sonnet 4.6 (via Cursor)
Co-authored-by: Cursor <cursoragent@cursor.com>
@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Jul 8, 2026
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 8, 2026
@codecov-commenter

Copy link
Copy Markdown

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 ☂️

@chmouel

chmouel commented Jul 8, 2026

Copy link
Copy Markdown
Member

/lgtm

@tekton-robot

Copy link
Copy Markdown
Contributor

@chmouel: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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/test-infra repository.

@infernus01 infernus01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2026
@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pramodbindal

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

The pull request process is described 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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2026
@tekton-robot tekton-robot merged commit 6ce06ca into tektoncd:main Jul 8, 2026
16 checks passed
Comment thread .codecov.yaml
ignore:
- "**/zz_generated*.go"
- "pkg/client/**"
- "pkg/apis/**"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is that directory ignored? I see most files there have corresponding test file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes i will drop it

files: ${{ github.workspace }}/src/github.com/tektoncd/operator/coverage.txt
flags: unit-tests
use_oidc: true
fail_ci_if_error: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really want to block the PR (because it runs on pull_requests and push) if for some reason this fails to upload the data? IMO that should be false or use continue-on-error: true.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. 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.

7 participants