Skip to content

Conversation

@samsaha-ms
Copy link

@samsaha-ms samsaha-ms commented Jan 16, 2026


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

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

Copilot AI review requested due to automatic review settings January 16, 2026 15:27
@azure-client-tools-bot-prd
Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd
Copy link

Hi @samsaha-ms,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 16, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link

CodeGen Tools Feedback Collection

Thank 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

@github-actions
Copy link

Hi @samsaha-ms

Release Suggestions

Module: redisenterprise

  • Please log updates into to src/redisenterprise/HISTORY.rst
  • Update VERSION to 1.3.1 in src/redisenterprise/setup.py

Notes

Copy link
Contributor

Copilot AI left a 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 RedisEnterpriseUpdate class 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
Copy link

Copilot AI Jan 16, 2026

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
pass


# Testcase: scenario7 - SKU Update Testing for RedisEnterpriseUpdate
Copy link

Copilot AI Jan 16, 2026

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.

Suggested change
# Testcase: scenario7 - SKU Update Testing for RedisEnterpriseUpdate
# Test case: scenario7 - SKU Update Testing for RedisEnterpriseUpdate

Copilot uses AI. Check for mistakes.

# Testcase: scenario7 - SKU Update Testing for RedisEnterpriseUpdate
def call_scenario7(test, rg):
"""Test scenario specifically for SKU update functionality with RedisEnterpriseUpdate class"""
Copy link

Copilot AI Jan 16, 2026

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.

Suggested change
"""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.
"""

Copilot uses AI. Check for mistakes.
Comment on lines +630 to +631
test.check("sku.capacity", None),
test.check("zones", None),
Copy link

Copilot AI Jan 16, 2026

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.

Copilot uses AI. Check for mistakes.
'--port 10000 '
'--resource-group "{rg}"',
checks=checks)
elif test.kwargs.get('sku-update'):
Copy link

Copilot AI Jan 16, 2026

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.

Suggested change
elif test.kwargs.get('sku-update'):
elif test.kwargs.get('sku_update'):

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants