Conversation
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
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 centralizes PostgreSQL version validation/warnings by promoting the existing internal version validator to a reusable pg_version_validator, then reuses it in the flexible server major-version upgrade flow. It also refreshes the help text for the migrate-network command.
Changes:
- Renames and updates the PostgreSQL version validator to emit a consolidated “retired community version / extended support” warning for versions 11–13.
- Reuses the version validator in the flexible-server version upgrade command.
- Updates
migrate-networkhelp text to a more specific description.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py |
Renames version validator and updates warning messaging for retired PostgreSQL versions. |
src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py |
Calls shared version validator during major-version upgrades (and updates imports). |
src/azure-cli/azure/cli/command_modules/postgresql/_help.py |
Updates the migrate-network command short-summary and example text. |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py:42
pg_version_validator()now raises whenversionis not ineligible_versions, so the subsequentif version not in eligible_versions:block becomes unreachable for normal non-emptyversionvalues and duplicates the validation. This also changes the user-facing error path away from the more specific upgrade error message below. Consider either (a) callingpg_version_validatoronly for the EOL/retired-version warning (after the upgrade-specific validation), or (b) removing the redundantif version not in eligible_versions:logic and keeping a single consistent error message.
pg_version_validator(version, eligible_versions)
if version not in eligible_versions:
# version not supported
error_message = ""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| from ..utils._flexible_server_location_capabilities_util import get_postgres_server_capability_info | ||
| from ..utils._flexible_server_util import resolve_poller | ||
| from ..utils.validators import validate_citus_cluster, validate_resource_group | ||
| from ..utils.validators import pg_version_validator, validate_citus_cluster, validate_resource_group | ||
|
|
||
| logger = get_logger(__name__) |
There was a problem hiding this comment.
After replacing the inline warning with pg_version_validator, this module no longer uses logger (or get_logger). Consider removing the get_logger import and logger = get_logger(__name__) assignment to avoid unused-variable/lint issues.
| short-summary: Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link network model. | ||
| examples: | ||
| - name: Migrate the network mode of a flexible server. | ||
| - name: Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link network model. | ||
| text: az postgres flexible-server migrate-network --resource-group testGroup --name testserver |
There was a problem hiding this comment.
The help text uses third-person "Migrates" in short-summary and the example name. Elsewhere in this file, short-summary strings are consistently written in imperative form (e.g., "Restart a flexible server."). Consider changing these back to "Migrate ..." for consistency.
Related command
az postgres flexible-server createaz postgres flexible-server upgradeaz postgres flexible-server migrate-networkDescription
change the description for the CLI migrate-network command to this: "Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link network model".
This is important because migration functionality supports only one-way migration (from VNet to PE capable).
Customers using PG version 11, 12 or 13 are informed about extended support.
Testing Guide
Version
az postgres flexible-server create -g nascrunner26 -n nasc-pg13 --version 13
Checking the existence of the resource group 'nascrunner26'...
Resource group 'nascrunner26' exists ? : True
The version selected is a retired community version of PostgreSQL. To use this version, you will automatically be enrolled in our extended support plan for an additional charge. Upgrade to PostgreSQL 14 or later as soon as possible to maintain security, performance, and supportability.
Detected current client IP :
Migrate network
Examples
Migrates an Azure Database for PostgreSQL server from VNet integration to a Private Link network
model.
az postgres flexible-server migrate-network --resource-group testGroup --name testserver
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis 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.