feat(mongo-db): add project and cluster commands with tests - #10170
Conversation
- Generated CLI commands for projects and clusters (2026-03-01-preview)
- Added happy-path tests: create, list, show for projects and clusters
- Added 405 MethodNotAllowed assertions for project/cluster delete
- Fixed project create to send {"properties": {}} in request body
- Updated organization commands to 2026-03-01-preview API version
|
Hi @sharmaanuj334, |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR expands the mongo-db extension’s MongoDB Atlas surface area by adding AAZ-generated management-plane commands for Organization Projects and Project Clusters, updating the extension version/changelog, and extending scenario tests to cover the new command paths.
Changes:
- Added
az mongo-db atlas organization projectandaz mongo-db atlas organization project clustercommand groups (create/show/list/delete/update/wait) generated from2026-03-01-previewAPIs. - Updated extension metadata/versioning (setup.py, azext metadata min core, HISTORY entry).
- Updated live/playback scenario test to exercise org → project → cluster flows (needs fixes to be CI-safe and aligned with “CRUD”).
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mongo-db/setup.py | Bumps extension version to 1.1.0b1. |
| src/mongo-db/HISTORY.rst | Adds changelog entry for project/cluster commands. |
| src/mongo-db/azext_mongo_db/tests/latest/test_mongo_db.py | Extends scenario coverage to projects/clusters (currently includes hard-coded/PII data and delete-behavior mismatch). |
| src/mongo-db/azext_mongo_db/azext_metadata.json | Raises min CLI core requirement to 2.75.0. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/cluster/_create.py | Adds cluster create command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/cluster/_delete.py | Adds cluster delete command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/cluster/_list.py | Adds cluster list-by-project command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/cluster/_show.py | Adds cluster show command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/cluster/_update.py | Adds cluster update command implementation (generic update enabled). |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/cluster/_wait.py | Adds cluster wait command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/cluster/__cmd_group.py | Registers the ... project cluster command group. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/cluster/init.py | Exports cluster command group/commands. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/_create.py | Adds project create command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/_delete.py | Adds project delete command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/_list.py | Adds project list-by-organization command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/_show.py | Adds project show command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/_update.py | Adds project update command implementation (generic update enabled). |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/_wait.py | Adds project wait command implementation. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/_cluster_tier_region.py | Adds “cluster-tier-region” helper command under project. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/_tier_limit_reached.py | Adds “tier-limit-reached” helper command under project. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/__cmd_group.py | Registers the ... organization project command group. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/project/init.py | Exports project command group/commands. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/_create.py | Updates org create to 2026-03-01-preview and refreshes help/examples. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/_delete.py | Updates org delete to 2026-03-01-preview and refreshes help/examples. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/_list.py | Updates org list to 2026-03-01-preview and refreshes help/examples. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/_show.py | Updates org show to 2026-03-01-preview and refreshes help/examples. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/_wait.py | Updates org wait to 2026-03-01-preview. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/organization/__cmd_group.py | Updates org command-group help text. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/atlas/__cmd_group.py | Updates atlas command-group help text. |
| src/mongo-db/azext_mongo_db/aaz/latest/mongo_db/__cmd_group.py | Updates top-level mongo-db command-group help text. |
| @AllowLargeResponse(size_kb=10240) | ||
| @ResourceGroupPreparer(name_prefix='cli_test_mongodb', location="eastus2") | ||
| def test_mongo_db(self, resource_group): | ||
| def test_mongo_db(self): | ||
| self.kwargs.update({ | ||
| 'name': 'MongoDBCLITestOrg2', | ||
| 'location': 'eastus2', | ||
| 'subscription': '00000000-0000-0000-0000-000000000000', | ||
| 'marketplace_subscription_id': '00000000-0000-0000-0000-000000000000', | ||
| 'publisher_id': 'mongodb', | ||
| 'offer_id': 'mongodb_atlas_azure_native_prod', | ||
| 'plan_id': 'private_plan', | ||
| 'plan_name': 'Pay as You Go (Free) (Private)', | ||
| 'term_unit': 'P1M', | ||
| 'term_id': 'gmz7xq9ge3py', | ||
| 'user_first_name': 'dummy', | ||
| 'user_last_name': 'dummy', | ||
| 'user_email': 'test@example.com', | ||
| 'organization-name': 'MongoDBCLITestOrg2', | ||
| 'resource_group': 'cli-test-rg' | ||
| 'name': 'greenTestsRun', | ||
| 'resource_group': 'sharmaanuTest', |
| _args_schema.cluster_tier = AAZStrArg( | ||
| options=["--cluster-tier"], | ||
| arg_group="Properties", | ||
| help="Cluster tier (FREE, FLEX, M10, M30).", | ||
| enum={"FLEX": "FLEX", "FREE": "FREE", "M10": "M10", "M30": "M30"}, | ||
| ) |
| _args_schema.region_name = AAZStrArg( | ||
| options=["--region-name"], | ||
| arg_group="Properties", | ||
| help="Azure region where the cluster is deployed.", | ||
| ) |
|
mongo-db |
|
Hi @sharmaanuj334 can you please help provide link of |
|
|
[Release] Update index.json for extension [ mongo-db-1.1.0b1 ] : https://dev.azure.com/msazure/One/_build/results?buildId=175188610&view=results |
🤖 PR Validation —⚠️ Review suggested
Description
Add project and cluster CRUD commands to the
mongo-dbextension underaz mongo-db atlas organization projectandaz mongo-db atlas organization project cluster.Changes
Testing
Related