-
Notifications
You must be signed in to change notification settings - Fork 21
ITEP-32484 - Implement GET project_configuration endpoint #220
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
Conversation
# The project configuration is a Pydantic model, so we can simply convert it to a dict | ||
return project_config.model_dump() |
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'm afraid you can't obtain the right response structure by only calling model_dump
. According to the design, each parameter should have a "key", "name", "description", "type", "value", "min_value", "max_value", "default_value", etc... You can extract this information from the configuration Field
s but you have to write some custom logic.
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.
You're right, added configuration rest view class
Edit: added configurable_parameters_to_rest
which construct the REST view from any pydantic model.
interactive_ai/services/director/app/communication/endpoints/project_configuration_endpoints.py
Outdated
Show resolved
Hide resolved
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.
LGTM, I think it should be easy enough to extend the project creation BDD with a GET project configuration step to add an e2e test for this new endpoint.
""" | ||
project_config = ProjectConfigurationRepo(project_identifier).get_project_configuration() | ||
if isinstance(project_config, NullProjectConfiguration): | ||
raise ProjectNotFoundException(project_identifier.project_id) |
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.
Perhaps it is cleaner to create a new ProjectConfigurationNotFoundException
or to use a custom message indicating that the configuration could not be found.
π Description
Add
GET project_configuration
endpoint⨠Type of Change
Select the type of change your PR introduces:
π§ͺ Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
β Checklist
Before submitting the PR, ensure the following: