Skip to content

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

Closed
thomasrockhu-codecov wants to merge 1 commit intomainfrom
fix/dirty-git-state-and-gpg-import
Closed

fix: download CLI to temp dir and retry GPG key import#1916
thomasrockhu-codecov wants to merge 1 commit intomainfrom
fix/dirty-git-state-and-gpg-import

Conversation

@thomasrockhu-codecov
Copy link
Contributor

Summary

Closes #1851
Closes #1804
Fixes #1876

Test plan

  • Verify normal upload path: binary downloads to temp dir, upload succeeds, no leftover files in repo root
  • Verify CC_BINARY_LOCATION path: binary is moved to the specified location correctly
  • Verify CC_DOWNLOAD_ONLY path: binary is copied to working dir before exit
  • Verify skip_validation path: binary downloads to temp dir, validation is skipped
  • Verify GPG import retry: simulate transient keybase failure, confirm retry works
  • Verify GPG import failure: confirm clear error message after 3 failed attempts
  • Verify git status is clean after action completes (the core bug fix)

Notes

Made with Cursor

Fixes two regressions in the wrapper script:

1. Dirty git state (#1851, #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 (#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
@sentry
Copy link

sentry bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.14%. Comparing base (671740a) to head (9dee4ad).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1916   +/-   ##
=======================================
  Coverage   97.14%   97.14%           
=======================================
  Files           2        2           
  Lines          35       35           
=======================================
  Hits           34       34           
  Misses          1        1           
Flag Coverage Δ
demo-macos-latest 97.14% <ø> (ø)
demo-macos-latest-xlarge 97.14% <ø> (?)
demo-ubuntu-latest 97.14% <ø> (ø)
demo-windows-latest 97.14% <ø> (ø)
script- 97.14% <ø> (?)
script-macos-latest 97.14% <ø> (ø)
script-macos-latest-xlarge 97.14% <ø> (?)
script-ubuntu-latest 97.14% <ø> (ø)
script-windows-latest 97.14% <ø> (ø)
version-macos-latest 97.14% <ø> (ø)
version-maxos-latest-xlarge 97.14% <ø> (?)
version-ubuntu-latest 97.14% <ø> (ø)
version-windows-latest 97.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@thomasrockhu-codecov
Copy link
Contributor Author

Closing — these changes belong in codecov/wrapper, not here. Opening PR there instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants