refactor: split top level client from base client#534
Merged
Conversation
b2dbe67 to
90638b1
Compare
Split the top level client used to gather all resource client in a single class, from the base client actually doing the requests to the API. This allows us for example to swap or modify the base client in a resource client, that might need a different base client (session, endpoint, headers, ...).
90638b1 to
13f7c0b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #534 +/- ##
==========================================
+ Coverage 96.01% 96.14% +0.12%
==========================================
Files 64 64
Lines 2938 2928 -10
==========================================
- Hits 2821 2815 -6
+ Misses 117 113 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
|
Ready for a review, but still need to be tested with the Storage Box Actions implementations. |
apricote
approved these changes
Aug 14, 2025
jooola
added a commit
that referenced
this pull request
Aug 15, 2025
Squashed commit of the following: commit 4ff9fbc Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:54:47 2025 +0200 test: timeout handling commit 13f7c0b Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:33:26 2025 +0200 test: fix speed optimization commit 458631d Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:29:50 2025 +0200 test: use parent to access other resources clients commit f69a609 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:28:13 2025 +0200 test: update request_mock fixture commit d565239 Author: jo <ljonas@riseup.net> Date: Tue Aug 12 15:57:25 2025 +0200 refactor: use parent to access other resources clients (2) commit 1703985 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:25:51 2025 +0200 refactor: use parent to access other resources clients (1) commit adb9232 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:24:50 2025 +0200 refactor: use type from inherited resource client property commit 3b6c712 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:18:29 2025 +0200 refactor: split top level client from base client Split the top level client used to gather all resource client in a single class, from the base client actually doing the requests to the API. This allows us for example to swap or modify the base client in a resource client, that might need a different base client (session, endpoint, headers, ...).
jooola
added a commit
that referenced
this pull request
Aug 15, 2025
Squashed commit of the following: commit 4ff9fbc Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:54:47 2025 +0200 test: timeout handling commit 13f7c0b Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:33:26 2025 +0200 test: fix speed optimization commit 458631d Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:29:50 2025 +0200 test: use parent to access other resources clients commit f69a609 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:28:13 2025 +0200 test: update request_mock fixture commit d565239 Author: jo <ljonas@riseup.net> Date: Tue Aug 12 15:57:25 2025 +0200 refactor: use parent to access other resources clients (2) commit 1703985 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:25:51 2025 +0200 refactor: use parent to access other resources clients (1) commit adb9232 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:24:50 2025 +0200 refactor: use type from inherited resource client property commit 3b6c712 Author: jo <ljonas@riseup.net> Date: Thu Aug 14 16:18:29 2025 +0200 refactor: split top level client from base client Split the top level client used to gather all resource client in a single class, from the base client actually doing the requests to the API. This allows us for example to swap or modify the base client in a resource client, that might need a different base client (session, endpoint, headers, ...).
jooola
added a commit
that referenced
this pull request
Aug 15, 2025
Member
Author
|
I have tested this in https://github.com/hetznercloud/hcloud-python/pull/541/files#r2278661516 Seems to be working just fine. |
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.
Split the top level client used to gather all resource client in a single class, from the base client actually doing the requests to the API.
This allows us for example to swap or modify the base client in a resource client, that might need a different base client (session, endpoint, headers, ...).