-
Notifications
You must be signed in to change notification settings - Fork 1
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
NickAkhmetov/CAT-775 - EPIC builders boilerplate, migrate API client #91
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you introduce a new local code formatter? Should we add it to the repo to avoid future formatter wars?
self, | ||
groups_token=None, | ||
elasticsearch_endpoint=None, | ||
portal_index_path=None, | ||
ubkg_endpoint=None, | ||
assets_endpoint=None, | ||
soft_assay_endpoint=None, | ||
soft_assay_endpoint_path=None, | ||
entity_api_endpoint=None, | ||
): | ||
self.groups_token = groups_token | ||
self.ubkg_endpoint = ubkg_endpoint | ||
self.assets_endpoint = assets_endpoint | ||
self.entity_api_endpoint = entity_api_endpoint | ||
|
||
self._elasticsearch_endpoint = elasticsearch_endpoint | ||
self._portal_index_path = portal_index_path | ||
|
||
self._soft_assay_endpoint = soft_assay_endpoint | ||
self._soft_assay_endpoint_path = soft_assay_endpoint_path | ||
|
||
self.elasticsearch_url = f"{elasticsearch_endpoint}{portal_index_path}" | ||
self.soft_assay_url = f"{soft_assay_endpoint}/{soft_assay_endpoint_path}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything here mostly the same as the client.py
in portal-ui
outside of passing the configuration values to the constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, no changes to functionality, just switched the environment variables to instance variables.
headers["Authorization"] = "REDACTED" | ||
return headers | ||
|
||
def _request(self, url, body_json=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the next action to create a new lib for the duplicated logic between the portal-ui
and here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a PR up to remove the API client from the portal-ui altogether, relying on the instance from here (i.e. it's how I tested that these changes all work/don't break existing visualizations). Once this PR is merged in and a new release is made, I can finalize that PR; at that point I'll also be able to replace the APIClient in the workspace templates with this one and open a corresponding PR there.
This PR:
portal-ui
repo to this repo. This will allow us to deduplicate the visualization generation code from the user-templates-api