[Oracle-Database] Fix ADBS discriminator for adbs commands#9917
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
Hi @mihretkidane-OCI, |
There was a problem hiding this comment.
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
actionandchange-disaster-recovery-configurationtests. - Updated multiple AAZ command modules to explicitly include
properties.data_base_type(serialized_name="dataBaseType") beforediscriminate_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. |
| @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)) |
| restore_timestamp = os.environ.get( | ||
| 'AZURE_ORACLE_DATABASE_ADBS_RESTORE_TIMESTAMP', | ||
| '2026-06-03T12:34:54.000Z' | ||
| ) |
| 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' |
| 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 |
| - 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 |
|
oracle |
|
This PR fixes the issue with adb-s discriminator on cross region related commands |
|
[Release] Update index.json for extension [ oracle-database-2.0.3 ] : https://dev.azure.com/msazure/One/_build/results?buildId=166722599&view=results |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)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.jsonautomatically.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.