Repository navigation
[PostgreSQL] Add immutable backup support to flexible-server create - #34320
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d30cea2e-7cc9-4e1f-ae2b-119cbc3c08a4
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
🟡 Changes recommended
The new payload and argument-validation tests are outside azdev’s normal latest-profile discovery path, so CI will not run them unless the module is moved to tests/latest/test_custom_commands.py.
1 open issue
What changed in this PR
Adds immutable backup support to az postgres flexible-server create, including argument validation, request payload handling, and usage documentation.
Changes:
- Adds optional
--immutable-backup Enabled|Disabledand passes it to the backup configuration. - Rejects enabled immutable backups when
--node-countis supplied. - Adds a help example, unit tests, and a live-only scenario test.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py |
Validates incompatibility with elastic clusters. |
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_custom_commands.py |
Tests argument parsing, validation, and payload serialization. |
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_backup.py |
Adds live-only coverage for enabled and disabled immutable backups. |
src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py |
Passes the immutable backup setting into the SDK model. |
src/azure-cli/azure/cli/command_modules/postgresql/_params.py |
Registers the new option and validator. |
src/azure-cli/azure/cli/command_modules/postgresql/_help.py |
Adds an immutable backup creation example. |
Review effort: Balanced
| from azure.cli.command_modules.postgresql.commands import custom_commands | ||
|
|
||
|
|
||
| class FlexibleServerCreateTest(unittest.TestCase): |
|
William (@william051200) JaysonTaiMicrosoft there is a build error that does not seem specific to our changes. Could you please advise how to move forward |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Adding mansoor sarfraz (@msarfraz) to help with |
|
rmendiza Two coverage gaps remain; CI and the immutable-backup scenario are not verified. Paths below are relative to
To addressTick each item as you address it.
Review detailsTest validation
Risk assessment17/100 · Low The Low rating is driven by public CLI behavior.
Ask the Agent Tick a box to queue an action. Requires write access to this repository.
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d30cea2e-7cc9-4e1f-ae2b-119cbc3c08a4
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 34320 in repo Azure/azure-cli |
|
Aditya Pujara (@a0x1ab) can you please re-run the CLI style check? It's failing pre-check. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Aditya Pujara (@a0x1ab) Yong Zhang (@yonzhan) the pipelines appear to be having issues and not completing or getting stuck. Can you please help look into this? |
|
Adding mansoor sarfraz (@msarfraz) to help review |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
53fef3e
into
Azure:dev

🤖 PR Validation —⚠️ Review suggested
Related command
az postgres flexible-server createDescription
Adding a new parameter for the postgresql flexible-server create command to include "Immutable backups"
Testing Guide
Manual
History Notes
[PostgreSQL] Add immutable backup support to flexible-server create
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.