Skip to content

ci: collect + upload coverage to Codecov#32

Merged
nficano merged 1 commit into
mainfrom
chore/codecov-upload
May 25, 2026
Merged

ci: collect + upload coverage to Codecov#32
nficano merged 1 commit into
mainfrom
chore/codecov-upload

Conversation

@nficano
Copy link
Copy Markdown
Contributor

@nficano nficano commented May 25, 2026

Summary

  • Enable --collect:"XPlat Code Coverage" on the unit test run (the test projects already reference coverlet.collector).
  • Upload the produced Cobertura XML(s) under TestResults/ to Codecov.
  • fail_ci_if_error: false so a Codecov outage cannot break CI.

Pre-merge action required

  • Add CODECOV_TOKEN as a repo secret (gh secret set CODECOV_TOKEN --repo agentruntimecontrolprotocol/fsharp-sdk).
  • Activate the repo at app.codecov.io.

Test plan

  • Merge, confirm coverage uploads on next push to main.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced automated testing workflows with code coverage collection and reporting to improve code quality monitoring.

Review Change Stack

Enable `--collect:"XPlat Code Coverage"` on the unit test run
(coverlet.collector is already a dev dependency in both test projects)
and upload the produced Cobertura XML(s) to Codecov non-blockingly.

Requires CODECOV_TOKEN to be set as a repo secret.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Walkthrough

The GitHub Actions test workflow is modified to collect code coverage during unit test execution and upload the coverage results to Codecov. The test step now includes XPlat code coverage collection with configured output directory, and a new Codecov upload step is added with pinned action version and non-blocking CI failure handling.

Changes

Code Coverage Integration

Layer / File(s) Summary
Test workflow coverage collection and upload
.github/workflows/test.yml
Unit test step adds --collect:"XPlat Code Coverage" with logger and results directory; new Codecov upload step reads from TestResults directory using pinned codecov/codecov-action commit SHA with fail_ci_if_error: false.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 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 accurately summarizes the main change: enabling code coverage collection and uploading it to Codecov in the CI 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
  • Commit unit tests in branch chore/codecov-upload

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

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: 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 @.github/workflows/test.yml:
- Line 94: The workflow comment for the Codecov action is incorrect: the action
is pinned to commit e79a6962e0d4c0c17b229090214935d2e33f8354 but annotated as “#
v6.0.1”; fix this by either changing the pinned reference to the commit that
actually corresponds to tag v6.0.1 (cddd853df119a48c5be31a973f8cd97e12e35e16) or
by removing/updating the trailing version comment to match the pinned commit
(i.e., update the comment on the uses:
codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 line to the
correct tag/commit or change the pin to
`@cddd853df119a48c5be31a973f8cd97e12e35e16`).
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: aead45c5-c2af-4e3a-a43c-91a6547db6ca

📥 Commits

Reviewing files that changed from the base of the PR and between 5485c9a and 6c7c68c.

📒 Files selected for processing (1)
  • .github/workflows/test.yml

# outage cannot break CI.
- name: Upload coverage to Codecov
# codecov/codecov-action v6.0.1
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify codecov-action SHA matches v6.0.1 and check for latest releases

# Check if the SHA matches the v6.0.1 tag
echo "=== Checking if SHA e79a6962e0d4c0c17b229090214935d2e33f8354 matches v6.0.1 ==="
gh api repos/codecov/codecov-action/git/ref/tags/v6.0.1 --jq '.object.sha'

# List recent releases to see if newer versions exist
echo -e "\n=== Recent releases of codecov/codecov-action ==="
gh api repos/codecov/codecov-action/releases --jq '.[:5] | .[] | "\(.tag_name) - \(.published_at) - \(.name)"'

# Check what commit the SHA points to
echo -e "\n=== Commit details for SHA e79a6962e0d4c0c17b229090214935d2e33f8354 ==="
gh api repos/codecov/codecov-action/commits/e79a6962e0d4c0c17b229090214935d2e33f8354 --jq '{sha: .sha, message: .commit.message, date: .commit.committer.date}'

Repository: agentruntimecontrolprotocol/fsharp-sdk

Length of output: 645


Fix the mismatched v6.0.1 version annotation for codecov/codecov-action.

  • .github/workflows/test.yml:94 pins codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354, but the v6.0.1 tag points to cddd853df119a48c5be31a973f8cd97e12e35e16, so # v6.0.1 is inaccurate—either pin the v6.0.1 tag commit or correct/remove the version comment.
  • No newer release than v6.0.1 appeared in the recent releases returned.
🤖 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 @.github/workflows/test.yml at line 94, The workflow comment for the Codecov
action is incorrect: the action is pinned to commit
e79a6962e0d4c0c17b229090214935d2e33f8354 but annotated as “# v6.0.1”; fix this
by either changing the pinned reference to the commit that actually corresponds
to tag v6.0.1 (cddd853df119a48c5be31a973f8cd97e12e35e16) or by removing/updating
the trailing version comment to match the pinned commit (i.e., update the
comment on the uses:
codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 line to the
correct tag/commit or change the pin to
`@cddd853df119a48c5be31a973f8cd97e12e35e16`).

@nficano nficano merged commit fbe863f into main May 25, 2026
3 checks passed
@nficano nficano deleted the chore/codecov-upload branch May 25, 2026 01:42
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.

1 participant