UN-3230 [FEAT] Implement back-off retry mechanism for API deployment client#12
Merged
jaseemjaskp merged 7 commits intomainfrom Feb 16, 2026
Merged
Conversation
…client Add exponential back-off retry with full jitter to APIDeploymentsClient for improved reliability against transient 5xx errors and 429 rate limits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Version updates are handled separately during the release process. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ritwik-g
reviewed
Feb 11, 2026
ritwik-g
reviewed
Feb 11, 2026
ritwik-g
reviewed
Feb 11, 2026
- Add python-dotenv to both PDM and uv dev dependencies so tests/client_test.py can run standalone without ModuleNotFoundError - Fix pre-commit default Python version from python3.9 to python3 - Refine structure_file pending detection: only set pending=True on 2xx responses (POST 422 indicates setup errors, not queued work) - Fix trailing newlines in utils.py and sample.env - Update tests to match new 422 pending behavior and fix docstring formatting Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ritwik-g
approved these changes
Feb 11, 2026
jaseemjaskp
reviewed
Feb 11, 2026
vishnuszipstack
approved these changes
Feb 11, 2026
jaseemjaskp
reviewed
Feb 12, 2026
jaseemjaskp
requested changes
Feb 12, 2026
Contributor
jaseemjaskp
left a comment
There was a problem hiding this comment.
Migrate this project entirely into uv . it looks like you already added the lock file and some of the pyproject.toml file changed into UV
jaseemjaskp
requested changes
Feb 12, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jaseemjaskp
reviewed
Feb 16, 2026
- Replace black, flake8, isort, pycln with ruff for linting and formatting - Bump pre-commit hooks: ruff-pre-commit v0.15.1, uv-pre-commit 0.10.2, docformatter v1.7.7 - Fix deprecated default_stages: 'commit' -> 'pre-commit' - Bump deps: ruff>=0.15.0, pre-commit>=4.0.0 (dropping autopep8, black, flake8, flake8-pyproject, isort) - Update CI: astral-sh/setup-uv@v7, remove separate setup-python step - Apply ruff formatting to source and tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jaseemjaskp
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
APIDeploymentsClientmax_retries,initial_delay,max_delay,backoff_factorWhy
How
_request_with_retry()wrapping all HTTP callsmin(initial_delay * backoff_factor^attempt, max_delay)with full jitterRetry-Afterheader for 429 responsesseek(0)) before each retry attemptpyproject.tomlpdm.lockwithuv.lock.github/workflows/main.yml) to use uv instead of PDM.pre-commit-config.yamlto useuv-lockhook instead ofpdm-lock-check.gitignorewith uv-specific entriesCan this PR break any existing features. If yes, please list possible items. If no, please explain why.
max_retries=0disables retries entirely. The PDM→uv migration is a build tooling change only; the published package remains identical.Database Migrations
Env Config
Relevant Docs
Related Issues or PRs
Dependencies Versions
random,time, and existingrequests)Notes on Testing
tests/test_retry.pycovering: defaults, retryable status codes, delay calculation, connection errors, retry exhaustion, non-retryable codes, Retry-After header, file seek on retry, disabled retry, async vs sync mode behaviorScreenshots
N/A
Checklist
I have read and understood the Contribution Guidelines.