Skip to content

fix(client): support HTTP dates in Retry-After - #3470

Open
ktsomani wants to merge 1 commit into
python-gitlab:mainfrom
ktsomani:codex/support-retry-after-dates
Open

ktsomani wants to merge 1 commit into
python-gitlab:mainfrom
ktsomani:codex/support-retry-after-dates

Conversation

@ktsomani

@ktsomani ktsomani commented Nov 16, 2026 •

Copy link
Copy Markdown

When a retryable response includes an HTTP date in Retry-After, Retry.handle_retry_on_status() tries to convert it to an integer and raises ValueError before retrying.

Accept integer delays and HTTP dates as specified in RFC 9110 §10.2.3. Interpret dates without an explicit time zone as UTC and clamp past dates to a zero-second delay.

The four new regression cases cover all three HTTP date formats and a date in the past. They failed before the fix and passed afterward. The existing numeric-delay test still passes.

Full unit suite on Python 3.11: 724 passed, 5 skipped. Black and git diff --check passed.

Prepared with assistance from OpenAI Codex.

@ktsomani
ktsomani marked this pull request as ready for review November 16, 2026 19:13
@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.79%. Comparing base (a4053bf) to head (dfdf2fe).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3470   +/-   ##
=======================================
  Coverage   95.78%   95.79%           
=======================================
  Files         100      100           
  Lines        6172     6181    +9     
=======================================
+ Hits         5912     5921    +9     
  Misses        260      260           
Flag Coverage Δ
api_func_v4 83.74% <50.00%> (-0.18%) ⬇️
cli_func_v4 78.70% <20.00%> (-0.09%) ⬇️
unit 90.34% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
gitlab/utils.py 98.67% <100.00%> (+0.08%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

1 participant