Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,10 @@ def _build_schema_on_200(cls):
whitelisted_ips = cls._schema_on_200.value.Element.properties.whitelisted_ips
whitelisted_ips.Element = AAZStrType()

cls._schema_on_200.value.Element.properties.data_base_type = AAZStrType(
serialized_name="dataBaseType",
)

disc_clone = cls._schema_on_200.value.Element.properties.discriminate_by("data_base_type", "Clone")
Comment on lines +608 to 612
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

This file path (aaz/latest/.../_list.py) typically contains generated code. If this is generated in your repo, a manual patch here risks being overwritten on the next generation run. Prefer fixing the upstream source (Swagger/spec, codegen template, or AAZ generation config) so dataBaseType is emitted as a modeled property before discriminate_by(...), then regenerate to keep the change durable.

Copilot uses AI. Check for mistakes.
disc_clone.is_reconnect_clone_enabled = AAZBoolType(
serialized_name="isReconnectCloneEnabled",
Expand Down Expand Up @@ -1207,6 +1211,10 @@ def _build_schema_on_200(cls):
whitelisted_ips = cls._schema_on_200.value.Element.properties.whitelisted_ips
whitelisted_ips.Element = AAZStrType()

cls._schema_on_200.value.Element.properties.data_base_type = AAZStrType(
serialized_name="dataBaseType",
)

disc_clone = cls._schema_on_200.value.Element.properties.discriminate_by("data_base_type", "Clone")
Comment on lines +1214 to 1218
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The same data_base_type schema addition is duplicated in two separate _build_schema_on_200 blocks (this one and the earlier occurrence around ~608). To reduce the chance of future drift, consider consolidating the shared schema setup into a small helper invoked by both builders (or, if this is generated, ensure the generator emits it consistently for both operations so you don't need to maintain duplicate patches).

Copilot uses AI. Check for mistakes.
disc_clone.is_reconnect_clone_enabled = AAZBoolType(
serialized_name="isReconnectCloneEnabled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def test_oracledatabase_adbs(self, resource_group):
self.cmd('az oracle-database database-system-shape list --location eastus ')
self.cmd('az oracle-database dns-private-zone list --location eastus ')
self.cmd('az oracle-database dns-private-view list --location eastus ')
# Regression coverage for INDIGO-26148: list commands must not fail on dataBaseType discriminator.
self.cmd('az oracle-database autonomous-database list ')
self.cmd('az oracle-database autonomous-database list --resource-group PowerShellTestRg ')
self.cmd('az oracle-database autonomous-database create --location eastus '
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

As written, both list calls happen before any Autonomous Database is created in this test, so the response may be empty and never exercise deserialization of entries containing dataBaseType (the regression described). To make this regression coverage reliable, move at least one list call to after the create completes (and ideally assert the created resource appears in the list output), so the test deterministically validates parsing of an item that includes the discriminator.

Copilot uses AI. Check for mistakes.
'--autonomousdatabasename ADBScliTest '
'--resource-group PowerShellTestRg '
Expand All @@ -36,4 +39,4 @@ def test_oracledatabase_adbs(self, resource_group):
'--vnet-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PowerShellTestRg/providers/Microsoft.Network/virtualNetworks/PSTestVnet --regular --no-wait ')
self.cmd('az oracle-database autonomous-database delete '
'--autonomousdatabasename ADBScli '
'--resource-group PowerShellTestRg --yes --no-wait ')
'--resource-group PowerShellTestRg --yes --no-wait ')
Loading