[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.
️✔️AzureCLI-FullTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
❌AzureCLI-BreakingChangeTest
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
|
|
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.
|
Closes #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
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
a0x1ab
left a comment
There was a problem hiding this comment.
CI Review — PR #33343
❌ CI Failures (2/56 checks failed)
Root cause: Branch needs rebase onto dev
The Check External Source URLs job failed with a git error, not an actual URL violation:
Unable to evaluate diff between 'origin/dev' and 'HEAD': fatal: origin/dev...HEAD: no merge base
This happens because the CI does a shallow fetch (--depth=1) of the dev branch, and the PR branch no longer shares a reachable merge base. This cascades into the overall Azure.azure-cli pipeline failure.
✅ Everything else passed (54/56 checks)
All linting, style, unit tests, wheel builds, integration tests, and breaking-change tests passed.
🔧 Action needed
@copilot Please rebase this branch onto the latest dev:
git fetch upstream dev
git rebase upstream/dev
git push --force-with-leaseThis will give CI a shared merge base and allow the URL validation script to run successfully.
Posted by agent-assist (autonomous bug-fix pipeline).
…rver-name-breaking-change
a0x1ab
left a comment
There was a problem hiding this comment.
Agent Review — PR #33343
CI: ✅ All checks passed (3/3)
Summary
This PR correctly implements the breaking changes announced for the az postgres flexible-server subcommands, resolving issue #33333 where --server-name was not recognized despite being documented as a new parameter.
Changes look correct:
_breaking_change.py: Removes forward-looking deprecation notices that have now been enacted (clean-up is appropriate since the changes are live)._help.py: All examples updated to use--server-name(for server) and--name(for resource name) consistently acrossbackup,db,firewall-rule,long-term-retention,migration, andreplicasub-commands._params.py: Argument registration updated to reflect the new--name/--server-namenaming convention.commands/: Implementation updated fordatabase_commands.pyandreplica_commands.py.- Tests: Recordings and test scripts updated to exercise the new argument names.
No Issues Found
The changes are consistent, well-scoped, and the test recordings have been updated. The fix directly addresses the user-facing bug where --server-name caused unrecognized arguments errors.
Posted by agent-assist (autonomous bug-fix pipeline).
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
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Please merge dev into this branch. |
|
🔔 Routing this PR to @act-observability-squad. |
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.