Skip to content

fix: download CLI to temp dir and retry GPG key import - #68

Open
thomasrockhu-codecov wants to merge 4 commits into
mainfrom
fix/dirty-git-state-and-gpg-import
Open

fix: download CLI to temp dir and retry GPG key import#68
thomasrockhu-codecov wants to merge 4 commits into
mainfrom
fix/dirty-git-state-and-gpg-import

Conversation

@thomasrockhu-codecov

@thomasrockhu-codecov thomasrockhu-codecov commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add an opt-in cleanup setting (CC_CLEANUP in the packaged wrapper), defaulting to false
  • When enabled, download and verify CLI artifacts in a temporary directory and remove them on exit
  • Preserve downloaded binaries for download_only and binary_location workflows
  • Retry Codecov GPG key imports up to three times with explicit failure reporting
  • Keep all implementation changes in scripts/; dist/ remains generated and unchanged

Test plan

  • Validate all source scripts with bash -n scripts/*.sh
  • Run python -m pytest
  • Verify the PR diff contains only source files under scripts/
  • Generate and publish dist/codecov.sh through the normal release tooling

Fixes two regressions in the wrapper script:

1. Dirty git state (codecov/codecov-action#1851, codecov/codecov-action#1804):
   The binary, SHA256SUM, and SHA256SUM.sig files were downloaded into the
   working directory (repo root) and never cleaned up. Now downloads to a
   mktemp -d directory with an EXIT trap that removes it automatically.

2. GPG import failures (codecov/codecov-action#1876): The key import used
   `echo "$(curl ...)" | gpg --import` which strips trailing newlines from
   the PGP key, had no retries, and no error checking. Now pipes curl
   directly to gpg with a 3-attempt retry loop and explicit failure
   reporting.

Made-with: Cursor
@thomasrockhu-codecov

Copy link
Copy Markdown
Collaborator Author

Closing as part of stale P5 PR cleanup.

thomasrockhu-codecov and others added 3 commits August 10, 2026 14:56
Keep downloads in the working directory by default while allowing callers to isolate and remove temporary verification artifacts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@thomasrockhu-codecov
thomasrockhu-codecov marked this pull request as ready for review August 11, 2026 00:32
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.

3 participants