Skip to content

adbs list hot fix for customer#9705

Merged
necusjz merged 2 commits intoAzure:mainfrom
mihretkidane-OCI:mkidane/codex-INDIGO-26148
Mar 24, 2026
Merged

adbs list hot fix for customer#9705
necusjz merged 2 commits intoAzure:mainfrom
mihretkidane-OCI:mkidane/codex-INDIGO-26148

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 March 20, 2026 18:28
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Mar 20, 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.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Mar 20, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

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

Adds regression coverage and a schema fix so az oracle-database autonomous-database list no longer fails when the service response includes the dataBaseType discriminator.

Changes:

  • Add regression test invocations for autonomous-database list commands.
  • Extend AAZ response schema to include dataBaseType as data_base_type so discriminate_by(...) works during deserialization.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/oracle-database/azext_oracle_database/tests/latest/test_oracle_database_adbs.py Adds regression coverage for autonomous-database list not failing on discriminator parsing.
src/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_list.py Fixes list response schema by defining dataBaseType backing field used for discriminator selection.

Comment on lines 27 to 30
# 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.
Comment on lines +608 to 612
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")
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.
Comment on lines +1214 to 1218
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")
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.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2026

@yonzhan yonzhan requested a review from necusjz March 21, 2026 00:26
@mihretkidane-OCI mihretkidane-OCI changed the title adbs list fix adbs list hot fix for customer Mar 23, 2026
@necusjz necusjz merged commit 8255414 into Azure:main Mar 24, 2026
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ oracle-database-2.0.1 ] : https://dev.azure.com/msazure/One/_build/results?buildId=157947014&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.

5 participants