Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
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>
|
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where az postgres flexible-server upgrade and az postgres flexible-server index-tuning --enabled true commands incorrectly fail with a location restriction error when the capabilities API returns OfferRestricted set to Enabled. These commands query server capabilities but should not enforce offer restrictions since they operate on existing servers.
Key Changes:
- Added a boolean parameter
is_offer_restriction_check_requiredto capability check functions to control whether offer restriction validation should be skipped - Updated
upgradeandindex-tuningcommands to passis_offer_restriction_check_required=Trueto bypass the restriction check - Modified the restriction check logic to skip validation when the parameter is True
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
_flexible_server_location_capabilities_util.py |
Added is_offer_restriction_check_required parameter to capability check functions and updated conditional logic to skip restriction checks when parameter is True |
flexible_server_custom_postgres.py |
Updated index_tuning_update to pass is_offer_restriction_check_required=True when calling capability check |
flexible_server_custom_common.py |
Updated flexible_server_version_upgrade to pass is_offer_restriction_check_required=True when calling capability check |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_location_capabilities_util.py
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_location_capabilities_util.py
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_location_capabilities_util.py
Show resolved
Hide resolved
…_capability function
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
az postgres flexible-server index-tuning --enabled trueDescription
az postgres flexible-server update,az postgres flexible-server create,az postgres flexible-server replica create,az postgres flexible-server index-tuning --enabled true, andaz postgres flexible-server upgrade, end up calling _postgres_parse_list_capability, which in all cases would raise error The location is restricted for provisioning of flexible servers. Please try using another region. if capabilities API returns OfferRestricted set to Enabled.For
az postgres flexible-server index-tuning --enabled trueit shouldn't do such check.Testing Guide
History Notes
{RDBMS}
az postgres flexible-server index-tuning --enabled trueshouldn't check if Capabilities API reports back that OfferRestricted isn't disabled.This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.