Migrate MongoDB to TypeSpec - #29986
Draft
JiaSeng-v wants to merge 1 commit into
Draft
Conversation
Contributor
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
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 --> |
Member
|
/azp run |
Contributor
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
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.
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.