-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Unset capacity and zones while updating sku from enterprise to azure mananaged redis skus as they don't support the property #9529
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: main
Are you sure you want to change the base?
Conversation
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Hi @samsaha-ms, |
|
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>
|
CodeGen Tools Feedback CollectionThank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey |
|
Hi @samsaha-ms Release SuggestionsModule: redisenterprise
Notes
|
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 adds functionality to handle SKU updates from Enterprise SKUs (like Enterprise_E5) to Azure Managed Redis SKUs (like ComputeOptimized_X5). When updating from Enterprise SKUs to Azure Managed Redis SKUs, the capacity and zones properties must be unset as they are not supported by the new SKU types.
Changes:
- Added
RedisEnterpriseUpdateclass with logic to unset capacity and zones during SKU transitions - Registered the update command in the command table
- Added comprehensive test coverage for SKU update scenarios
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| custom.py | Implements RedisEnterpriseUpdate class with pre_instance_update hook to unset capacity and zones when transitioning from Enterprise to Azure Managed Redis SKUs |
| commands.py | Registers the custom RedisEnterpriseUpdate command in the command table |
| _help.py | Adds help documentation and usage example for the update command |
| test_demo.py | Adds scenario7 test class and test case for SKU update functionality |
| example_steps.py | Adds step_update helper function and creates a new cluster configuration for SKU update testing |
| except (AttributeError, TypeError): | ||
| current_sku = None | ||
|
|
||
| new_sku = str(self.ctx.args.sku) if self.ctx.args.sku is not None else None |
Copilot
AI
Jan 16, 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 condition self.ctx.args.sku is not None can be simplified to just self.ctx.args.sku since the result is already being converted to a string or None. However, if self.ctx.args.sku could be an empty string or other falsy value that should still be converted to a string, the current form is correct.
| new_sku = str(self.ctx.args.sku) if self.ctx.args.sku is not None else None | |
| new_sku = str(self.ctx.args.sku) if self.ctx.args.sku else None |
| pass | ||
|
|
||
|
|
||
| # Testcase: scenario7 - SKU Update Testing for RedisEnterpriseUpdate |
Copilot
AI
Jan 16, 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 comment uses 'Testcase' (one word) while other test scenarios in the file use 'Testcase:' format. Consider checking consistency with other scenario comments in the file for uniformity.
| # Testcase: scenario7 - SKU Update Testing for RedisEnterpriseUpdate | |
| # Test case: scenario7 - SKU Update Testing for RedisEnterpriseUpdate |
|
|
||
| # Testcase: scenario7 - SKU Update Testing for RedisEnterpriseUpdate | ||
| def call_scenario7(test, rg): | ||
| """Test scenario specifically for SKU update functionality with RedisEnterpriseUpdate class""" |
Copilot
AI
Jan 16, 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 docstring should provide more context about what is being tested. Consider mentioning that this test verifies capacity and zones are properly unset when transitioning from Enterprise SKUs to Azure Managed Redis SKUs.
| """Test scenario specifically for SKU update functionality with RedisEnterpriseUpdate class""" | |
| """Test SKU update behavior for RedisEnterpriseUpdate. | |
| This scenario verifies that when transitioning from Enterprise SKUs to Azure Managed | |
| Redis SKUs, the cluster's capacity and availability zones are properly unset | |
| (i.e., reported as null) while the cluster remains in a healthy, running state. | |
| """ |
| test.check("sku.capacity", None), | ||
| test.check("zones", None), |
Copilot
AI
Jan 16, 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 test checks that capacity and zones are None after creating with Balanced_B5 SKU, but it would be more comprehensive to first verify these properties have expected values with an Enterprise SKU before the update. Consider adding a test that creates with an Enterprise SKU first, verifies capacity and zones are set, then updates to a Managed Redis SKU and verifies they are unset.
| '--port 10000 ' | ||
| '--resource-group "{rg}"', | ||
| checks=checks) | ||
| elif test.kwargs.get('sku-update'): |
Copilot
AI
Jan 16, 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 key 'sku-update' uses a hyphen, which is inconsistent with Python naming conventions where underscores are preferred (e.g., 'sku_update'). While this works in a dictionary, using underscores would be more consistent with Python style.
| elif test.kwargs.get('sku-update'): | |
| elif test.kwargs.get('sku_update'): |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
If existing sku is one of enterprise sku like Enterprise_E5 and we want to update to any allowed Azure Managed Redis Sku
az redisenterprise update --name --resource-group --sku ComputeOptimized_X
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.