Skip to content

CP-13111 Add support for virtual to physical decorators in dvp#622

Open
rakshandabhat wants to merge 5 commits intodelphix:developfrom
rakshandabhat:V2P
Open

CP-13111 Add support for virtual to physical decorators in dvp#622
rakshandabhat wants to merge 5 commits intodelphix:developfrom
rakshandabhat:V2P

Conversation

@rakshandabhat
Copy link
Copy Markdown
Contributor

@rakshandabhat rakshandabhat commented Mar 13, 2026

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.
Screenshot 2026-03-18 at 10 31 01 PM

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Operation enum values for linked/virtual virtual_to_physical() operations.
  • Add virtual_to_physical decorators + implementation storage to LinkedOperations and VirtualOperations.
  • Add internal wrapper methods that unpack protobuf requests and return *ToPhysicalResponse messages.

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.

Comment on lines +337 to +341
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.
Comment on lines +864 to +868
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.
Comment on lines +120 to +121
self.virtual_to_physical_impl = v.check_function(virtual_to_physical_impl,
Op.LINKED_SOURCE_TO_PHYSICAL)
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Operation enum values for linked/virtual virtual_to_physical.
  • Adds virtual_to_physical() decorators and *_impl storage in both LinkedOperations and VirtualOperations.
  • 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.

Comment on lines +120 to +121
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
Comment on lines +971 to +972
staged_source_to_physical_response = platform_pb2.StagedSourceToPhysicalResponse()
staged_source_to_physical_response.return_value.database_size = virtual_to_physical
Comment on lines +337 to +341
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.
Comment on lines +864 to +868
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.
Comment on lines +914 to +916
virtual_to_physical_response = platform_pb2.VirtualSourceToPhysicalResponse()
virtual_to_physical_response.return_value.database_size = (
virtual_to_physical)
Copy link
Copy Markdown
Contributor

@SumoSourabh SumoSourabh left a comment

Choose a reason for hiding this comment

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

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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like we might want to remove it.

@SumoSourabh
Copy link
Copy Markdown
Contributor

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",
Copy link
Copy Markdown
Contributor

@SumoSourabh SumoSourabh Mar 19, 2026

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants