Skip to content

refactor: new /clients directory - #399

Merged
ppicom merged 4 commits into
mainfrom
feat/async-support
Jul 27, 2026
Merged

refactor: new /clients directory#399
ppicom merged 4 commits into
mainfrom
feat/async-support

Conversation

@ppicom

@ppicom ppicom commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Making way for what's to come (yak shaving a bit), this PR includes two tiny rearrangements:

  • refactor: move extract_environment_from_headers to utils.py

This one is highly based on my opinion. The environment function seems to fit quite well inside of utils.py and that would be one less file to maintain.

  • refactor: create a new /clients directory

This one prepares the directory structure for the implementation of #240, mostly to avoid conflict hells further down the line and to not mix more than one change in the same PR.

@ppicom ppicom changed the title feat/async support refactor: new /clients directory Jul 27, 2026
@ppicom
ppicom marked this pull request as draft July 27, 2026 09:13
@ppicom ppicom self-assigned this Jul 27, 2026
@ppicom ppicom linked an issue Jul 27, 2026 that may be closed by this pull request
@ppicom ppicom removed a link to an issue Jul 27, 2026
@ppicom
ppicom force-pushed the feat/async-support branch from 64bd7fa to 3a7f637 Compare July 27, 2026 09:21
Comment thread UnleashClient/clients/unleash_client.py Dismissed
@coveralls

coveralls commented Jul 27, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30268537840

Coverage increased (+0.04%) to 93.238%

Details

  • Coverage increased (+0.04%) from the base build.
  • Patch coverage: 14 uncovered changes across 2 files (266 of 280 lines covered, 95.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
UnleashClient/clients/unleash_client.py 263 250 95.06%
UnleashClient/utils.py 15 14 93.33%
Total (4 files) 280 266 95.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 769
Covered Lines: 717
Line Coverage: 93.24%
Coverage Strength: 0.93 hits per line

💛 - Coveralls

@ppicom
ppicom requested a review from sighphyre July 27, 2026 09:56
Comment thread tests/unit_tests/api/test_feature.py Outdated
Comment thread UnleashClient/connectors/polling_connector.py Outdated

@irstavr irstavr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are 3 files here that only relate to linting issues. We could split them up in a different PR to help with the review?!

ppicom commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Sure! Let me chedrry pick them

@ppicom

ppicom commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

There are 3 files here that only relate to linting issues. We could split them up in a different PR to help with the review?!

I plan on merging the linting errors in this PR #400 before I remove them from here. Sounds good?

ppicom added 3 commits July 27, 2026 13:55
As part of #240, this change makes way for a new /clients
directory. that is where the new base class for clients and the
async implementation of the client will live.
There are not (and should not be) mentions of these elements outside
of the module where they are declared.
@ppicom
ppicom force-pushed the feat/async-support branch from 0f100bb to 2b18e8a Compare July 27, 2026 11:56
@ppicom
ppicom marked this pull request as ready for review July 27, 2026 11:59

@sighphyre sighphyre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Failing check on the API token isn't new so I don't think that's a problem with this PR - don't think Github's suggestion is a good one though, this can probably either take a hash of the token or trumcate is to 6 characters after the project, so turn something like production-env:default-project:a7d651bae8aaefdb9179 -> production-env:default-project:a7d651, enough to not make it useful but still enough to make it recognizable. Can chat on Slack if you need

I very much don't agree with collapsing the environment_resolver into utils, because I think utils is where good code structure goes to die. That being said, this is a taste thing and not a blocker.

Structure is nice, change makes sense, looks good! Happy if you merge this

@github-project-automation github-project-automation Bot moved this from New to Approved PRs in Issues and PRs Jul 27, 2026
@ppicom
ppicom force-pushed the feat/async-support branch from 9eed8a8 to 58a3914 Compare July 27, 2026 13:03
@ppicom
ppicom merged commit ed5b0a9 into main Jul 27, 2026
32 of 42 checks passed
@ppicom
ppicom deleted the feat/async-support branch July 27, 2026 13:14
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Issues and PRs Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants