-
Notifications
You must be signed in to change notification settings - Fork 476
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
Completing the hydration story with the remaining models #2151
Completing the hydration story with the remaining models #2151
Conversation
E2E template updates in |
…ompleting-hydration-story
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the WalkthroughThe changes across various Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ? TipsChat with CodeRabbit Bot (
|
…ompleting-hydration-story
@coderabbitai review |
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.
Review Status
Actionable comments generated: 5
Configuration used: .coderabbit.yaml
Files selected for processing (39)
- src/zenml/cli/secret.py (3 hunks)
- src/zenml/cli/tag.py (4 hunks)
- src/zenml/cli/utils.py (4 hunks)
- src/zenml/client.py (24 hunks)
- src/zenml/models/init.py (9 hunks)
- src/zenml/models/v2/base/page.py (1 hunks)
- src/zenml/models/v2/core/artifact.py (3 hunks)
- src/zenml/models/v2/core/artifact_version.py (4 hunks)
- src/zenml/models/v2/core/model.py (3 hunks)
- src/zenml/models/v2/core/model_version.py (5 hunks)
- src/zenml/models/v2/core/secret.py (7 hunks)
- src/zenml/models/v2/core/tag.py (1 hunks)
- src/zenml/models/v2/core/tag_resource.py (1 hunks)
- src/zenml/stack/authentication_mixin.py (2 hunks)
- src/zenml/utils/pagination_utils.py (1 hunks)
- src/zenml/zen_server/rbac/endpoint_utils.py (7 hunks)
- src/zenml/zen_server/rbac/utils.py (18 hunks)
- src/zenml/zen_server/routers/secrets_endpoints.py (5 hunks)
- src/zenml/zen_server/routers/tags_endpoints.py (4 hunks)
- src/zenml/zen_server/routers/workspaces_endpoints.py (2 hunks)
- src/zenml/zen_stores/rest_zen_store.py (17 hunks)
- src/zenml/zen_stores/schemas/secret_schemas.py (4 hunks)
- src/zenml/zen_stores/schemas/tag_schemas.py (5 hunks)
- src/zenml/zen_stores/secrets_stores/aws_secrets_store.py (15 hunks)
- src/zenml/zen_stores/secrets_stores/azure_secrets_store.py (14 hunks)
- src/zenml/zen_stores/secrets_stores/base_secrets_store.py (12 hunks)
- src/zenml/zen_stores/secrets_stores/gcp_secrets_store.py (14 hunks)
- src/zenml/zen_stores/secrets_stores/hashicorp_secrets_store.py (14 hunks)
- src/zenml/zen_stores/secrets_stores/rest_secrets_store.py (6 hunks)
- src/zenml/zen_stores/secrets_stores/secrets_store_interface.py (6 hunks)
- src/zenml/zen_stores/secrets_stores/sql_secrets_store.py (8 hunks)
- src/zenml/zen_stores/sql_zen_store.py (15 hunks)
- src/zenml/zen_stores/zen_store_interface.py (5 hunks)
- tests/integration/functional/cli/test_tag.py (3 hunks)
- tests/integration/functional/cli/utils.py (2 hunks)
- tests/integration/functional/model/test_model_version.py (2 hunks)
- tests/integration/functional/zen_stores/test_secrets_store.py (74 hunks)
- tests/integration/functional/zen_stores/test_zen_store.py (11 hunks)
- tests/integration/functional/zen_stores/utils.py (10 hunks)
Files skipped from review due to trivial changes (1)
- src/zenml/stack/authentication_mixin.py
Additional comments: 179
src/zenml/cli/secret.py (3)
45-45: The import changes from
SecretFilterModel
andSecretResponseModel
toSecretFilter
andSecretResponse
are consistent with the PR's objective to refactor and rename models. Ensure that all references to these models in the codebase are updated accordingly.168-168: The decorator
@list_options(SecretFilter)
correctly uses the updatedSecretFilter
class. This change should be verified across the codebase to ensure that all instances whereSecretFilterModel
was used are now usingSecretFilter
.228-228: The return type of the
_get_secret
function has been updated fromSecretResponseModel
toSecretResponse
. This change aligns with the renaming of the models and should be reflected wherever_get_secret
is used.src/zenml/cli/tag.py (4)
26-29: The import changes from
TagFilterModel
,TagRequestModel
, andTagUpdateModel
toTagFilter
,TagRequest
, andTagUpdate
are consistent with the PR's objective to refactor and rename models. Ensure that all references to these models in the codebase are updated accordingly.41-41: The decorator
@list_options(TagFilter)
correctly uses the updatedTagFilter
class. This change should be verified across the codebase to ensure that all instances whereTagFilterModel
was used are now usingTagFilter
.85-85: The
register_tag
function now usesTagRequest
instead ofTagRequestModel
for creating a tag. This change aligns with the renaming of the models and should be reflected whereverregister_tag
is used.128-128: The
update_tag
function now usesTagUpdate
instead ofTagUpdateModel
for updating a tag. This change aligns with the renaming of the models and should be reflected whereverupdate_tag
is used.src/zenml/cli/utils.py (3)
106-106: The
TypeVar
T
is now constrained toBaseResponse
instead ofUnion[BaseResponse, BaseResponseModel]
. This simplification should be verified to ensure that it does not affect any existing functionality that relied on the union type.322-322: The comment indicates that the response model may contain nested
BaseResponse
objects, and the code attempts to represent them by name or id. This logic seems correct, but it should be verified that all nestedBaseResponse
objects are indeed represented as intended throughout the codebase.453-453: Similar to the previous comment, this logic is used to handle
BaseResponse
objects within a single Pydantic model. Ensure that this change is consistent and does not introduce any regressions where theBaseResponse
objects are expected to be handled differently.src/zenml/client.py (11)
- 174-174: The
TypeVar
AnyResponse
is now bound toBaseResponse
. Ensure that all usages ofAnyResponse
throughout the codebase are consistent with this new constraint.Verification successful
The usages of
AnyResponse
throughout the codebase are consistent with the new constraint where it is bound toBaseResponse
. The verification of the changes toAnyResponse
is successful.* 3041-3041: The `create_secret` function now returns `SecretResponse`. Confirm that the implementation of the function and its callers are updated to handle the new return type.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for usages of AnyResponse to ensure they are consistent with the new constraint. ast-grep --lang python --pattern $'AnyResponse'Length of output: 5525
3077-3078: The
hydrate
parameter has been added to theget_secret
function. Ensure that all calls to this function pass thehydrate
parameter as needed.3216-3217: The
hydrate
parameter is now present in thelist_secrets
function. Verify that the function's implementation and all its callers correctly use this parameter.3307-3307: The
SecretUpdate
object is created with a name only. Verify that all required fields are being initialized as per theSecretUpdate
constructor's definition.3362-3363: The
hydrate
parameter is added to theget_secret_by_name_and_scope
function. Confirm that the function's implementation and its callers are updated to handle this parameter.3418-3419: The
hydrate
parameter is now present in thelist_secrets_in_scope
function. Verify that the function's implementation and all its callers correctly use this parameter.5671-5671: The
create_tag
function now usesTagRequest
and returnsTagResponse
. Confirm that the implementation of the function and its callers are updated to handle the new types.Verification successful
The ast-grep search for calls to
create_tag
did not yield any results. This could mean there are no calls to this function in the codebase, or the search pattern was too specific. To ensure we have a complete understanding, I will perform a broader search to capture any usage ofcreate_tag
.
The search results indicate that the
create_tag
function is indeed being called in various places within the codebase, including CLI commands, client methods, Zen store interfaces, and tests. The calls tocreate_tag
are using theTagRequest
type as expected, and the function definitions are updated to returnTagResponse
. This aligns with the changes mentioned in the PR and the AI-generated summaries.Based on the provided output, it appears that the implementation of the
create_tag
function and its callers have been updated to handle the newTagRequest
andTagResponse
types correctly.* 5693-5694: The `update_tag` function now accepts `TagUpdate` as a parameter. Confirm that the implementation of the function and its callers are updated to handle the new type.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for calls to create_tag to ensure they handle the new types correctly. ast-grep --lang python --pattern $'create_tag($_)'Length of output: 51
Script:
#!/bin/bash # Search for any usage of create_tag to ensure they handle the new types correctly. rg 'create_tag\('Length of output: 3108
Verification successful
The initial script did not yield any results for calls to the
update_tag
function. To ensure a thorough check, I will generate a new script usingrg
(ripgrep) to search for the usage ofupdate_tag
across the codebase.
The
update_tag
function is being called with theTagUpdate
type correctly in thetest_zen_store.py
integration tests. The other occurrences in the codebase are definitions, not calls, so they do not require verification of parameter usage.* 5709-5710: The `get_tag` function now includes a `hydrate` parameter. Confirm that the function's implementation and its callers are updated to handle this parameter.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for calls to update_tag to ensure they handle the new type correctly. ast-grep --lang python --pattern $'update_tag($_)'Length of output: 51
Script:
#!/bin/bash # Use ripgrep to search for 'update_tag' to ensure it's being called with the correct type. rg "update_tag\("Length of output: 813
- 5727-5729: The
list_tags
function now includes ahydrate
parameter. Confirm that the function's implementation and all its callers are updated to handle this parameter.Verification successful
Given that the initial search did not yield results, I will broaden the search pattern to capture any calls to
list_tags
to ensure we are not missing any instances due to the search pattern used.
The search results show the definitions of
list_tags
but do not provide information on where the function is called. I will adjust the search to find calls tolist_tags
to verify the usage of thehydrate
parameter.
The search results show that the
list_tags
function is called insrc/zenml/cli/tag.py
and in several test files. Thehydrate
parameter is not explicitly used in these calls, which suggests that the default value is being relied upon. This is acceptable if the default behavior (hydrate=False
) is intended in these contexts. There is no indication that the calls have been incorrectly updated or that thehydrate
parameter is being misused.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for calls to list_tags to verify the correct usage of the hydrate parameter. ast-grep --lang python --pattern $'list_tags($_)'Length of output: 50
Script:
#!/bin/bash # Broaden the search for calls to list_tags to ensure we capture any usage, regardless of the arguments. rg --multiline 'def list_tags\('Length of output: 372
Script:
#!/bin/bash # Search for calls to the list_tags function to verify the usage of the hydrate parameter. rg 'list_tags\('Length of output: 1164
src/zenml/models/__init__.py (2)
- 13-18: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [18-30]
The import statements have been updated to reflect the new model names, which aligns with the changes mentioned in the AI-generated summary. Ensure that all references to these models throughout the codebase are updated to use the new names.
- 601-612: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [464-612]
The
__all__
list has been updated to include new entities and exclude removed ones. This is consistent with the changes in the import statements and the removal of old models.src/zenml/models/v2/base/page.py (1)
- 16-25: The import of
BaseResponseModel
has been removed, and the type hint forB
has been updated toBaseResponse
. This change should be verified across the codebase to ensure compatibility with the new type constraints.src/zenml/models/v2/core/artifact.py (3)
28-29: The import of
TagResponseModel
has been replaced withTagResponse
, and the type annotations have been updated accordingly. This change should be verified across the codebase to ensure compatibility with the new model structure.66-68: The
tags
property type has been updated fromList[TagResponseModel]
toList[TagResponse]
. Ensure that all usages of this property are updated to reflect the new type.102-102: The return type of the
tags
method has been updated toList[TagResponse]
. Verify that this change is reflected wherever the method is used.src/zenml/models/v2/core/artifact_version.py (3)
42-42: The import of
TagResponseModel
has been replaced withTagResponse
. This change should be verified across the codebase to ensure compatibility with the new model structure.137-137: The
tags
field type has been updated fromList[TagResponseModel]
toList[TagResponse]
. Ensure that all usages of this field are updated to reflect the new type.218-218: The return type of the
tags
method has been updated toList[TagResponse]
. Verify that this change is reflected wherever the method is used.src/zenml/models/v2/core/model.py (3)
35-35: The import of
TagResponseModel
has been replaced withTagResponse
. This change should be verified across the codebase to ensure compatibility with the new model structure.111-111: The
tags
field type inModelResponseBody
has been updated fromList[TagResponseModel]
toList[TagResponse]
. Ensure that all usages of this field are updated to reflect the new type.185-185: The return type of the
tags
method inModelResponse
has been updated toList[TagResponse]
. Verify that this change is reflected wherever the method is used.src/zenml/models/v2/core/model_version.py (3)
32-32: The import of
TagResponseModel
has been replaced withTagResponse
. This change should be verified across the codebase to ensure compatibility with the new model structure.153-153: The
tags
field type inModelVersionResponseBody
has been updated fromList[TagResponseModel]
toList[TagResponse]
. Ensure that all usages of this field are updated to reflect the new type.273-273: The return type of the
tags
method inModelVersionResponse
has been updated toList[TagResponse]
. Verify that this change is reflected wherever the method is used.src/zenml/models/v2/core/secret.py (5)
41-55: The
SecretRequest
class has been added with new properties and methods. Verify that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.80-81: The
SecretUpdate
class has been added, inheriting fromSecretRequest
. Ensure that the update functionality is correctly implemented and that it is used appropriately throughout the codebase.91-96: The
SecretResponseBody
andSecretResponseMetadata
classes have been added. Verify that these classes are correctly integrated into the codebase and that their usage is consistent with the intended functionality.106-107: The
SecretResponse
class has been added. Ensure that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.204-206: The
SecretFilter
class has been added. Verify that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.src/zenml/models/v2/core/tag.py (5)
34-44: The
TagRequest
class has been added with new properties and methods. Verify that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.50-54: The
TagUpdate
class has been added. Ensure that the update functionality is correctly implemented and that it is used appropriately throughout the codebase.60-69: The
TagResponseBody
class has been added. Verify that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.72-77: The
TagResponse
class has been added. Ensure that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.112-116: The
TagFilter
class has been added. Verify that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.src/zenml/models/v2/core/tag_resource.py (3)
29-34: The
TagResourceRequest
class has been added with new properties. Verify that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.44-49: The
TagResourceResponseBody
class has been added. Verify that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.52-53: The
TagResourceResponse
class has been added. Ensure that this class is correctly integrated into the codebase and that its usage is consistent with the intended functionality.src/zenml/utils/pagination_utils.py (1)
- 16-25: The type annotations in the
depaginate
function have been updated to use more generic type variables. This change should be verified across the codebase to ensure compatibility with the new model structure.src/zenml/zen_server/rbac/endpoint_utils.py (1)
- 25-36: The function signatures in the
endpoint_utils
module have been updated to use more generic type variables. This change should be verified across the codebase to ensure compatibility with the new model structure.src/zenml/zen_server/rbac/utils.py (14)
- 32-46: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [16-39]
The removal of imports such as
datetime
andEnum
and the change fromAnyResponseModel
toAnyResponse
suggest a significant refactoring. Ensure that the removal of these imports does not affect other parts of the codebase that may rely on them. The renaming ofAnyResponseModel
toAnyResponse
should be reflected across all usages in the codebase.
43-46: The
dehydrate_page
function uses thePage
andAnyResponse
types, which have been updated as part of the refactoring. Verify that these changes are consistent and that all references to the oldPage[BaseResponseModel]
andAnyResponseModel
types have been updated accordingly.126-129: The
_dehydrate_value
function has been updated to handle instances ofBaseResponse
instead of the previous model types. Ensure that this change is consistent with the new type hierarchy and that all instances where_dehydrate_value
is called have been updated to pass the correct type.157-160: The
has_permissions_for_model
function now uses theAnyResponse
type. Confirm that all calls to this function have been updated to pass the correct type and that the function's logic correctly handles the new type.177-180: The
get_permission_denied_model
function now uses theAnyResponse
type. Verify that all calls to this function have been updated to pass the correct type and that the function's logic correctly handles the new type.192-195: The
batch_verify_permissions_for_models
function now uses theAnyResponse
type. Ensure that all calls to this function have been updated to pass the correct type and that the function's logic correctly handles the new type.220-223: The
verify_permission_for_model
function now uses theAnyResponse
type. Confirm that all calls to this function have been updated to pass the correct type and that the function's logic correctly handles the new type.230-233: The
batch_verify_permissions
function uses theResource
type. Verify that theResource
type and its usage within the function remain valid after the refactoring and that all calls to this function have been updated if necessary.319-322: The
get_resource_for_model
function now uses theAnyResponse
type. Ensure that all calls to this function have been updated to pass the correct type and that the function's logic correctly handles the new type.338-342: The
get_surrogate_permission_model_for_model
function now uses theAnyResponse
type. Confirm that all calls to this function have been updated to pass the correct type and that the function's logic correctly handles the new type.367-370: The
get_resource_type_for_model
function has been updated to handle the new response models. Verify that the mapping dictionary correctly reflects the new model names and that all calls to this function have been updated accordingly.428-431: The
is_owned_by_authenticated_user
function now uses theAnyResponse
type. Ensure that all calls to this function have been updated to pass the correct type and that the function's logic correctly handles the new type.454-457: The
get_subresources_for_model
function has been updated to work with the newAnyModel
type. Confirm that all calls to this function have been updated to pass the correct type and that the function's logic correctly handles the new type.481-484: The
_get_subresources_for_value
function has been updated to handle instances ofBaseResponse
. Verify that this change is consistent with the new type hierarchy and that all instances where_get_subresources_for_value
is called have been updated to pass the correct type.src/zenml/zen_stores/rest_zen_store.py (14)
- 110-116: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [27-32]
The renaming of models from
*Model
to their simplified names (e.g.,SecretFilterModel
toSecretFilter
) is consistent with the PR's objective to refactor and simplify the codebase. Ensure that all references to these models throughout the codebase are updated to reflect these changes.
- 3023-3029: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [3015-3028]
The method
create_tag
has been updated to returnTagResponse
instead of the previousTagResponseModel
. This change aligns with the renaming of models and should be reflected across all method calls.
3042-3058: The method
get_tag
now includes ahydrate
parameter, which suggests additional metadata may be included in the response. This change should be verified to ensure that thehydrate
functionality is implemented correctly and that all calls toget_tag
are reviewed for the potential impact of this new parameter.3063-3080: The method
list_tags
has been updated with a new parameterhydrate
. This change should be verified to ensure that thehydrate
functionality is implemented correctly and that all calls tolist_tags
are reviewed for the potential impact of this new parameter.3039-3090: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [3086-3102]
The method
update_tag
has been updated to acceptTagUpdate
instead of the previousTagUpdateModel
. This change aligns with the renaming of models and should be reflected across all method calls.
3408-3412: The method
_create_resource
has been updated to use the new type variablesAnyRequest
andAnyResponse
. This change should be verified to ensure that the new type variables are correctly defined and used throughout the codebase.3430-3434: The method
_create_workspace_scoped_resource
has been updated to use the new type variablesAnyWorkspaceScopedRequest
andAnyResponse
. This change should be verified to ensure that the new type variables are correctly defined and used throughout the codebase.3456-3460: The method
_get_or_create_resource
has been updated to use the new type variablesAnyRequest
andAnyResponse
. This change should be verified to ensure that the new type variables are correctly defined and used throughout the codebase.3506-3510: The method
_get_or_create_workspace_scoped_resource
has been updated to use the new type variablesAnyWorkspaceScopedRequest
andAnyResponse
. This change should be verified to ensure that the new type variables are correctly defined and used throughout the codebase.3535-3537: The method
_get_resource
has been updated to use the new type variableAnyResponse
. This change should be verified to ensure that the new type variable is correctly defined and used throughout the codebase.3555-3558: The method
_list_paginated_resources
has been updated to use the new type variableAnyResponse
. This change should be verified to ensure that the new type variable is correctly defined and used throughout the codebase.3593-3595: The method
_list_resources
has been updated to use the new type variableAnyResponse
. This change should be verified to ensure that the new type variable is correctly defined and used throughout the codebase.3622-3625: The method
_update_resource
has been updated to use the new type variableAnyResponse
. This change should be verified to ensure that the new type variable is correctly defined and used throughout the codebase.3643-3643: The method
_delete_resource
remains unchanged, but it's important to verify that the deletion logic is still correct given the renaming of models and potential changes in relationships between entities.src/zenml/zen_stores/schemas/secret_schemas.py (4)
27-32: The renaming of models from
*Model
to their simplified names (e.g.,SecretRequestModel
toSecretRequest
) is consistent with the PR's objective to refactor and simplify the codebase. Ensure that all references to these models throughout the codebase are updated to reflect these changes.138-141: The method
from_request
has been updated to acceptSecretRequest
instead of the previousSecretRequestModel
. This change aligns with the renaming of models and should be reflected across all method calls.164-167: The method
update
has been updated to acceptSecretUpdate
instead of the previousSecretUpdateModel
. This change aligns with the renaming of models and should be reflected across all method calls.206-240: The method
to_model
has been updated to include ahydrate
parameter, which suggests additional metadata may be included in the response. This change should be verified to ensure that thehydrate
functionality is implemented correctly and that all calls toto_model
are reviewed for the potential impact of this new parameter.src/zenml/zen_stores/schemas/tag_schemas.py (6)
- 26-32: The import statements have been updated to reflect the new model names. Ensure that all references to these models throughout the codebase have been updated accordingly.
Verification successful
The executed shell scripts have successfully identified the usage of the new model names (
TagRequest
,TagResourceRequest
,TagResourceResponse
,TagResponse
,TagUpdate
) throughout the codebase. The absence of results for the old model names suggests that they have been properly replaced with the new ones.Based on the output, it can be concluded that the import statements and references to these models have been updated accordingly across various files in the codebase, including
client.py
,zen_store_interface.py
,tag_schemas.py
,rest_zen_store.py
,sql_zen_store.py
, and others.Given this information, the changes mentioned in the review comment have been verified, and no issues have been found with the renaming and usage of the new model names.
* 60-61: The method `from_request` has been updated to use the new `TagRequest` model. Ensure that the method is correctly converting a `TagRequest` to a `TagSchema`.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search to find files that import the old model names. Expecting no results. rg --type python 'TagRequestModel|TagResourceRequestModel|TagResourceResponseModel|TagResponseModel|TagUpdateModel' # Search new model names to validate usage. Expecting list of locations where the new model names are used. rg --type python 'TagRequest|TagResourceRequest|TagResourceResponse|TagResponse|TagUpdate'Length of output: 272
Script:
#!/bin/bash # Search to find files that import the old model names. Expecting no results. rg --type py 'TagRequestModel|TagResourceRequestModel|TagResourceResponseModel|TagResponseModel|TagUpdateModel' # Search new model names to validate usage. Expecting list of locations where the new model names are used. rg --type py 'TagRequest|TagResourceRequest|TagResourceResponse|TagResponse|TagUpdate'Length of output: 12866
74-92: The method
to_model
has been updated to return aTagResponse
object. Verify that thehydrate
flag is being used correctly to include metadata fields in the response when needed.95-102: The method
update
has been updated to accept aTagUpdate
object. Ensure that the update logic correctly applies the changes from theTagUpdate
to theTagSchema
.156-157: The method
from_request
in theTagResourceSchema
class has been updated to use the newTagResourceRequest
model. Ensure that the method is correctly converting aTagResourceRequest
to aTagResourceSchema
.171-189: The method
to_model
in theTagResourceSchema
class has been updated to return aTagResourceResponse
object. Verify that thehydrate
flag is being used correctly to include metadata fields in the response when needed.src/zenml/zen_stores/secrets_stores/aws_secrets_store.py (4)
- 497-528: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [432-513]
The
create_secret
method has been updated to include ahydrate
flag, affecting the control flow by allowing the inclusion of metadata fields in the response. Ensure that thehydrate
flag is being used correctly and that the method's logic correctly handles the creation of secrets with the new model structure.
517-528: The
get_secret
method now includes ahydrate
flag, impacting the logic by deciding whether to hydrate the output models by including metadata fields in the response. Verify that thehydrate
flag is being used correctly and that the method's logic correctly handles the retrieval of secrets with the new model structure.567-578: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [574-585]
The
list_secrets
method now includes ahydrate
flag, impacting the logic by deciding whether to hydrate the output models by including metadata fields in the response. Verify that thehydrate
flag is being used correctly and that the method's logic correctly handles the listing of secrets with the new model structure.
- 804-822: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [719-820]
The
update_secret
method has been updated to accept aSecretUpdate
object and return aSecretResponse
. Ensure that the update logic correctly applies the changes from theSecretUpdate
to the existing secret and that the method's logic correctly handles the update with the new model structure.src/zenml/zen_stores/secrets_stores/azure_secrets_store.py (4)
- 378-409: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [314-396]
The
create_secret
method has been updated to include ahydrate
flag, affecting the control flow by allowing the inclusion of metadata fields in the response. Ensure that thehydrate
flag is being used correctly and that the method's logic correctly handles the creation of secrets with the new model structure.
398-409: The
get_secret
method now includes ahydrate
flag, impacting the logic by deciding whether to hydrate the output models by including metadata fields in the response. Verify that thehydrate
flag is being used correctly and that the method's logic correctly handles the retrieval of secrets with the new model structure.434-445: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [441-452]
The
list_secrets
method now includes ahydrate
flag, impacting the logic by deciding whether to hydrate the output models by including metadata fields in the response. Verify that thehydrate
flag is being used correctly and that the method's logic correctly handles the listing of secrets with the new model structure.
- 617-635: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [534-635]
The
update_secret
method has been updated to accept aSecretUpdate
object and return aSecretResponse
. Ensure that the update logic correctly applies the changes from theSecretUpdate
to the existing secret and that the method's logic correctly handles the update with the new model structure.src/zenml/zen_stores/secrets_stores/base_secrets_store.py (1)
- 568-588: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [511-588]
The
_create_secret_from_metadata
method has been updated to include a newhydrate
parameter. Ensure that the method's logic correctly handles the inclusion of metadata fields in the response when thehydrate
flag is set toTrue
.src/zenml/zen_stores/secrets_stores/gcp_secrets_store.py (4)
- 410-439: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [335-426]
The
create_secret
method has been updated to include ahydrate
flag, affecting the control flow by allowing the inclusion of metadata fields in the response. Ensure that thehydrate
flag is being used correctly and that the method's logic correctly handles the creation of secrets with the new model structure.
428-439: The
get_secret
method now includes ahydrate
flag, impacting the logic by deciding whether to hydrate the output models by including metadata fields in the response. Verify that thehydrate
flag is being used correctly and that the method's logic correctly handles the retrieval of secrets with the new model structure.476-486: The
list_secrets
method now includes ahydrate
flag, impacting the logic by deciding whether to hydrate the output models by including metadata fields in the response. Verify that thehydrate
flag is being used correctly and that the method's logic correctly handles the listing of secrets with the new model structure.662-680: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [566-678]
The
update_secret
method has been updated to accept aSecretUpdate
object and return aSecretResponse
. Ensure that the update logic correctly applies the changes from theSecretUpdate
to the existing secret and that the method's logic correctly handles the update with the new model structure.src/zenml/zen_stores/secrets_stores/hashicorp_secrets_store.py (6)
45-54: The renaming of the models in the import statements aligns with the PR objectives and ensures consistency across the codebase.
239-249: The addition of the
hydrate
parameter to the_convert_vault_secret
method is consistent with the PR's objective to allow optional hydration of the response models. Ensure that the rest of the codebase correctly handles this new parameter.343-374: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [280-361]
The
create_secret
method has been updated to return aSecretResponse
object, which is consistent with the PR objectives. The construction of theSecretResponse
object appears to be correct and includes the newSecretResponseBody
andSecretResponseMetadata
entities.
- 343-374: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [363-405]
The
get_secret
method correctly accepts ahydrate
parameter and returns aSecretResponse
object. Ensure that thehydrate
parameter is used consistently across the codebase when calling this method.
- 415-422: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [407-516]
The
list_secrets
method has been updated to accept aSecretFilter
and ahydrate
parameter, and it returns aPage[SecretResponse]
. This change is consistent with the PR objectives and the method's logic appears to handle the new parameters correctly.
- 611-629: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [529-629]
The
update_secret
method has been updated to accept aSecretUpdate
and return aSecretResponse
object. The method's logic for updating the secret and constructing theSecretResponse
object appears to be correct and aligns with the PR objectives.src/zenml/zen_stores/secrets_stores/rest_secrets_store.py (5)
32-41: The renaming of the models in the import statements aligns with the PR objectives and ensures consistency across the codebase.
147-153: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [150-170]
The
create_secret
method has been updated to return aSecretResponse
object, which is consistent with the PR objectives. The method's logic for constructing theSecretResponse
object appears to be correct.
173-190: The
get_secret
method correctly accepts ahydrate
parameter and returns aSecretResponse
object. Ensure that thehydrate
parameter is used consistently across the codebase when calling this method.201-208: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [193-218]
The
list_secrets
method has been updated to accept aSecretFilter
and ahydrate
parameter, and it returns aPage[SecretResponse]
. This change is consistent with the PR objectives and the method's logic appears to handle the new parameters correctly.
- 213-226: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [222-250]
The
update_secret
method has been updated to accept aSecretUpdate
and return aSecretResponse
object. The method's logic for updating the secret and constructing theSecretResponse
object appears to be correct and aligns with the PR objectives.src/zenml/zen_stores/secrets_stores/secrets_store_interface.py (5)
18-24: The renaming of the models in the import statements aligns with the PR objectives and ensures consistency across the codebase.
50-53: The
create_secret
method in the interface has been updated to accept aSecretRequest
and return aSecretResponse
, which is consistent with the PR objectives and the changes in the implementing classes.78-80: The
get_secret
method in the interface correctly accepts ahydrate
parameter and returns aSecretResponse
, which is consistent with the PR objectives and the changes in the implementing classes.96-98: The
list_secrets
method in the interface has been updated to accept aSecretFilter
and ahydrate
parameter, and it returns aPage[SecretResponse]
. This change is consistent with the PR objectives and the changes in the implementing classes.122-123: The
update_secret
method in the interface has been updated to accept aSecretUpdate
and return aSecretResponse
, which is consistent with the PR objectives and the changes in the implementing classes.src/zenml/zen_stores/secrets_stores/sql_secrets_store.py (5)
42-51: The renaming of the models in the import statements aligns with the PR objectives and ensures consistency across the codebase.
254-260: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [257-298]
The
create_secret
method has been updated to return aSecretResponse
object, which is consistent with the PR objectives. The method's logic for constructing theSecretResponse
object appears to be correct.
- 295-312: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [301-324]
The
get_secret
method correctly accepts ahydrate
parameter and returns aSecretResponse
object. Ensure that thehydrate
parameter is used consistently across the codebase when calling this method.
- 335-342: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [328-356]
The
list_secrets
method has been updated to accept aSecretFilter
and ahydrate
parameter, and it returns aPage[SecretResponse]
. This change is consistent with the PR objectives and the method's logic appears to handle the new parameters correctly.
- 395-400: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [361-429]
The
update_secret
method has been updated to accept aSecretUpdate
and return aSecretResponse
object. The method's logic for updating the secret and constructing theSecretResponse
object appears to be correct and aligns with the PR objectives.src/zenml/zen_stores/sql_zen_store.py (15)
109-114: The changes in entity declarations from models to more simplified names are consistent with the PR's objective of refactoring and renaming for clarity.
169-170: Renaming
SecretFilterModel
toSecretFilter
andSecretRequestModel
toSecretRequest
aligns with the overall refactoring pattern and should improve code readability.191-196: The renaming of tag-related models to remove the 'Model' suffix is consistent with the rest of the changes and should not introduce issues if all references in the codebase are updated accordingly.
272-272: The update to the type constraint for
B
to be bound toBaseResponse
simplifies the type hierarchy and is a positive change, assuming all usages ofB
have been updated to reflect this change.4192-4199: The use of
SecretFilter
andSecretRequest
in thecreate_connector_secret
function is consistent with the new naming convention. Ensure that theSecretsStore
interface and its implementations are updated to handle these new types.6888-6891: The use of
TagRequest
andTagResourceRequest
in thecreate_tag
andcreate_tag_resource
functions is consistent with the new naming convention. Ensure that theTagStore
interface and its implementations are updated to handle these new types.6925-6925: The signature of
create_tag
has been updated to accept aTagRequest
object. This change is consistent with the renaming strategy and should be checked across the codebase for proper usage.6951-6951: The
to_model
method is used with ahydrate
flag, which is part of the new feature set. Ensure that thehydrate
flag is properly implemented in theto_model
method to include metadata fields as expected.6978-6985: The
get_tag
function now includes ahydrate
flag, which should be consistent with the new feature set. Verify that thehydrate
flag is being used correctly throughout the codebase.7002-7014: The
list_tags
function has been updated to include ahydrate
flag and use the newTagFilter
type. Ensure that thehydrate
flag is being used correctly and that theTagFilter
type is properly implemented.7032-7033: The
update_tag
function signature has been updated to use the newTagUpdate
type. This change is consistent with the renaming strategy and should be checked across the codebase for proper usage.7060-7060: The
to_model
method is used with ahydrate
flag, which is part of the new feature set. Ensure that thehydrate
flag is properly implemented in theto_model
method to include metadata fields as expected.7067-7068: The
create_tag_resource
function signature has been updated to accept aTagResourceRequest
object. This change is consistent with the renaming strategy and should be checked across the codebase for proper usage.7092-7103: The error message and the
to_model
method call are consistent with the new naming conventions and features. Ensure that the error message is clear and that theto_model
method properly handles thehydrate
flag.7131-7132: The error message for the
KeyError
exception is clear and informative, providing the necessary IDs when a tag-resource relationship is not found.src/zenml/zen_stores/zen_store_interface.py (5)
106-109: The renaming of
TagFilterModel
,TagRequestModel
,TagResponseModel
, andTagUpdateModel
toTagFilter
,TagRequest
,TagResponse
, andTagUpdate
is consistent with the PR's objective to refactor model names. Ensure that all references to these models throughout the codebase have been updated accordingly.2245-2245: The addition of the
hydrate
parameter to thecreate_tag
method signature is a significant change. Ensure that all calls to this method have been updated to handle the new parameter correctly, and that the parameter is being used as intended within the method.2274-2281: The
hydrate
parameter has been added to theget_tag
method signature. Confirm that the method's implementation properly handles this parameter and that it is being used to control the hydration of the output models.2293-2301: The
hydrate
parameter has been added to thelist_tags
method signature. Verify that the method's implementation correctly uses this parameter to determine whether to include metadata fields in the response.2311-2312: The
update_tag
method signature has been updated to use the newTagUpdate
model. Ensure that the method's implementation has been adjusted to work with the new model and that all calls to this method are using the updated signature.tests/integration/functional/cli/test_tag.py (3)
27-27: The import statement has been correctly updated to use the new
TagResponse
model. Ensure that all test functions that previously usedTagResponseModel
have been updated to useTagResponse
.96-96: The type annotation for the
tag
variable has been updated toTagResponse
. Confirm that the test logic is still correct with the updated type and that theTagResponse
model provides all necessary fields for the tests.153-153: The type annotation for the
tag
variable in thetest_tag_delete_found
function has been updated toTagResponse
. Verify that the test still functions as intended with the new type annotation.tests/integration/functional/cli/utils.py (3)
25-26: The import statements have been correctly updated to use
TagFilter
andTagRequest
instead of the old models. Ensure that all utility functions that previously usedTagFilterModel
andTagRequestModel
have been updated to use the new classes.163-163: The
create_tag
method call has been updated to use the newTagRequest
class. Confirm that the method's implementation has been adjusted to work with the new class and that all calls to this method are using the updated signature.166-166: The
list_tags
method call has been updated to use the newTagFilter
class. Verify that the method's implementation correctly uses this class and that the utility function is still valid with the new class.tests/integration/functional/model/test_model_version.py (2)
23-23: The import statement has been correctly updated to use the new
TagRequest
class. Ensure that all test functions that previously usedTagRequestModel
have been updated to useTagRequest
.212-212: The
create_tag
method call within the test functiontest_tags_properly_created
has been updated to use the newTagRequest
class. Confirm that the test logic is still correct with the updated class and that theTagRequest
model provides all necessary fields for the test.tests/integration/functional/zen_stores/test_zen_store.py (15)
108-117: The import changes align with the PR's objectives and the renaming of models. Ensure that all dependent code has been updated to use these new imports.
4427-4434: The usage of
TagRequest
in thetest_create_pass
method is correct and aligns with the new model naming conventions.4439-4439: The usage of
TagRequest
in thetest_create_bad_input
method is correct and aligns with the new model naming conventions.4443-4445: The usage of
TagRequest
in thetest_create_duplicate
method is correct and aligns with the new model naming conventions.4449-4449: The usage of
TagRequest
in thetest_get_tag_found
method is correct and aligns with the new model naming conventions.4461-4479: The usage of
TagFilter
andTagRequest
in thetest_list_tags
method is correct and aligns with the new model naming conventions.4483-4491: The usage of
TagUpdate
in thetest_update_tag
method is correct and aligns with the new model naming conventions.4501-4503: The usage of
TagRequest
andTagResourceRequest
in this test case is correct and aligns with the new model naming conventions.4518-4520: The usage of
TagRequest
andTagResourceRequest
in this test case is correct and aligns with the new model naming conventions.4529-4529: The usage of
TagResourceRequest
in this test case is correct and aligns with the new model naming conventions.4540-4543: The usage of
TagRequest
andTagResourceRequest
in this test case is correct and aligns with the new model naming conventions.4569-4572: The usage of
TagRequest
andTagResourceRequest
in this test case is correct and aligns with the new model naming conventions.4597-4600: The usage of
TagRequest
andTagResourceRequest
in this test case is correct and aligns with the new model naming conventions.4610-4610: The usage of
TagResourceRequest
in this test case is correct and aligns with the new model naming conventions.4619-4625: The usage of
TagRequest
andTagResourceRequest
in this test case is correct and aligns with the new model naming conventions.tests/integration/functional/zen_stores/utils.py (13)
43-44: The addition of
BaseRequest
andBaseResponse
aligns with the PR's refactoring objectives. Ensure that these base classes are correctly extended by other models throughout the codebase.67-68: Renaming
SecretFilterModel
toSecretFilter
andSecretRequestModel
toSecretRequest
is consistent with the PR's refactoring goals. Verify that all references to these models have been updated accordingly.489-492: The instantiation of
SecretRequest
within theSecretContext
class appears to be correct and replaces the oldSecretRequestModel
. Confirm that the parameters match the new model's constructor and that the old model is no longer in use.845-846: The introduction of type variables
AnyRequest
andAnyResponse
is a good practice for generalizing method signatures. Ensure that they are used consistently and correctly throughout the file.883-883: The update to the
list_method
signature to returnPage[AnyResponse]
is appropriate and uses the newAnyResponse
type variable correctly.892-892: The update to the
get_method
signature to returnAnyResponse
is consistent with the use of the new type variable.902-902: The update to the
create_method
signature to acceptAnyRequest
and returnAnyResponse
is correct and aligns with the new type constraints.909-909: The update to the
update_method
signature to accept aBaseModel
and returnAnyResponse
is appropriate. Ensure that theBaseModel
is the correct type for the update operation.938-940: The
list
method correctly returns aPage[AnyResponse]
, which is consistent with the use of the new type variable.942-946: The
get
method correctly returns anAnyResponse
. Ensure that the method is used correctly in the context where the entity has been created.948-951: The
update
method correctly returns anAnyResponse
. Verify that theupdate_model
is provided when this method is intended to be used.1067-1072: The instantiation of
SecretRequest
within thesecret_crud_test_config
is correct and replaces the oldSecretRequestModel
. Confirm that the parameters match the new model's constructor.842-843: The removal of
ServiceConnectorTypeModel
andAuthenticationMethodModel
should be verified to ensure it aligns with the refactoring goals and does not negatively impact functionality.
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.
Looks good. Happy to get rid of the last legacy models !
Quickstart template updates in |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Quickstart template updates in |
@stefannica any chance you could add some breaking changes notes to this PR description to help me prepare the release notes? |
Describe changes
The last legacy models (Tags, TagResources and Secrets) are migrated to use the new body/metadata hydration paradigm.
REST API Breaking Changes
This PR introduces breaking changes in the areas of the REST API concerning secrets and tags. As a consequence, the ZenML Client running the previous ZenML version is no longer compatible with a ZenML Server running the new version and vice-versa. To address this, simply ensure that all your ZenML clients use the same version as the server(s) they connect to.
Pre-requisites
Please ensure you have done the following:
develop
and the open PR is targetingdevelop
. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes
Summary by CodeRabbit