Skip to content

chore: resurrect codecov reports#6324

Merged
LesnyRumcajs merged 3 commits intomainfrom
resurrect-codecov
Dec 11, 2025
Merged

chore: resurrect codecov reports#6324
LesnyRumcajs merged 3 commits intomainfrom
resurrect-codecov

Conversation

@LesnyRumcajs
Copy link
Member

@LesnyRumcajs LesnyRumcajs commented Dec 9, 2025

Summary of changes

Changes introduced in this pull request:

  • regular GH workers don't have enough space, so we need to run the coverage on buildjet. It should be fine, cost-wise.
  • resurrected coverage doesn't include integration tests; it'd be awkward to do so.

Reference issue to close (if applicable)

Closes #6282

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Summary by CodeRabbit

  • Chores
    • Set up project-wide code coverage tracking and Codecov integration.
    • Added an automated workflow to generate and upload coverage reports to Codecov.
    • Replaced the CI status badge in the README with a Codecov badge.

✏️ Tip: You can customize this high-level summary in your review settings.

@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner December 9, 2025 17:36
@LesnyRumcajs LesnyRumcajs requested review from hanabi1224 and sudo-shashank and removed request for a team December 9, 2025 17:36
@LesnyRumcajs LesnyRumcajs marked this pull request as draft December 9, 2025 17:36
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

Adds Codecov integration: a Codecov config file, a new GitHub Actions workflow that generates Rust coverage with cargo-llvm-cov and uploads results to Codecov, and replaces the README Actions badge with a Codecov badge.

Changes

Cohort / File(s) Summary
Codecov configuration
​.github/codecov.yml
New Codecov config: disables requiring CI pass for Codecov, enables Codecov comments, sets patch/project coverage status to informational (project threshold 1.0), and disables github_checks annotations.
Coverage workflow
​.github/workflows/coverage.yml
New "Code coverage" GitHub Actions workflow: triggers on workflow_dispatch, pull_request to main, and push to main (with path ignores); sets CI env vars; installs sccache, Go toolchain, cargo-llvm-cov, and nextest; runs cargo llvm-cov to produce lcov.info, uploads artifact, and posts to Codecov using token.
Documentation
README.md
Replaces existing GitHub Actions badge in README with a Codecov badge.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer (PR / Push)
    participant GH as GitHub Actions
    participant Runner as Ubuntu Runner
    participant Tools as cargo-llvm-cov / nextest
    participant Art as Artifact Store
    participant Codecov as Codecov

    Dev->>GH: push / open PR / dispatch
    GH->>Runner: start "Code coverage" job
    Runner->>Runner: checkout repo, setup sccache, Go, install tools
    Runner->>Tools: run cargo llvm-cov (generate lcov.info)
    Tools-->>Runner: lcov.info
    Runner->>Art: upload lcov.info artifact
    Runner->>Codecov: upload lcov.info with token
    Codecov-->>GH: (optional) comment/status on PR (comments enabled)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to: .github/workflows/coverage.yml (tool versions, caching, timeouts, path ignores, artifact handling), .github/codecov.yml (status thresholds and comment settings), and README badge link correctness.

Suggested reviewers

  • hanabi1224
  • sudo-shashank

Pre-merge checks and finishing touches

✅ 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 'chore: resurrect codecov reports' clearly and concisely summarizes the main change: re-enabling Codecov integration for the project.
Linked Issues check ✅ Passed The PR implementation addresses all three completion criteria from issue #6282: Codecov is integrated into CI with a new workflow, the Codecov bot will post results via the configured upload step, and a Codecov badge has been added to the README.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing Codecov integration as specified in #6282; no unrelated or out-of-scope modifications are present in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch resurrect-codecov

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b684b1 and 50216ca.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: LesnyRumcajs
Repo: ChainSafe/forest PR: 5907
File: src/rpc/methods/state.rs:523-570
Timestamp: 2025-08-06T15:44:33.467Z
Learning: LesnyRumcajs prefers to rely on BufWriter's Drop implementation for automatic flushing rather than explicit flush() calls in Forest codebase.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Coverage
  • GitHub Check: All lint checks
  • GitHub Check: tests-release
  • GitHub Check: tests
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: Build Ubuntu
  • GitHub Check: Build MacOS
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Link Check
  • GitHub Check: Check
🔇 Additional comments (1)
README.md (1)

8-8: Verify the security implications of the public token in the Codecov badge URL.

The Codecov badge URL includes a public token (token=1OHO2CSD17). Confirm that this token has appropriate scope/permissions and is not overly privileged. Codecov public badge tokens are typically safe, but verify this is the correct approach for the organization's security posture.


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

@LesnyRumcajs LesnyRumcajs force-pushed the resurrect-codecov branch 7 times, most recently from ea510f4 to 2d45c89 Compare December 10, 2025 13:53
@LesnyRumcajs LesnyRumcajs marked this pull request as ready for review December 10, 2025 13:55
Copy link
Contributor

@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

🧹 Nitpick comments (1)
.github/workflows/coverage.yml (1)

67-71: Update codecov-action to v5 for latest features and CLI improvements.

v4 and v5 of the Codecov GitHub Action use the Codecov CLI with more features, while v3 and below lack access to CLI features like global upload token and ATS. The current v3 is outdated. Consider upgrading to v5 (latest: v5.5.1).

       - name: Upload CodeCov
-        uses: codecov/codecov-action@v3
+        uses: codecov/codecov-action@v5
         with:
           token: ${{ secrets.CODECOV_TOKEN }}
           files: lcov.info
           fail_ci_if_error: true
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f76faaa and 3b684b1.

📒 Files selected for processing (3)
  • .github/codecov.yml (1 hunks)
  • .github/workflows/coverage.yml (1 hunks)
  • README.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: LesnyRumcajs
Repo: ChainSafe/forest PR: 5907
File: src/rpc/methods/state.rs:523-570
Timestamp: 2025-08-06T15:44:33.467Z
Learning: LesnyRumcajs prefers to rely on BufWriter's Drop implementation for automatic flushing rather than explicit flush() calls in Forest codebase.
🪛 actionlint (1.7.9)
.github/workflows/coverage.yml

39-39: label "buildjet-4vcpu-ubuntu-2204" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


67-67: the runner of "codecov/codecov-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 markdownlint-cli2 (0.18.1)
README.md

8-8: Images should have alternate text (alt text)

(MD045, no-alt-text)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Coverage
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build MacOS
  • GitHub Check: Build Ubuntu
  • GitHub Check: All lint checks
🔇 Additional comments (4)
.github/codecov.yml (1)

1-14: Configuration looks good.

The Codecov setup appropriately enables PR comments, sets informational defaults, and doesn't block CI on coverage checks—suitable for establishing a baseline coverage.

.github/workflows/coverage.yml (3)

52-59: Verify that coverage generation correctly excludes benchmarks per PR objectives.

The PR objectives require "Coverage should consider only Rust tests (ignore benchmarks)." The cargo llvm-cov --workspace --codecov --output-path lcov.info nextest command should exclude benchmarks by default (since --bench flag is not used), but please verify this aligns with your testing configuration and workspace setup.


39-40: BuildJet runner choice is intentional and well-documented.

The PR description explicitly mentions "Run coverage on BuildJet because regular GitHub workers lack sufficient disk space," so using the buildjet-4vcpu-ubuntu-2204 label is appropriate. The static analysis tool flags this because it only knows GitHub's native runners, but BuildJet is a legitimate third-party service. No change needed.


1-71: Workflow structure and configuration look solid.

The workflow properly handles concurrency, skips draft PRs, sets up necessary tools (sccache, Go), and uses appropriate timeouts. The integration with Codecov aligns well with the configuration in .github/codecov.yml and the README badge. The path ignores for docs workflows avoid unnecessary runs.

LesnyRumcajs and others added 2 commits December 10, 2025 15:00
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Dec 11, 2025
Merged via the queue into main with commit d4a9718 Dec 11, 2025
54 checks passed
@LesnyRumcajs LesnyRumcajs deleted the resurrect-codecov branch December 11, 2025 08:27
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.

Add Codecov to Forest

2 participants