[Redis] Fix #33893: az redis import: Add confirmation prompt matching flush and delete - #33905
[Redis] Fix #33893: az redis import: Add confirmation prompt matching flush and delete#33905Daz (8dazo) wants to merge 3 commits into
az redis import: Add confirmation prompt matching flush and delete#33905Conversation
…atching flush and delete Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi Daz (@8dazo), |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds confirmation prompts for destructive Redis import operations and updates tests/help content to support non-interactive execution.
Changes:
- Require confirmation for
az redis importand the deprecatedaz redis import-methodcommands. - Update scenario tests to pass
-yfor import operations. - Expand help text to warn that import deletes existing cache data and updates examples accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/redis/tests/latest/test_redis_scenario.py | Updates tests to include -y so confirmation prompts don’t block CI/live runs. |
| src/azure-cli/azure/cli/command_modules/redis/commands.py | Enables confirmation behavior for import commands at the command table level. |
| src/azure-cli/azure/cli/command_modules/redis/_help.py | Updates help summaries/examples to reflect destructive import behavior and new -y usage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| g.custom_command('import-method', 'cli_redis_import', confirmation=True, deprecate_info=g.deprecate(redirect='redis import', hide=True)) | ||
| g.custom_command('import', 'cli_redis_import', confirmation=True) |
| helps['redis import'] = """ | ||
| type: command | ||
| short-summary: Import data into a Redis cache. | ||
| short-summary: Import data into a Redis cache. Deletes all preexisting cache data, and the cache is inaccessible to clients during the import. |
| short-summary: Import data into Redis cache. Deletes all preexisting cache data, and the cache is inaccessible to clients during the import. | ||
| long-summary: Usage example - az redis import-method --name testCacheName --resource-group testResourceGroup --files [--file-format] |
|
@microsoft-github-policy-service agree |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Yong Zhang (@yonzhan) could you verify this when you have a chance?
|
|
Adding Qi Pan (@Pan-Qi) to help review this PR |
|
🔔 Routing this PR to @Azure/act-codegen-extensibility-squad. |
Co-authored-by: Cursor <cursoragent@cursor.com>
Related command
az redis import
az redis import-method
az redis flush
az redis delete
Description
Fixes #33893.
az redis importreplaces all cache data and makes the cache unavailable during the operation, but unlikeaz redis flushandaz redis deleteit ran with no confirmation prompt and no--yes.This change uses the same
confirmation=Truepattern already used by flush and delete:--yes/-yskips the promptaz redis import-methodgets the same guard because it sharescli_redis_importNon-interactive scripts that currently call
az redis importwithout-ywill need to pass-y, same as flush and delete.Testing Guide
Local verification (no live cache):
python3 -m py_compileon the three changed files — passflake8oncommands.pyand_help.pyusing repo.flake8— passaz redis delete,az redis flush,az redis import, andaz redis import-methodall registerconfirmation=True-yon import, matching flush/deleteAfter this ships,
--helpshould match the issue repro:Skip the prompt in scripts:
History Notes
[Redis]
az redis import: Add confirmation prompt (--yes) matchingaz redis flushandaz redis deleteThis 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.
Made with Cursor