Skip to content

Commit 9a104b4

Browse files
soodokuclaude
andauthored
Stop an apt mirror hiccup from failing a required job (#70)
On 5 August the R Integration & Workflow Tests job failed with E: Failed to fetch .../noble-cran40/Packages.gz File has unexpected size (62232 != 61419). Mirror sync in progress? after the tests had already passed. Because that job is a required context, it blocked PR #66 -- a virtualenv bump closing an open security advisory -- for five days. The real defect is inverted criticality rather than a missing retry. The step exists only to install gpg so the Codecov uploader can verify its signature, and the upload immediately below it already runs with fail_ci_if_error: false. A required job was hard-failing on a helper for an upload that is explicitly allowed to fail. So both halves: a bounded retry with backoff, which recovers from a mirror mid-sync in the common case, and continue-on-error for when it does not. Failures still surface as ::warning:: annotations so a persistent apt problem stays visible rather than vanishing, and an uninstalled gpg leaves the Codecov upload unverified and saying so. The script stays POSIX: this step runs in a container whose default shell is sh -e, not bash. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 208b052 commit 9a104b4

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,32 @@ jobs:
445445
pytest tests/scenarios/ -v --tb=short --cov=rmcp --cov-append
446446
447447
- name: Install gpg for Codecov uploader verification
448+
# Best-effort by design. The only thing that wants gpg is the Codecov
449+
# upload below, and that step already runs with fail_ci_if_error: false
450+
# -- so a required job was hard-failing on a helper for an upload that
451+
# is itself allowed to fail. The criticality was inverted.
452+
#
453+
# Not hypothetical. On 5 August this step failed with
454+
# E: Failed to fetch .../noble-cran40/Packages.gz
455+
# File has unexpected size (62232 != 61419). Mirror sync in progress?
456+
# *after* the tests had already passed. Because "R Integration & Workflow
457+
# Tests" is a required context, that mirror hiccup blocked PR #66 -- a
458+
# security bump closing an open advisory -- for five days.
459+
#
460+
# Retries cover a mirror mid-sync, which clears in minutes.
461+
# continue-on-error covers the case where it does not.
462+
continue-on-error: true
448463
run: |
449-
apt-get update -qq && apt-get install -y -qq gpg
464+
set -u
465+
for attempt in 1 2 3; do
466+
if apt-get update -qq && apt-get install -y -qq gpg; then
467+
echo "gpg installed on attempt $attempt"
468+
exit 0
469+
fi
470+
echo "::warning::apt failed on attempt $attempt; retrying"
471+
sleep $((attempt * 10))
472+
done
473+
echo "::warning::could not install gpg; the Codecov upload proceeds unverified"
450474
451475
- name: Upload coverage to Codecov
452476
uses: codecov/codecov-action@v7

0 commit comments

Comments
 (0)