-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{RDBMS} az postgres flexible-server backup, az postgres flexible-server db, az postgres flexible-server firewall-rule, az postgres flexible-server long-term-retention, az postgres flexible-server migration, az postgres flexible-server replica create : Add breaking change announcements and --name argument to `
#32560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| postgres flexible-server backup | sub group postgres flexible-server backup added property deprecate_info_target |
||
| postgres flexible-server db | sub group postgres flexible-server db added property deprecate_info_target |
||
| postgres flexible-server firewall-rule | sub group postgres flexible-server firewall-rule added property deprecate_info_target |
||
| postgres flexible-server long-term-retention | sub group postgres flexible-server long-term-retention added property deprecate_info_target |
||
| postgres flexible-server migration | sub group postgres flexible-server migration added property deprecate_info_target |
||
| postgres flexible-server replica create | cmd postgres flexible-server replica create added parameter name |
||
| postgres flexible-server replica create | cmd postgres flexible-server replica create update parameter replica_name: removed property required=True |
|
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>
|
|
@evelyn-ys please trigger checks |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR establishes a consistent argument naming pattern across Azure PostgreSQL flexible-server commands by introducing breaking change announcements and adding the --name argument to the replica create command. The changes deprecate --replica-name in favor of --name to align with the established pattern where --name refers to the object the command operates on, and --server-name is used when the command requires a server reference.
Key changes:
- Adds breaking change announcements for multiple command groups (backup, db, firewall-rule, long-term-retention, migration, replica)
- Introduces
--nameargument as the preferred option forreplica createcommand while maintaining backward compatibility with--replica-name - Updates all tests and documentation examples to use the new
--nameargument
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
_breaking_change.py |
Adds breaking change announcements for upcoming argument naming standardization across backup, database, firewall-rule, long-term-retention, migration, and replica commands |
_params.py |
Adds --name parameter definition for replica create command alongside existing --replica-name |
flexible_server_custom_postgres.py |
Updates replica create function to accept both --name and --replica-name arguments with fallback logic |
_helptext_pg.py |
Updates all help text examples to use --name instead of --replica-name |
test_rdbms_flexible_commands.py |
Updates 11 test cases to use --name argument instead of --replica-name |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | ||
| register_other_breaking_change('postgres flexible-server long-term-retention', | ||
| message='The --name/-n argument will be repurposed to specify the backup name. ' | ||
| 'The --server-name/-s argument will be introduced to specify the server name ' | ||
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | ||
|
|
||
| # Backup command argument changes | ||
| register_other_breaking_change('postgres flexible-server backup', | ||
| message='The --backup-name/-b argument has been deprecated and will be removed ' | ||
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | ||
| register_other_breaking_change('postgres flexible-server backup', | ||
| message='The --name/-n argument will be repurposed to specify the backup name. ' | ||
| 'The --server-name/-s argument will be introduced to specify the server name ' | ||
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | ||
|
|
||
| # Database command argument changes | ||
| register_other_breaking_change('postgres flexible-server db', | ||
| message='The --database-name/-d argument has been deprecated and will be removed ' | ||
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | ||
| register_other_breaking_change('postgres flexible-server db', | ||
| message='The --name/-n argument will be repurposed to specify the database name. ' | ||
| 'The --server-name/-s argument will be introduced to specify the server name ' | ||
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | ||
|
|
||
| # Firewall rule command argument changes | ||
| register_other_breaking_change('postgres flexible-server firewall-rule', | ||
| message='The --name/-n argument will be repurposed to specify the firewall rule ' | ||
| 'name. The --server-name/-s argument will be introduced to specify the server ' | ||
| 'name in next breaking change release(2.86.0) scheduled for May 2026.') | ||
| register_other_breaking_change('postgres flexible-server firewall-rule', | ||
| message='The --rule-name/-r argument has been deprecated and will be removed ' | ||
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | ||
|
|
||
| # Migration command argument changes | ||
| register_other_breaking_change('postgres flexible-server migration', | ||
| message='The --migration-name argument has been deprecated and will be removed ' | ||
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | ||
| register_other_breaking_change('postgres flexible-server migration', | ||
| message='The --name/-n argument will be repurposed to specify the migration name. ' | ||
| 'The --server-name/-s argument will be introduced to specify the server name ' | ||
| 'in next breaking change release(2.86.0) scheduled for May 2026.') |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The breaking change messages for these command groups use inconsistent phrasing. Some say "will be repurposed" while others say "will be introduced". Additionally, the message says "in next breaking change release(2.86.0) scheduled for May 2026" but should be more consistently formatted as "in the next breaking change release (2.86.0) scheduled for May 2026" (with article "the" and proper spacing around parentheses) to match standard English grammar.
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server long-term-retention', | |
| message='The --name/-n argument will be repurposed to specify the backup name. ' | |
| 'The --server-name/-s argument will be introduced to specify the server name ' | |
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| # Backup command argument changes | |
| register_other_breaking_change('postgres flexible-server backup', | |
| message='The --backup-name/-b argument has been deprecated and will be removed ' | |
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server backup', | |
| message='The --name/-n argument will be repurposed to specify the backup name. ' | |
| 'The --server-name/-s argument will be introduced to specify the server name ' | |
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| # Database command argument changes | |
| register_other_breaking_change('postgres flexible-server db', | |
| message='The --database-name/-d argument has been deprecated and will be removed ' | |
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server db', | |
| message='The --name/-n argument will be repurposed to specify the database name. ' | |
| 'The --server-name/-s argument will be introduced to specify the server name ' | |
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| # Firewall rule command argument changes | |
| register_other_breaking_change('postgres flexible-server firewall-rule', | |
| message='The --name/-n argument will be repurposed to specify the firewall rule ' | |
| 'name. The --server-name/-s argument will be introduced to specify the server ' | |
| 'name in next breaking change release(2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server firewall-rule', | |
| message='The --rule-name/-r argument has been deprecated and will be removed ' | |
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| # Migration command argument changes | |
| register_other_breaking_change('postgres flexible-server migration', | |
| message='The --migration-name argument has been deprecated and will be removed ' | |
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server migration', | |
| message='The --name/-n argument will be repurposed to specify the migration name. ' | |
| 'The --server-name/-s argument will be introduced to specify the server name ' | |
| 'in next breaking change release(2.86.0) scheduled for May 2026.') | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server long-term-retention', | |
| message='The --name/-n argument will be repurposed to specify the backup name. ' | |
| 'The --server-name/-s argument will be introduced to specify the server name ' | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| # Backup command argument changes | |
| register_other_breaking_change('postgres flexible-server backup', | |
| message='The --backup-name/-b argument has been deprecated and will be removed ' | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server backup', | |
| message='The --name/-n argument will be repurposed to specify the backup name. ' | |
| 'The --server-name/-s argument will be introduced to specify the server name ' | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| # Database command argument changes | |
| register_other_breaking_change('postgres flexible-server db', | |
| message='The --database-name/-d argument has been deprecated and will be removed ' | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server db', | |
| message='The --name/-n argument will be repurposed to specify the database name. ' | |
| 'The --server-name/-s argument will be introduced to specify the server name ' | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| # Firewall rule command argument changes | |
| register_other_breaking_change('postgres flexible-server firewall-rule', | |
| message='The --name/-n argument will be repurposed to specify the firewall rule ' | |
| 'name. The --server-name/-s argument will be introduced to specify the server ' | |
| 'name in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server firewall-rule', | |
| message='The --rule-name/-r argument has been deprecated and will be removed ' | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| # Migration command argument changes | |
| register_other_breaking_change('postgres flexible-server migration', | |
| message='The --migration-name argument has been deprecated and will be removed ' | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') | |
| register_other_breaking_change('postgres flexible-server migration', | |
| message='The --name/-n argument will be repurposed to specify the migration name. ' | |
| 'The --server-name/-s argument will be introduced to specify the server name ' | |
| 'in the next breaking change release (2.86.0) scheduled for May 2026.') |
| replica_name = replica_name.lower() | ||
|
|
||
| if replica_name is None and name is None: | ||
| raise RequiredArgumentMissingError('the following arguments are required: --name') |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message should mention both the new --name and the deprecated --replica-name arguments since both are valid during the transition period. The message currently only mentions --name, which could confuse users who are still using --replica-name. Consider updating to: "One of the following arguments is required: --name, --replica-name"
| raise RequiredArgumentMissingError('the following arguments are required: --name') | |
| raise RequiredArgumentMissingError('One of the following arguments is required: --name, --replica-name') |
| replica_name = replica_name.lower() | ||
|
|
||
| if replica_name is None and name is None: | ||
| raise RequiredArgumentMissingError('the following arguments are required: --name') |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for handling --name and --replica-name gives priority to --name when both are provided (line 604: replica_name.lower() if name is None else name.lower()). However, there's no warning or error when both arguments are specified simultaneously. This could lead to confusion during the transition period. Consider adding a check to either warn users or raise a MutuallyExclusiveArgumentError when both arguments are provided, to guide users toward using only --name.
| raise RequiredArgumentMissingError('the following arguments are required: --name') | |
| raise RequiredArgumentMissingError('the following arguments are required: --name') | |
| if replica_name is not None and name is not None: | |
| raise MutuallyExclusiveArgumentError('usage error: --name and --replica-name cannot be used together. Please use --name.') |
| with self.argument_context('{} flexible-server replica create'.format(command_group)) as c: | ||
| c.argument('source_server', arg_type=source_server_arg_type) | ||
| c.argument('replica_name', options_list=['--replica-name'], | ||
| help='The name of the server to restore to.') |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text for the deprecated --replica-name argument is incorrect. It says "The name of the server to restore to." but should say "The name of the read replica." This argument is being deprecated in favor of --name, but its help text should still accurately describe its purpose while it remains available.
| help='The name of the server to restore to.') | |
| help='The name of the read replica.') |
Related command
az postgres flexible-server backup az postgres flexible-server db az postgres flexible-server firewall-rule az postgres flexible-server long-term-retention az postgres flexible-server migration az postgres flexible-server replica createDescription
Wish to change in future:
--name should refer to the object to which the command refers
--server-name should 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 are correctly using this pattern:
az postgres flexible-server ad-admin commands.
az postgres flexible-server advanced-threat-protection-setting.
az postgres flexible-server identity.
az postgres flexible-server parameter.
az postgres flexible-server private-endpoint-connection.
az postgres flexible-server private-link-resource.
az postgres flexible-server server-logs.
az postgres flexible-server virtual-endpoint.
Commands which aren't using that pattern and should be changed, following corresponding deprecation path:
az postgres flexible-server backup: --backup-name should be replaced with --name, and --name should be replaced with --server-name.
az postgres flexible-server db: --database-name should be replaced with --name.
az postgres flexible-server firewall-rule: --name should be replaced with --server-name, and --rule-name should be replaced with --name.
az postgres flexible-server long-term-retention: --name should be replaced with --server-name.
az postgres flexible-server migration: --migration-name should be replaced with --name, and --name should be replaced with --server-name.
Testing Guide
History Notes
[RDBMS]
az postgres flexible-server replica create: Add--nameargument to specify read replica name