Skip to content

[Oracle-Database] Fix ADBS discriminator for adbs commands#9917

Merged
jsntcy merged 2 commits into
Azure:mainfrom
mihretkidane-OCI:fix-adbsCrossRegionDR
Jun 4, 2026
Merged

[Oracle-Database] Fix ADBS discriminator for adbs commands#9917
jsntcy merged 2 commits into
Azure:mainfrom
mihretkidane-OCI:fix-adbsCrossRegionDR

Conversation

@mihretkidane-OCI
Copy link
Copy Markdown
Contributor


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings June 4, 2026 00:32
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Jun 4, 2026

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @mihretkidane-OCI,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

Copy link
Copy Markdown
Contributor

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

Note

Copilot was unable to run its full agentic suite in this review.

Adds new scenario tests and recordings for Oracle Autonomous Database actions (action/restart, shrink, restore, and disaster recovery operations) and updates AAZ response schemas to include dataBaseType for response discrimination.

Changes:

  • Added new CLI scenario tests for ADBS action/shrink/restore and cross-region disaster recovery actions.
  • Added VCR recordings for action and change-disaster-recovery-configuration tests.
  • Updated multiple AAZ command modules to explicitly include properties.data_base_type (serialized_name="dataBaseType") before discriminate_by(...).

Reviewed changes

Copilot reviewed 9 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/oracle-database/azext_oracle_database/tests/latest/test_oracle_database_adbs_restore_shrink_action.py Adds scenario tests for action/shrink/restore.
src/oracle-database/azext_oracle_database/tests/latest/test_oracle_database_adbs_disaster_recovery_actions.py Adds scenario tests for cross-region DR create/config/switchover/failover.
src/oracle-database/azext_oracle_database/tests/latest/recordings/test_oracledatabase_adbs_change_disaster_recovery_configuration.yaml Adds recording for change DR configuration request/async polling.
src/oracle-database/azext_oracle_database/tests/latest/recordings/test_oracledatabase_adbs_action.yaml Adds recording for autonomous DB action (Restart) request/async polling.
src/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_switchover.py Adds dataBaseType to schema to support discrimination.
src/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_shrink.py Adds dataBaseType to schema to support discrimination.
src/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_restore.py Adds dataBaseType to schema to support discrimination.
src/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_failover.py Adds dataBaseType to schema to support discrimination.
src/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_change_disaster_recovery_configuration.py Adds dataBaseType to schema to support discrimination.
src/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_action.py Adds dataBaseType to schema to support discrimination.

Comment on lines +23 to +30
@ResourceGroupPreparer(name_prefix='cli_test_odba_rg')
def test_oracledatabase_adbs_action(self, resource_group):
resource_group_name, autonomous_database_name = self._get_adbs_operation_args()

self.cmd('az oracle-database autonomous-database action '
'--resource-group {} '
'--autonomousdatabasename {} '
'--action Restart '.format(resource_group_name, autonomous_database_name))
Comment on lines +47 to +50
restore_timestamp = os.environ.get(
'AZURE_ORACLE_DATABASE_ADBS_RESTORE_TIMESTAMP',
'2026-06-03T12:34:54.000Z'
)
Comment on lines +31 to +35
def test_oracledatabase_adbs_create_cross_region_disaster_recovery(self, resource_group):
subscription_id = self.get_subscription_id()
resource_group_name = 'PowerShellTestRg'
source_database_name = 'tetscrdr'
source_location = 'eastus'
Comment on lines +95 to +115
def test_oracledatabase_adbs_switchover(self, resource_group):
subscription_id = self.get_subscription_id()
resource_group_name = 'PowerShellTestRg'
source_database_name = 'tetscrdr'
cross_region_dr_location = 'germanywestcentral'
cross_region_dr_name = os.environ.get('AZURE_ORACLE_DATABASE_ADBS_CRDR_NAME', 'ADBScrdrno7geovodtnk')
peer_args = self._get_peer_args(subscription_id, resource_group_name, cross_region_dr_name, cross_region_dr_location)

self.cmd('az oracle-database autonomous-database switchover '
'--resource-group {} '
'--autonomousdatabasename {} '
'{}'.format(resource_group_name, source_database_name, peer_args))

@AllowLargeResponse(size_kb=10240)
@ResourceGroupPreparer(name_prefix='cli_test_odba_rg')
def test_oracledatabase_adbs_failover(self, resource_group):
subscription_id = self.get_subscription_id()
resource_group_name = 'PowerShellTestRg'
source_database_name = 'ADBScrdrno7geovodtnk'
cross_region_dr_location = 'eastus'
cross_region_dr_name = os.environ.get('AZURE_ORACLE_DATABASE_ADBS_CRDR_NAME', 'tetscrdr')
# --------------------------------------------------------------------------------------------
import os
import unittest
import time
Comment on lines +20 to +22
- AZURECLI/2.81.0 azsdk-python-core/1.35.0 Python/3.14.0 (macOS-26.5-arm64-arm-64bit-Mach-O)
method: POST
uri: https://www-proxy-adcq7-new.us.oracle.com:80/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PowerShellTestRg/providers/Oracle.Database/autonomousDatabases/tetscrdr/changeDisasterRecoveryConfiguration?api-version=2025-09-01
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jun 4, 2026

oracle

@mihretkidane-OCI
Copy link
Copy Markdown
Contributor Author

This PR fixes the issue with adb-s discriminator on cross region related commands

@yonzhan yonzhan requested a review from jsntcy June 4, 2026 05:59
@jsntcy jsntcy requested a review from Pan-Qi June 4, 2026 06:38
@calvinhzy calvinhzy changed the title Fix ADBS discreminator for adbs commands [Oracle-Database] Fix ADBS discriminator for adbs commands Jun 4, 2026
@jsntcy jsntcy merged commit c0aec0c into Azure:main Jun 4, 2026
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

azclibot commented Jun 4, 2026

[Release] Update index.json for extension [ oracle-database-2.0.3 ] : https://dev.azure.com/msazure/One/_build/results?buildId=166722599&view=results

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.

6 participants