Skip to content

Install codecov CLI from PyPI (pinned) to fix broken upload verification - #2399

Merged
spomichter merged 3 commits into
mainfrom
stash/fix/codecov-gpg-key
Jun 6, 2026
Merged

spomichter merged 3 commits into
mainfrom
stash/fix/codecov-gpg-key

Conversation

@spomichter

@spomichter spomichter commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2398.

What

Every codecov upload step is hard-failing (example run):

gpg: no valid OpenPGP data found.
gpg: Can't check signature: No public key
==> Could not verify signature. Please contact Codecov if problem continues

The codecov-action wrapper downloads the codecov CLI binary from cli.codecov.io at runtime and GPG-verifies it — but fetches the verification key from https://keybase.io/codecovsecurity/pgp_keys.asc with a bare curl -s, and that URL went hard-404 (SELF-SIGNED PUBLIC KEY NOT FOUND) on 2026-06-06 between ~13:30 and 18:10 UTC, breaking uploads globally. Upstream: codecov/codecov-action#1955 (today's outage), #1876 (the same fetch flaking since Sept 2025).

Fix

Set on every codecov-action step:

use_pypi: true
version: "11.2.8"
  • use_pypi installs the CLI via pip install codecov-cli instead of downloading a binary from cli.codecov.io — no keybase key fetch, no cli.codecov.io dependency. Trust model becomes pip/PyPI TLS, the same as other CI dependencies.
  • Pinning version stops the uploader from changing under CI untracked, and also sidesteps the latest republish races that caused the April outage ([BUG] Intermittent GPG signature failures on windows-latest runners codecov/codecov-action#1940, BAD signature with a good key).

An earlier revision of this PR fixed it by pre-seeding the GPG key from a vendored copy (keeps the action's signature verification alive); see the history if we ever want that back. The PyPI route was preferred as the smaller, cleaner change.

Note for review: the self-hosted runners (ROS container, macOS, large) need a pip on PATH for use_pypi to work — this CI run is the validation of that.

This is a workaround; revert when codecov fixes the key distribution upstream.

The codecov-action v6 wrapper downloads its signing key from
https://keybase.io/codecovsecurity/pgp_keys.asc with a bare `curl -s`
(no --fail, no retries). That URL now returns 404, so gpg imports an
error page ("no valid OpenPGP data found") and the subsequent
`gpg --verify` of the codecov CLI fails every upload:

    gpg: Can't check signature: No public key
    ==> Could not verify signature. Please contact Codecov if problem continues

Upstream: codecov/codecov-action#1876.

Vendor the Codecov Uploader Verification Key
(2703 4E7F DB85 0E0B BC2C 62FF 806B B28A ED77 9869, taken from
codecov's own copy in codecov/test-results-action and cross-checked
against the Ubuntu keyserver) and import it into the runner's default
keyring before the codecov steps. The wrapper's verify falls back to
the default keyring, so signature checking keeps working without
disabling verification.
@greptile-apps

greptile-apps Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes broken Codecov upload steps across all CI jobs by switching away from the default binary download path (cli.codecov.io + keybase.io GPG key verification) which was failing globally due to a dead keybase.io URL.

  • GitHub-hosted runners (tests, ci-complete): use_pypi: true + version: \"11.2.8\" is added to every codecov/codecov-action@v6 step, directing the action to install the CLI via pip instead of fetching a binary from cli.codecov.io.
  • Self-hosted runners (self-hosted-tests for Linux/macOS, self-hosted-large-tests): a new "Install codecov CLI" step uses uv venv .codecov-venv + uv pip install codecov-cli==11.2.8 to pre-install the pinned CLI, and the upload steps reference it via binary: .codecov-venv/bin/codecovcli (since pip is not on PATH on self-hosted machines and use_pypi would fail there).
  • The version 11.2.8 is pinned consistently across all six paths (three job types × two upload steps each).

Confidence Score: 5/5

Safe to merge — all Codecov upload paths are covered and the pinned version is consistent across job types.

The change is a targeted CI workaround touching only codecov-action configuration. All five affected jobs receive the correct fix (use_pypi for GitHub-hosted runners, pre-installed venv + binary path for self-hosted runners), the version pin is applied uniformly at 11.2.8, and the existing step ordering is preserved. No application code is modified.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Three distinct fix strategies (use_pypi, pre-installed venv binary, and binary path reference) applied correctly to every Codecov upload step across all five CI jobs; version 11.2.8 is pinned consistently throughout.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CI Job needs Codecov upload] --> B{Runner type?}
    B -->|GitHub-hosted\ntests / ci-complete| C[use_pypi: true\nversion: 11.2.8]
    C --> D[codecov-action installs\ncli via pip at runtime]
    D --> G[Upload succeeds]
    B -->|Self-hosted\nself-hosted-tests\nself-hosted-large-tests| E[Install codecov CLI step\nuv venv .codecov-venv\nuv pip install codecov-cli==11.2.8]
    E --> F[codecov-action steps use\nbinary: .codecov-venv/bin/codecovcli]
    F --> G
Loading

Reviews (3): Last reviewed commit: "Self-hosted runners: pre-install codecov..." | Re-trigger Greptile

@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Replace the vendored-GPG-key pre-seed with use_pypi: true and a pinned
codecov-cli version on every codecov-action step. pip installs the CLI
from PyPI instead of downloading a binary from cli.codecov.io, which
sidesteps the broken keybase.io key fetch entirely (and also the
latest-version republish races seen in codecov/codecov-action#1940).
Pinning to 11.2.8 keeps the uploader from changing under CI untracked.
@spomichter spomichter changed the title Pre-seed Codecov GPG key to fix broken signature verification Install codecov CLI from PyPI (pinned) to fix broken upload verification Jun 6, 2026
Comment thread .github/workflows/ci.yml Resolved
use_pypi fails on the self-hosted runners (`pip: command not found` --
Python there is uv-managed, no pip binary on PATH). Install the pinned
codecov-cli into a dedicated venv with uv and pass it to the action via
the `binary` input instead. GitHub-hosted jobs keep use_pypi.
@spomichter
spomichter merged commit 928e2d7 into main Jun 6, 2026
33 of 43 checks passed
@spomichter
spomichter deleted the stash/fix/codecov-gpg-key branch June 6, 2026 20:50
@Dreamsorcerer

Copy link
Copy Markdown
Collaborator

I'd expect a little more flakiness with codecov this month, as it's just changed hands from Sentry to Harness, so I'd expect some teething issues as the new company takes it over.

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: codecov-action v6 fails GPG verification — keybase.io key URL returns 404

3 participants