Skip to content

ci: upload KinD coverage and restore the Codecov target - #2341

Merged
TerryHowe merged 1 commit into
oras-project:mainfrom
sinbumu:ci/kind-codecov-2213
Nov 18, 2026
Merged

TerryHowe merged 1 commit into
oras-project:mainfrom
sinbumu:ci/kind-codecov-2213

Conversation

@sinbumu

@sinbumu sinbumu commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

KinD now produces test/e2e/coverage.txt, but only unit coverage reaches Codecov. This uploads the E2E profile and restores the 75% project target together. Both coverage statuses and the PR comment wait for two processed uploads, avoiding a unit-only status before the E2E report arrives.

  • Reuses the unit workflow's pinned Codecov v7.1.1 action and CODECOV_TOKEN convention.
  • Explicitly selects coverage.txt and test/e2e/coverage.txt, disables extra file discovery, and names the uploads unit-go1.26 and e2e-go1.26 for inspection in Codecov.
  • Uploads E2E coverage whenever collection succeeds and the workflow is not cancelled, including partial coverage after failed tests. Test failures remain failures; upload errors fail the workflow job. Failed/skipped collection produces no E2E upload, so Codecov may remain waiting for its second report.
  • Sets codecov.notify.after_n_builds: 2 and comment.after_n_builds: 2, restores project target: 75%, and removes the obsolete KinD coverage comment. The patch target remains 80% and if_ci_failed: error is preserved.
  • Documents the upload flow, missing-report behavior, and fork authentication. The upload count assumes the current one-version matrices; reruns count as additional uploads, so this is a count gate rather than distinct-job identity enforcement.

Validation:

  • Codecov's public YAML validation endpoint returned Valid!, with both upload counts set to 2, project 75%, patch 80%, and the existing CI failure policy.
  • actionlint (with ShellCheck) passed for both workflows; git diff --check passed.
  • Fresh go test -race -coverprofile=... -covermode=atomic -coverpkg=./... ./... passed and generated the unit report.
  • Official Codecov CLI 11.3.2 do-upload --dry-run --disable-search --fail-on-error selected exactly one unit/E2E report per invocation. A missing explicit report returned exit 1 despite other coverage files being present. No coverage data was uploaded locally.
  • The local E2E dry-run input was reused from ci: collect coverage from KinD e2e tests #2340. The new upstream run on f9a107b9a423f14adafc8c6a92fabaa0e74908c8 then independently passed all 660 race-enabled E2E specs, collected 72.3% Go statement coverage, and published e2e-coverage-go1.26.

Live acceptance on f9a107b9a423f14adafc8c6a92fabaa0e74908c8:

  • codecov/project: 90.23% (target 75.00%).
  • codecov/patch: success, with coverage unaffected because no instrumentable code lines changed.
  • Codecov commit: exactly two MERGED upload sessions, unit-go1.26 from build and e2e-go1.26 from e2e-k8s. Combined coverage recovered to 90.23% from unit-only 74.89%; the issue's historical 88.14% is not used as an exact assertion.
  • At the observed one-session stage, no Codecov checks or PR comment had been published. After both sessions were processed, both checks succeeded and the Codecov comment appeared with 90.23%.
  • All six upstream workflows and DCO succeeded. The separate CodeQL comparison check is neutral because the main branch has an unmatched legacy Go 1.25 analysis configuration; the Go 1.26 analysis job itself succeeded.

Both uploads succeeded from this fork PR using the existing authentication mechanism; no repository secrets or authentication/permission settings were changed. The successful run verifies the normal two-upload path. Remote cancelled, failed-test, and missing-collection scenarios were not deliberately triggered; missing-file rejection was checked locally, and the workflow conditions preserve the existing test/collection failures. Local Go statement coverage and Codecov line coverage are different metrics.

AI assistance was used for implementation and validation.

Which issue(s) this PR fixes:
Fixes #2213

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test? Configuration validation, fresh unit coverage, and uploader dry-runs above.
  • Does this change require a documentation update? Upload and failure behavior documented.
  • Does this introduce breaking changes that would require an announcement or bumping the major version? No.
  • Do all new files have an appropriate license header? Existing headers retained; no new repository files.

Upload the collected e2e profile with the same pinned action and authentication as unit coverage. Name and explicitly select the two reports, wait for both uploads before publishing statuses and comments, and restore the 75% project floor in the same change.

Signed-off-by: sinbumu <[email protected]>
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.23%. Comparing base (f2e8276) to head (f9a107b).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2341       +/-   ##
===========================================
+ Coverage   74.89%   90.23%   +15.34%     
===========================================
  Files         157      157               
  Lines        6584     6584               
===========================================
+ Hits         4931     5941     +1010     
+ Misses       1364      379      -985     
+ Partials      289      264       -25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TerryHowe TerryHowe 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

@TerryHowe
TerryHowe marked this pull request as ready for review November 18, 2026 16:41
@TerryHowe
TerryHowe merged commit fe40552 into oras-project:main Nov 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: upload e2e coverage to codecov and restore the 75% project target

2 participants