Skip to content
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

Project access refactoring #481

Merged
merged 16 commits into from
Sep 12, 2024
Merged

Conversation

igor-davidyuk
Copy link
Contributor

@igor-davidyuk igor-davidyuk commented Aug 9, 2024

This PR adds guardrails to the user workflow that should streamline the experience of working with identically named projects.
The get_project now may be called with one of [project_name, project_id, project_object].
Fetching a project by name now has an unraveled logic scheme and is THE place where the user can determine the correct project_id.
All the other methods now accept a project object as an argument instead of a project_name which may be potentially problematic.

@igor-davidyuk igor-davidyuk force-pushed the idavidyu/get-project-refactoring branch from fda516c to cf1b025 Compare August 12, 2024 07:36
@igor-davidyuk igor-davidyuk force-pushed the idavidyu/get-project-refactoring branch 2 times, most recently from 2f8d677 to a901752 Compare August 23, 2024 10:18
@igor-davidyuk igor-davidyuk self-assigned this Aug 23, 2024
@igor-davidyuk igor-davidyuk marked this pull request as ready for review August 25, 2024 10:06
Copy link
Collaborator

@ljcornel ljcornel left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this, it really does clean up the API. Few minor comments from my side only.

geti_sdk/geti.py Outdated

:param project_name: Name of the project to retrieve
:param project_id: ID of the project to retrieve. If not specified, the
project with name `project_name` will be retrieved.
:param project: Project object to update. If not specified, the project with
Copy link
Collaborator

Choose a reason for hiding this comment

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

This sentence is not finished. I'm not sure about the behaviour, does the project override the project_id?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just looked at the ProjectClient.get_project method, the behaviour is clear now. Could you add a brief description of the parameter order here? Mainly because users may use the Geti object as the entrypoint to the API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the docstring, please see if the explanations are clearer now

geti_sdk/geti.py Outdated Show resolved Hide resolved
geti_sdk/rest_clients/project_client/project_client.py Outdated Show resolved Hide resolved
igor-davidyuk and others added 16 commits September 12, 2024 15:46
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Signed-off-by: Igor-Davidyuk <[email protected]>
Co-authored-by: Ludo Cornelissen <[email protected]>
@igor-davidyuk igor-davidyuk merged commit 7b70dad into main Sep 12, 2024
12 checks passed
@igor-davidyuk igor-davidyuk deleted the idavidyu/get-project-refactoring branch September 12, 2024 13:24
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.

2 participants