Skip to content

CI: Fix the GitHub fallback of the download retries - #3499

Merged
dweindl merged 1 commit into
AMICI-dev:mainfrom
dweindl:fix_retry_downloads_host
Oct 29, 2026
Merged

dweindl merged 1 commit into
AMICI-dev:mainfrom
dweindl:fix_retry_downloads_host

Conversation

@dweindl

@dweindl dweindl commented Oct 28, 2026

Copy link
Copy Markdown
Member

Fixes the GitHub fallback from #3497 for downloads passed as urllib.request.Request, as pandas and PEtab do. The fallback re-used a copy of the failed request, to which the failed attempt had added a Host: cdn.jsdelivr.net header, so raw.githubusercontent.com replied with 404 (e.g., this notebook test in the merge queue). Now, a new request with the original headers is created.

Furthermore, dropped connections and timeouts while waiting for the response, which urlopen doesn't wrap in a URLError, are now retried; only HTTP(S) downloads are retried (not, e.g., missing local files); and only jsDelivr URLs with a branch or commit fall back to GitHub, since without a ref, or with a version (range), jsDelivr serves a release whose GitHub ref may differ.

🤖 Generated with Claude Code

If a jsDelivr download that was passed as a `urllib.request.Request`, as
by pandas and PEtab, failed, the GitHub fallback re-used a copy of that
request. The failed attempt had added a `Host: cdn.jsdelivr.net` header
to it, so raw.githubusercontent.com replied with 404 or 421. Create a
new request with the original headers instead.

Furthermore:
* Retry dropped connections and timeouts while waiting for the
  response, which `urlopen` doesn't wrap in a `URLError`.
* Only retry HTTP(S) downloads, not, e.g., missing local files.
* Only fall back to GitHub for jsDelivr URLs with a branch or commit.
  Without a ref, or with a version (range), jsDelivr serves a release,
  whose GitHub ref may differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.23%. Comparing base (6140d68) to head (6b785f4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3499   +/-   ##
=======================================
  Coverage   80.23%   80.23%           
=======================================
  Files         331      331           
  Lines       23400    23400           
  Branches     1627     1627           
=======================================
  Hits        18774    18774           
  Misses       4620     4620           
  Partials        6        6           
Flag Coverage Δ
cpp 74.67% <ø> (ø)
cpp_python 34.64% <ø> (ø)
petab 46.64% <ø> (ø)
petab_sciml 16.62% <ø> (ø)
petab_sciml_benchmarks 15.21% <ø> (ø)
python 72.54% <ø> (ø)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl
dweindl marked this pull request as ready for review October 28, 2026 22:10
@dweindl
dweindl requested a review from a team as a code owner October 28, 2026 22:10
@dweindl
dweindl enabled auto-merge October 28, 2026 22:11
@dweindl
dweindl added this pull request to the merge queue Oct 29, 2026
Merged via the queue into AMICI-dev:main with commit c9d6411 Oct 29, 2026
29 checks passed
@dweindl
dweindl deleted the fix_retry_downloads_host branch October 29, 2026 09:19
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.

2 participants