Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
Hi @mihretkidane-OCI, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
CodeGen Tools Feedback CollectionThank 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 |
There was a problem hiding this comment.
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 listcommands. - Extend AAZ response schema to include
dataBaseTypeasdata_base_typesodiscriminate_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. |
| # 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 ' |
There was a problem hiding this comment.
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.
| 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") |
There was a problem hiding this comment.
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.
| 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") |
There was a problem hiding this comment.
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).
|
|
[Release] Update index.json for extension [ oracle-database-2.0.1 ] : https://dev.azure.com/msazure/One/_build/results?buildId=157947014&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.