[CosmosDB] Reclaim the documentdb command namespace#33686
Draft
amatarritamicrosoft wants to merge 1 commit into
Draft
[CosmosDB] Reclaim the documentdb command namespace#33686amatarritamicrosoft wants to merge 1 commit into
amatarritamicrosoft wants to merge 1 commit into
Conversation
Remove the `_documentdb_deprecate` guard (and its EVENT_INVOKER_PRE_PARSE_ARGS registration and now-unused import) from the cosmosdb command module. The guard was added years ago when `az documentdb` was renamed to `az cosmosdb`; it raises `All documentdb commands have been renamed to cosmosdb` on every `az documentdb ...` invocation, before argument parsing. That guidance is now stale: the `documentdb` namespace is needed for the new DocumentDB (Microsoft.DocumentDB/mongoClusters) service. `az cosmosdb` is unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the legacy pre-parse deprecation guard in the cosmosdb command module that previously blocked any az documentdb ... invocation, freeing the documentdb namespace for the new DocumentDB (Microsoft.DocumentDB/mongoClusters) service while leaving az cosmosdb behavior unchanged.
Changes:
- Removed the
_documentdb_deprecatepre-parse handler. - Removed the
EVENT_INVOKER_PRE_PARSE_ARGSevent registration and its import.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
CosmosDB |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reclaim the
documentdbcommand namespace by removing the_documentdb_deprecateguard from the cosmosdb command module (src/azure-cli/azure/cli/command_modules/cosmosdb/__init__.py).Background
Microsoft.DocumentDBwas the original resource provider name for what is now Cosmos DB. Years ago the CLI renamedaz documentdbtoaz cosmosdband added a guard that raisesAll documentdb commands have been renamed to cosmosdbon everyaz documentdb ...invocation (registered onEVENT_INVOKER_PRE_PARSE_ARGS, before argument parsing).That guidance is now stale. The
documentdbnamespace is required for the new DocumentDB (Microsoft.DocumentDB/mongoClusters) service. Because the guard fires before parsing, even a brand-new provider ofaz documentdbcommands is rejected until it is removed.Change
_documentdb_deprecatefunction.cli_ctx.register_event(EVENT_INVOKER_PRE_PARSE_ARGS, ...)registration.from knack.events import EVENT_INVOKER_PRE_PARSE_ARGSimport.Impact
az documentdbis no longer blocked (the namespace is free for the new service).az cosmosdbis unaffected — verifiedaz cosmosdbstill loads andaz cosmosdb createworks end-to-end./cc @necusjz
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com