Conversation
️✔️AzureCLI-FullTest
|
|
Hi @nasc17, |
️✔️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
The PR fixes a bug in database name validation for the Postgres flexible-server commands. Key changes include:
- Updating the regex in validate_database_name to allow hyphens and a longer name length.
- Adjusting error/help messages to reflect the new allowed characters and length.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/rdbms/validators.py | Updated database name regex and error message |
| src/azure-cli/azure/cli/command_modules/rdbms/_params.py | Updated help message to reflect new database naming rules |
Comments suppressed due to low confidence (2)
src/azure-cli/azure/cli/command_modules/rdbms/validators.py:988
- Consider adding unit tests covering edge cases for the updated database name regex to ensure that both valid and invalid names are correctly handled.
def validate_database_name(database_name):
src/azure-cli/azure/cli/command_modules/rdbms/_params.py:268
- Consider adding automated tests to ensure that the help message correctly reflects the allowed characters and length of the database name.
help='The name of the database to be created when provisioning the database server. ...'
|
@evelyn-ys Please trigger checks |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
az postgres flexible-server createaz postgres flexible-server db createDescription
RegExp = /^[a-zA-Z_][a-zA-Z0-9_]{0,62}$/
Database name must begin with a letter (a-z) or underscore (_). Subsequent characters in a name can be letters, digits (0-9), hyphens (-), or underscores. Database name length must be less than 64 characters.
Testing Guide
Manually
History Notes
[RDBMS]
az postgres flexible-server create/db: Fix for--database-namevalidation.