[dataprotection] Fix duplicate default retention rules for Azure Blob backup policies#9881
[dataprotection] Fix duplicate default retention rules for Azure Blob backup policies#9881IannGeorges wants to merge 3 commits into
Conversation
…etention rule for azure blob operationalstore policies
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Hi @IannGeorges, |
|
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>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
Hi @IannGeorges
|
There was a problem hiding this comment.
Pull request overview
This PR updates the dataprotection extension’s AzureBlob backup policy manifest and policy-editing validation to eliminate the “duplicate Default retention rule” behavior and to enforce a clear mapping between default retention rule names and source datastores (VaultStore vs OperationalStore).
Changes:
- Update the AzureBlob default policy template to ship only the VaultStore
Defaultretention rule, and introduce a manifest mapping that reservesDefault_OperationalStorefor OperationalStore. - Add validation in
backup-policy retention-rule setto prevent cross-store misuse of default rule names and enforce exclusive source store rules for AzureBlob. - Expand/adjust scenario tests and recordings to cover the new AzureBlob retention-rule behaviors and updated vault soft-delete defaults.
Reviewed changes
Copilot reviewed 15 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dataprotection/HISTORY.rst | Updates changelog entry for the behavior change. |
| src/dataprotection/azext_dataprotection/manual/Manifests/AzureBlob.py | Removes pre-seeded OperationalStore default rule; adds default rule mapping + exclusivity metadata. |
| src/dataprotection/azext_dataprotection/manual/helpers.py | Adds validation helpers for default rule ↔ datastore mapping and exclusive source-store enforcement. |
| src/dataprotection/azext_dataprotection/manual/custom.py | Wires new validations into retention-rule set logic and broadens “default rule” detection. |
| src/dataprotection/azext_dataprotection/manual/enums.py | Adds Default_OperationalStore to allowed retention rule names. |
| src/dataprotection/azext_dataprotection/manual/_help.py | Updates CLI help examples/descriptions (currently malformed; needs fixes). |
| src/dataprotection/azext_dataprotection/tests/latest/test_dataprotection_backup_policy.py | Adds extensive AzureBlob retention-rule validation coverage; updates vault soft-delete state in tests. |
| src/dataprotection/azext_dataprotection/tests/latest/test_dataprotection_backup_instance_*.py | Updates test constants/subscription handling and some locations/IDs. |
| src/dataprotection/azext_dataprotection/tests/latest/recordings/*.yaml | Refreshes recordings to reflect new requests/responses and CLI/runtime versions. |
| Upcoming Release | ||
| ++++++++++++++++ |
| @@ -112,14 +112,16 @@ | |||
| helps['dataprotection backup-policy retention-rule set'] = """ | |||
| type: command | |||
| short-summary: Add new retention rule or update existing retention rule. | |||
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.