CP-13111 Add support for virtual to physical decorators in dvp#622
CP-13111 Add support for virtual to physical decorators in dvp#622rakshandabhat wants to merge 5 commits intodelphix:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new (optional) “virtual to physical” plugin operation to the Python SDK surface so DVP can invoke plugin-provided logic during virtual→physical conversion flows.
Changes:
- Introduce new
Operationenum values for linked/virtualvirtual_to_physical()operations. - Add
virtual_to_physicaldecorators + implementation storage toLinkedOperationsandVirtualOperations. - Add internal wrapper methods that unpack protobuf requests and return
*ToPhysicalResponsemessages.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
platform/src/main/python/dlpx/virtualization/platform/operation.py |
Adds new operation identifiers for linked/virtual virtual-to-physical support. |
platform/src/main/python/dlpx/virtualization/platform/_virtual.py |
Adds virtual.virtual_to_physical() decorator + internal protobuf wrapper for virtual sources. |
platform/src/main/python/dlpx/virtualization/platform/_linked.py |
Adds linked.virtual_to_physical() decorator + internal wrappers for direct and staged sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
platform/src/main/python/dlpx/virtualization/platform/_linked.py
Outdated
Show resolved
Hide resolved
platform/src/main/python/dlpx/virtualization/platform/_linked.py
Outdated
Show resolved
Hide resolved
| def _internal_direct_source_to_physical(self, request): | ||
| """Direct Virtual to Physical Wrapper for direct plugins. | ||
|
|
||
| Executed as part of several operations to convert a virtual source | ||
| to a physical source for a direct source. |
platform/src/main/python/dlpx/virtualization/platform/_virtual.py
Outdated
Show resolved
Hide resolved
platform/src/main/python/dlpx/virtualization/platform/_virtual.py
Outdated
Show resolved
Hide resolved
| def _internal_virtual_to_physical(self, request): | ||
| """Virtual to Physical Wrapper. | ||
|
|
||
| Executed as part of several operations to convert a virtual source | ||
| to a physical source. |
platform/src/main/python/dlpx/virtualization/platform/_linked.py
Outdated
Show resolved
Hide resolved
| self.virtual_to_physical_impl = v.check_function(virtual_to_physical_impl, | ||
| Op.LINKED_SOURCE_TO_PHYSICAL) |
There was a problem hiding this comment.
Pull request overview
Adds SDK-level hooks for a new virtual_to_physical plugin operation so DVP/plugins can participate in virtual→physical conversion flows.
Changes:
- Introduces new
Operationenum values for linked/virtualvirtual_to_physical. - Adds
virtual_to_physical()decorators and*_implstorage in bothLinkedOperationsandVirtualOperations. - Adds internal wrapper methods to invoke plugin implementations and build protobuf responses for direct/staged linked sources and virtual sources.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
platform/src/main/python/dlpx/virtualization/platform/operation.py |
Adds new operation identifiers for linked + virtual virtual_to_physical. |
platform/src/main/python/dlpx/virtualization/platform/_virtual.py |
Adds decorator storage and an internal wrapper for VirtualSourceToPhysical* requests. |
platform/src/main/python/dlpx/virtualization/platform/_linked.py |
Adds decorator storage and internal wrappers for direct/staged *SourceToPhysical* requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| self.virtual_to_physical_impl = v.check_function(virtual_to_physical_impl, | ||
| Op.LINKED_SOURCE_TO_PHYSICAL) |
| source_config=source_config) | ||
|
|
||
| direct_source_to_physical_response = platform_pb2.DirectSourceToPhysicalResponse() | ||
| direct_source_to_physical_response.return_value.database_size = virtual_to_physical |
| staged_source_to_physical_response = platform_pb2.StagedSourceToPhysicalResponse() | ||
| staged_source_to_physical_response.return_value.database_size = virtual_to_physical |
| def _internal_direct_source_to_physical(self, request): | ||
| """Direct Virtual to Physical Wrapper for direct plugins. | ||
|
|
||
| Executed as part of several operations to convert a virtual source | ||
| to a physical source for a direct source. |
| def _internal_virtual_to_physical(self, request): | ||
| """Virtual to Physical Wrapper. | ||
|
|
||
| Executed as part of several operations to convert a virtual source | ||
| to a physical source. |
| virtual_to_physical_response = platform_pb2.VirtualSourceToPhysicalResponse() | ||
| virtual_to_physical_response.return_value.database_size = ( | ||
| virtual_to_physical) |
SumoSourabh
left a comment
There was a problem hiding this comment.
Looks good. Lets test out appdata_basic with the changes for direct, staged and virtual sources along with @PiyushPGuptaG changes.
| STAGED_LINKED_SOURCE_TYPE = 'PluginLinkedStagedSourceDefinition' | ||
| DIRECT_LINKED_SOURCE_TYPE = 'PluginLinkedDirectSourceDefinition' | ||
| SNAPSHOT_PARAMETERS_DEFINITION_TYPE = 'PluginSnapshotParametersDefinition' | ||
| VIRTUAL_TO_PHYSICAL_DEFINITION_TYPE = 'PluginVirtualToPhysicalDefinition' |
There was a problem hiding this comment.
Seems like we might want to remove it.
|
Also, seems like we are missing test cases for platform classes, I will take it up as part of unit test cases JIRA |
|
|
||
| install_requires = [ | ||
| "dvp-api == 1.9.0", | ||
| "dvp-api == 1.10.0", |
There was a problem hiding this comment.
We will need it to be 1.10.0.dev0 version for downloading it from testpypi. We will update it again when we will be releasing the project
Problem
Add support for virtual to physical decorators in dvp
CP-13111
Done By Sourabh :
Add support for virtualToPhysicalDefinition in DVP code.
CP-13110
Solution
Made changes to support respective decorators.
Also includes changes done by @SumoSourabh for :
Add support for virtualToPhysicalDefinition in DVP code.
CP-13110
Testing Done
Manually tested the flow from appgate to plugin.
