Skip to content

Migrate MongoDB to TypeSpec - #29986

Draft
JiaSeng-v wants to merge 1 commit into
Azure:mainfrom
JiaSeng-v:jiaseng/main/typespec-MongoDB
Draft

Migrate MongoDB to TypeSpec#29986
JiaSeng-v wants to merge 1 commit into
Azure:mainfrom
JiaSeng-v:jiaseng/main/typespec-MongoDB

Conversation

@JiaSeng-v

Copy link
Copy Markdown
Contributor

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI lite review requested due to automatic review settings August 11, 2026 02:08
@JiaSeng-v JiaSeng-v added the TypeSpec Module generated from TypeSpec label Aug 11, 2026
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 migrates the MongoDB PowerShell module’s code-generation inputs toward TypeSpec by adding TypeSpec emitter configuration and updating the generated/packaged artifacts and documentation accordingly.

Changes:

  • Added TypeSpec configuration (tspconfig.yaml, tsp-location.yaml) to drive MongoDB module generation.
  • Updated module packaging metadata (manifest/solution) and refreshed generated docs/readmes.
  • Removed the legacy AutoRest configuration block from the module README.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/MongoDB/MongoDB/help/Get-AzMongoDBOrganization.md Updated reference help; parameter-set names were adjusted.
src/MongoDB/MongoDB/ChangeLog.md Added an Upcoming Release note for the change.
src/MongoDB/MongoDB/Az.MongoDB.psd1 Refreshed generated manifest formatting and metadata.
src/MongoDB/MongoDB.sln Updated the Az.MongoDB project GUID wiring in the solution.
src/MongoDB/MongoDB.Autorest/tspconfig.yaml New TypeSpec PowerShell emitter configuration for MongoDB.
src/MongoDB/MongoDB.Autorest/tsp-location.yaml New pinned API spec repo/commit/directory configuration.
src/MongoDB/MongoDB.Autorest/test/README.md Adjusted test folder documentation text.
src/MongoDB/MongoDB.Autorest/resources/README.md Adjusted resources folder documentation text.
src/MongoDB/MongoDB.Autorest/README.md Removed the legacy AutoRest configuration section.
src/MongoDB/MongoDB.Autorest/Properties/AssemblyInfo.cs Refreshed assembly metadata and file header.
src/MongoDB/MongoDB.Autorest/generate-info.json Updated generation identifier.
src/MongoDB/MongoDB.Autorest/docs/README.md Adjusted docs folder guidance text.
src/MongoDB/MongoDB.Autorest/docs/Limit-AzMongoDBProject.md Updated example output in generated docs.
src/MongoDB/MongoDB.Autorest/docs/Get-AzMongoDBOrganization.md Updated cmdlet reference doc; parameter-set names were adjusted.
src/MongoDB/MongoDB.Autorest/docs/Az.MongoDB.md Updated module doc header metadata and description text.
src/MongoDB/MongoDB.Autorest/custom/README.md Adjusted custom folder documentation/link text.
Suppressed comments (5)

src/MongoDB/MongoDB/help/Get-AzMongoDBOrganization.md:27

  • This parameter set header should be "List1" because this syntax includes the mandatory -ResourceGroupName parameter (the generated cmdlet uses ParameterSetName='List1' for resource-group listing).
### List

src/MongoDB/MongoDB/help/Get-AzMongoDBOrganization.md:160

  • The -ResourceGroupName parameter is documented as belonging to parameter sets "Get, List", but the generated cmdlet binds it to "Get, List1" (resource-group listing). This mismatch can confuse users when reading parameter set restrictions.
```yaml

src/MongoDB/MongoDB.Autorest/docs/Get-AzMongoDBOrganization.md:31

  • This SYNTAX header should be "List1" because this syntax requires -ResourceGroupName and maps to the resource-group listing parameter set.
### List

src/MongoDB/MongoDB.Autorest/docs/Get-AzMongoDBOrganization.md:162

  • -ResourceGroupName is documented as being in "Get, List" parameter sets, but it is mandatory for the resource-group listing set (List1). The parameter set list should match the cmdlet binding.
    src/MongoDB/MongoDB.Autorest/docs/README.md:11
  • This paragraph uses backslash paths ("..\exports", "..\custom", "..\examples"). In Markdown and on GitHub these should use forward slashes to avoid broken links and confusing copy/paste.
The process of documentation generation loads `Az.MongoDB` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

## SYNTAX

### List (Default)
### List1 (Default)
## SYNTAX

### List (Default)
### List1 (Default)
@@ -1,5 +1,5 @@
# Test
This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets.
This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets.
@@ -1,5 +1,5 @@
# Resources
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder.
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder.
@@ -1,5 +1,5 @@
# Docs
This directory contains the documentation of the cmdlets for the `Az.MongoDB` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder.
This directory contains the documentation of the cmdlets for the `Az.MongoDB` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder.
---
Module Name: Az.MongoDB
Module Guid: accceef6-8113-453a-a31c-4f2ce57893d6
Module Guid: be93c60e-9173-45d4-acf9-f37265c84e3c
Comment on lines 1 to 5
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");
emitter-output-dir: "{output-dir}/{service-dir}/MongoDB/MongoDB.Autorest"
clear-output-folder: true
azure: true
module-version: 1.0.0
- Additional information about change #1
-->
## Upcoming Release
* Internal code generation updated. No user-facing changes in this release.
Comment on lines 22 to 24
## Development
For information on how to develop for `Az.MongoDB`, see [how-to.md](how-to.md).
<!-- endregion -->
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TypeSpec Module generated from TypeSpec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants