Skip to content

chore(ci): bump codecov-action from v2 to v5 - #2307

Open
ruflin wants to merge 2 commits into
9.xfrom
chore/bump-codecov-action
Open

chore(ci): bump codecov-action from v2 to v5#2307
ruflin wants to merge 2 commits into
9.xfrom
chore/bump-codecov-action

Conversation

@ruflin

@ruflin ruflin commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

codecov/codecov-action@v2 is several majors behind the current v5.5.x
line. Bump to v5 and align with the new input contract:

  • Pass token from the CODECOV_TOKEN secret (still works for the
    tokenless fallback if no secret is configured).
  • Set fail_ci_if_error: false so a flaky upload does not block the
    build.
  • Conditionally enable use_oidc to work around the
    v5.4.1 regression
    that breaks OIDC token requests on fork pull requests.

Identified during a P0/P1 code-review pass.

Test plan

  • Run the workflow once on this PR; confirm coverage upload succeeds.
  • Validate YAML.

Summary by CodeRabbit

  • Chores
    • Updated the continuous integration workflow’s Codecov upload step to the latest action version, with improved coverage upload handling and more secure token-based integration.
    • Adjusted the workflow behavior so OIDC is only used when appropriate, and CI won’t fail solely due to coverage upload errors.
    • Reflected the CI change in the Unreleased changelog entry.

Copilot AI review requested due to automatic review settings April 30, 2026 20:40
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

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 Plus

Run ID: d6cd5831-b701-44f9-b59b-7c965e63fb0b

📥 Commits

Reviewing files that changed from the base of the PR and between 885f12e and 459c986.

📒 Files selected for processing (2)
  • .github/workflows/continuous-integration.yaml
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • .github/workflows/continuous-integration.yaml

📝 Walkthrough

Walkthrough

The CI workflow upgrades the Codecov GitHub Action from v2 to v5, configures coverage files, token handling, failure tolerance, and conditional OIDC support, and documents these changes in the changelog.

Changes

Codecov CI integration

Layer / File(s) Summary
Configure and document Codecov upload
.github/workflows/continuous-integration.yaml, CHANGELOG.md
The workflow adds OIDC permissions, upgrades Codecov to v5, configures coverage XML inputs and the token, tolerates upload failures, conditionally enables OIDC, and records the updated contract in the changelog.

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 and concisely summarizes the main change: upgrading codecov-action from v2 to v5.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/bump-codecov-action

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the CI workflow to use the current Codecov GitHub Action major version and adapts configuration to the v5 input contract to keep coverage uploads working reliably.

Changes:

  • Bumped codecov/codecov-action from v2 to v5 in the CI workflow.
  • Added v5-specific inputs (token, fail_ci_if_error: false) and a conditional use_oidc setting to avoid fork PR OIDC issues.
  • Documented the change in CHANGELOG.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
CHANGELOG.md Notes the Codecov action bump and related input changes under Unreleased.
.github/workflows/continuous-integration.yaml Switches to codecov/codecov-action@v5 and updates inputs, including conditional OIDC behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


- name: 'Upload coverage to Codecov'
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v5

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

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

uses: entries in this workflow are consistently quoted (e.g., 'actions/checkout@v4', 'shivammathur/setup-php@v2'). For consistency (and to avoid YAML edge cases with @), quote codecov/codecov-action@v5 as well.

Suggested change
uses: codecov/codecov-action@v5
uses: 'codecov/codecov-action@v5'

Copilot uses AI. Check for mistakes.
Comment thread CHANGELOG.md
* Added support for "search after" based pagination [#1645](https://github.com/ruflin/Elastica/issues/1645)
* Added support for the `seq_no_primary_term` search option and the `if_seq_no` / `if_primary_term` index options to enable optimistic concurrency control [#2284](https://github.com/ruflin/Elastica/pull/2284)
### Changed
* Bumped `codecov/codecov-action` from `v2` to `v5` and aligned it with the v5 input contract (`token`, `fail_ci_if_error: false`, conditional `use_oidc`).

Copilot AI Apr 30, 2026

Copy link

Choose a reason for hiding this comment

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

This changelog’s bullet entries in the surrounding section don’t end with periods; this new entry does. Consider removing the trailing period for consistency.

Suggested change
* Bumped `codecov/codecov-action` from `v2` to `v5` and aligned it with the v5 input contract (`token`, `fail_ci_if_error: false`, conditional `use_oidc`).
* Bumped `codecov/codecov-action` from `v2` to `v5` and aligned it with the v5 input contract (`token`, `fail_ci_if_error: false`, conditional `use_oidc`)

Copilot uses AI. Check for mistakes.
ruflin added 2 commits July 28, 2026 22:59
`codecov/codecov-action@v2` is several majors behind the current v5.5.x
line. Bump to v5 and align with the new input contract:

- Pass `token` from the `CODECOV_TOKEN` secret.
- Set `fail_ci_if_error: false` so a flaky upload does not block the build.
- Conditionally enable `use_oidc` to work around the v5.4.1 regression
  that breaks OIDC token requests on fork pull requests.
The conditional use_oidc input made the action request an OIDC token, but
id-token is never part of the default GITHUB_TOKEN scope, so the exchange
failed with 'Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable' and
took the whole PHPUnit job down with it (fail_ci_if_error does not cover an
unhandled error inside the action). Request id-token: write explicitly, plus
contents: read since naming a job-level permissions block drops the rest.
@ruflin
ruflin force-pushed the chore/bump-codecov-action branch from 885f12e to 459c986 Compare July 28, 2026 21:00
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.

2 participants