Skip to content

Conversation

@thomasrockhu-codecov
Copy link
Collaborator

Summary

Fixes random CI/CD pipeline failures caused by intermittent GPG key import failures when downloading the verification key from keybase.io.

Problem

  • No error checking on curl command (silent failures with -s flag)
  • No retry logic for network failures
  • No validation that the key was successfully downloaded
  • No error handling for GPG import failures
  • No informative logging for debugging

This caused random CI/CD pipeline failures for all users, as the verification process would fail unpredictably when network issues occurred or when keybase.io was temporarily unavailable.

Solution

  • Added retry loop (3 attempts with 2-second delays)
  • Added explicit error checking for curl command with -f flag
  • Added validation that downloaded key is not empty
  • Added error checking for GPG import operation
  • Added informative logging for each attempt
  • Provide clear error message suggesting CODECOV_SKIP_VALIDATION workaround if all attempts fail

Testing

  • Tested retry logic with simulated network failures
  • Verified successful import on first attempt when network is stable
  • Verified proper error handling and logging on failures
  • Confirmed backward compatibility with existing workflows

Related Issues

Release

This includes version bump to 0.2.8

This commit addresses random CI/CD pipeline failures caused by intermittent
GPG key import failures when downloading the verification key from keybase.io.

Problem:
- No error checking on curl command (silent failures)
- No retry logic for network failures
- No validation that the key was successfully downloaded
- No error handling for GPG import failures

Solution:
- Added retry loop (3 attempts with 2-second delays)
- Added explicit error checking for curl with -f flag
- Added validation that downloaded key is not empty
- Added error checking for GPG import operation
- Added informative logging for each attempt

Related: codecov/codecov-action#1876
@sentry
Copy link

sentry bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.14%. Comparing base (b636c79) to head (1daddc8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #66   +/-   ##
=======================================
  Coverage   97.14%   97.14%           
=======================================
  Files           2        2           
  Lines          35       35           
=======================================
  Hits           34       34           
  Misses          1        1           

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

@AndreKurait
Copy link

@thomasrockhu-codecov @calvin-codecov This looks good, we have seen this happening occasionally. Any release target to get this merged?

Comment on lines -22 to -23
else
CODECOV_COMMAND="${CODECOV_CLI_TYPE}"

Choose a reason for hiding this comment

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

I don't see an earlier check to make sure CODECOV_COMMAND is guaranteed "codecov-cli" or "sentry-prevent-cli" here like in codecov.sh.

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.

4 participants