[POSTGRESQL] BREAKING CHANGE: az postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commands#33343
Conversation
- Updated backup commands to use `-s` instead of `-n` for server name in backup management tests. - Changed database commands to use `-n` for database name instead of `-d` in database management tests. - Adjusted firewall rule commands to use `--server-name` instead of `-n` for server name in firewall rule management tests. - Modified long-term retention commands to use `-s` for server name instead of `-n` in LTR management tests. - Corrected migration commands to use `--server-name` instead of `--name` for server name in migration management tests. - Updated tag management tests to use `-s` for server name instead of `-n` in backup list command.
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
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>
|
…e-server replica create`
There was a problem hiding this comment.
Pull request overview
This PR implements a breaking CLI argument naming alignment for az postgres flexible-server subcommands so that --name consistently refers to the child resource being acted on (backup/db/firewall rule/migration/etc.), while --server-name is used when the server is an input (not the primary target).
Changes:
- Updated argument wiring in
postgresql/_params.pyto swap/redefine--namevs--server-namefor backup/db/firewall-rule/long-term-retention/migration command groups. - Updated help examples and scenario tests to use the new flags (
--server-name/-sand--name/-n) consistently. - Adjusted a couple of user-facing messages (replica create missing-arg error; database delete usage text).
Reviewed changes
Copilot reviewed 13 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/postgresql/_params.py | Re-maps argument option names to enforce --name (child) vs --server-name (server input) across affected command groups. |
| src/azure-cli/azure/cli/command_modules/postgresql/_help.py | Updates command examples to reflect the new argument names. |
| src/azure-cli/azure/cli/command_modules/postgresql/_breaking_change.py | Removes now-obsolete breaking-change announcements for the argument renames (keeps other unrelated notices). |
| src/azure-cli/azure/cli/command_modules/postgresql/commands/database_commands.py | Updates delete error text to reference the new name concept. |
| src/azure-cli/azure/cli/command_modules/postgresql/commands/replica_commands.py | Improves missing-argument error message when neither --name nor --replica-name is provided. |
| src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_backup.py | Switches backup tests to -s/--server-name + -n/--name pattern. |
| src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_db.py | Switches db tests to --name for database and --server-name for server. |
| src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_elastic_clusters.py | Updates db create invocation to the new --name database argument. |
| src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_fabric_mirroring.py | Updates db create invocation to the new --name database argument. |
| src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_firewall_rule.py | Switches firewall-rule tests to --server-name for server and --name for rule. |
| src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_ltr.py | Switches long-term-retention tests to --server-name for server and --name for backup. |
| src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_migration.py | Switches migration tests to --server-name for server and --name for migration identifier. |
| src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_tags.py | Updates backup list invocation used for restore-with-tags precondition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…lica create` to remove `--replica-name` argument and make `--name` required.
- Changed AllowLargeResponse to accept a size parameter of 2048. - Removed the live_only decorator from the test_postgres_flexible_server_ltr method.
|
Fixes #33333 |
az postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commandsaz postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commands
az postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commandsaz postgres flexible-server backup | db | firewall-rule | long-term-retention | migration | replica create: Make consistent use of --name and --server-name across all commands
Related command
az postgres flexible-server backupaz postgres flexible-server dbaz postgres flexible-server firewall-ruleaz postgres flexible-server long-term-retentionaz postgres flexible-server migrationaz postgres flexible-server replica createDescription
Changes implemented:
--nameshould refer to the object to which the command refers--server-nameshould be used whenever the command doesn't refer directly to the server object, but requires the name of the server to be provided as an input.Commands which were correctly using this pattern:
az postgres flexible-server ad-adminaz postgres flexible-server advanced-threat-protection-settingaz postgres flexible-server identityaz postgres flexible-server parameteraz postgres flexible-server private-endpoint-connectionaz postgres flexible-server private-link-resourceaz postgres flexible-server server-logsaz postgres flexible-server virtual-endpointCommands which weren't using that pattern and are changed with this PR, following corresponding deprecation announcement (#32560):
az postgres flexible-server backup:--backup-nameshould be replaced with--name, and--nameshould be replaced with--server-name.az postgres flexible-server db:--database-nameshould be replaced with--name.az postgres flexible-server firewall-rule:--nameshould be replaced with--server-name, and--rule-nameshould be replaced with--name.az postgres flexible-server long-term-retention:--nameshould be replaced with--server-name.az postgres flexible-server migration:--migration-nameshould be replaced with--name, and--nameshould be replaced with--server-name.Testing Guide
History Notes
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.