Skip to content

Add support for retry of HTTP requests #1384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 63 commits into from
Jul 25, 2023
Merged

Add support for retry of HTTP requests #1384

merged 63 commits into from
Jul 25, 2023

Conversation

HantingZhang2
Copy link
Contributor

What does this PR do?

Adding retry and configuration options to the client

Additional Notes

Review checklist

Please check relevant items below:

  • This PR includes all newly recorded cassettes for any modified tests.

  • This PR does not rely on API client schema changes.

    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days.
Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity.

@github-actions github-actions bot added the stale label May 14, 2023
@github-actions github-actions bot removed the stale label Jul 18, 2023
@HantingZhang2 HantingZhang2 marked this pull request as ready for review July 18, 2023 20:16
@HantingZhang2 HantingZhang2 requested a review from a team as a code owner July 18, 2023 20:16
Copy link
Contributor

@therve therve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cassette file is unused, we should write a test using it.

@HantingZhang2 HantingZhang2 requested a review from therve July 24, 2023 13:08
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jul 25, 2023
@HantingZhang2 HantingZhang2 merged commit afd63b3 into master Jul 25, 2023
@HantingZhang2 HantingZhang2 deleted the add-retry branch July 25, 2023 10:05
github-actions bot pushed a commit that referenced this pull request Jul 25, 2023
* add retry and its configs

* auto reformat

* format

* redo is_retry and rewrite retry config options

* Reformat

* Fix syntax & add test

* Fixe test & adjusting retry impl

* pre-commit fixes

* Update template

* Fix import

* pre-commit fixes

* change retry import

* remove retry import

* remove saving content of the response

* update cassette

* delete env file

* update cassette

* use mock for test_retry

* pre-commit fixes

* use urllib3 for requests

* pre-commit fixes

* fix return format

* pre-commit fixes

* add response header

* pre-commit fixes

* change retry test

* pre-commit fixes

* update test_retry

* pre-commit fixes

* use call count

* pre-commit fixes

* Update .generator/src/generator/templates/rest.j2

Co-authored-by: Thomas Hervé <[email protected]>

* pre-commit fixes

* Add back test

* pre-commit fixes

* Fix content encoding

* touch up rest client and test

* pre-commit fixes

* add test without reset header

* pre-commit fixes

* change allowed method check

* Minor tweaks

* Use cassette for errors as well

* Docs

---------

Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: Thomas Hervé <[email protected]> afd63b3
@therve therve changed the title Add retry Add support for retry of HTTP requests Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/Added documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants