Skip to content

fix: refactor OpenHexaClient to allow usage in both CLI and SDK without circular dependency (HEXA-1314)#279

Merged
yolanfery merged 5 commits into
mainfrom
HEXA-1314-fix-circular-dependency-between-sdk-and-cli
Jun 25, 2025
Merged

fix: refactor OpenHexaClient to allow usage in both CLI and SDK without circular dependency (HEXA-1314)#279
yolanfery merged 5 commits into
mainfrom
HEXA-1314-fix-circular-dependency-between-sdk-and-cli

Conversation

@yolanfery

Copy link
Copy Markdown
Contributor

In #278 and #277 we faced issue with circular dependency for OpenHexaClient.

This PR is about extracting and refactoring the OpenHexaClient to allow usage in both the CLI and the SDK

Changes

  • Update readme with instructions and example of usage
  • Extract the OpenHexaClient to make it a clear interface
  • Extract all auto generated classed to allow importing types without circular dep
  • Update codegen config to work with the new structure

@yolanfery yolanfery requested review from bramj and nazarfil June 25, 2025 08:26
@yolanfery yolanfery self-assigned this Jun 25, 2025

@property
def countries(self):
def countries(self) -> list[GetCountriesWorkspaceCountries]:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now we can use types without circular dependency 🎉

url: GraphQL API URL.
token: Authentication token.
"""
self.token = token

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great, thanks for changing this!


@property
def countries(self):
def countries(self) -> list[GetCountriesWorkspaceCountries]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

@bramj bramj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is a great step forward, nice work! 👏

So if I understand it correctly, since the openhexa-toolbox already depends on the SDK, we can simply use the BaseOpenHexaClient and benefit from all this without any duplication? That's great!

@yolanfery

Copy link
Copy Markdown
Contributor Author

I think this is a great step forward, nice work! 👏

Agreed, thanks !

So if I understand it correctly, since the openhexa-toolbox already depends on the SDK, we can simply use the BaseOpenHexaClient and benefit from all this without any duplication? That's great!

Correct, it just needs advertising once we have extended it to support more queries

@yolanfery yolanfery merged commit 8936df8 into main Jun 25, 2025
4 checks passed
@yolanfery yolanfery deleted the HEXA-1314-fix-circular-dependency-between-sdk-and-cli branch June 25, 2025 09:58
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.

3 participants