Skip to content

Add new cmdlets for AzureDataTransfer #27926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 66 commits into
base: main
Choose a base branch
from

Conversation

fzkhan
Copy link
Member

@fzkhan fzkhan commented Jun 11, 2025

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

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@vidai-msft
Copy link
Contributor

@fzkhan Please upload the generate-info.json file to fix the build issue.

Copy link

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

@fzkhan
Copy link
Member Author

fzkhan commented Jun 12, 2025

@vidai-msft I was following this wiki to generate the cmdlets and it did not output a generate-info.json for me. Is that something I have to add manually?

On the same note, I see a comment in the wiki that says:

Note: If the entire module (src/ServiceName) is new, regardless new onboard or rebrand, add tools/CreateMappings_rules.json in commit.

Is that also a file we have to add manually? So far, the only file I have added on my own is the ChangeLog.md

@vidai-msft
Copy link
Contributor

@vidai-msft I was following this wiki to generate the cmdlets and it did not output a generate-info.json for me. Is that something I have to add manually?

On the same note, I see a comment in the wiki that says:

Note: If the entire module (src/ServiceName) is new, regardless new onboard or rebrand, add tools/CreateMappings_rules.json in commit.

Is that also a file we have to add manually? So far, the only file I have added on my own is the ChangeLog.md

The generate-info.json is generated by running build-module.ps1. If you do not see the file, please upgrade your autorest.powershell version to get the new feature.

@fzkhan
Copy link
Member Author

fzkhan commented Jun 12, 2025

@vidai-msft

root@fdf770018985:/src/AzureDataTransfer/AzureDataTransfer.Autorest# npm list -g @autorest/powershell
/root/.nvm/versions/node/v18.20.4/lib
└── @autorest/[email protected]

I updated to the latest version. But still not getting any additional files. Here is the autorest README.md output (I ran autorest --reset before this to clear the cache):

AutoRest code generation utility [cli version: 3.7.1; node: v18.20.4]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest

There is a new version of AutoRest available (3.7.2).
 > You can install the newer version with with npm install -g autorest@latest

installing core... [========================================] 100% | 2/2
info    |    Loading AutoRest core      '/root/.autorest/@[email protected]/nodemodules/@autorest/core/dist' (3.10.7)
info    | 
The default version of @autorest/powershell has been bumped from 3.0+ to 4.0+.
 > If you still want to use 3.0+ version, please specify it with --use:@autorest/[email protected].{x}, e.g 3.0.512.

info    |    Installing AutoRest extension '@autorest/powershell' (4.x -> 4.0.741)
installing... [========================================] 100% | 122/122
info    |    Installed AutoRest extension '@autorest/powershell' (4.x->4.0.741)
info    |    Installing AutoRest extension '@autorest/modelerfour' (~4.26.0 -> 4.26.2)
installing... [========================================] 100% | 2/2
info    |    Installed AutoRest extension '@autorest/modelerfour' (~4.26.0->4.26.2)
warning | PreCheck/CheckDuplicateSchemas | Checking for duplicate schemas, this could take a (long) while.  Run with --verbose for more detail.
warning | UsingTemporaryFlag | modelerfour.treat-type-object-as-anything options is a temporary flag. It WILL be removed in the future.
warning | Modeler/MissingType | The schema 'components·ehmgd1·schemas·readpipelineconnection·additionalproperties' has no type or format information whatsoever. Location:
   https://github.com/Azure/azure-rest-api-specs/blob/c424d91129a85194f3a0800a6bb5dcd28f8eb6eb/specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/stable/2025-05-21/azuredatatransfer.json#/components/schemas/components·ehmgd1·schemas·readpipelineconnection·additionalproperties
warning | Modeler/MissingType | The schema 'components·zh5y8p·schemas·readreadpipelineconnectionproperties·additionalproperties' has no type or format information whatsoever. Location:
   https://github.com/Azure/azure-rest-api-specs/blob/c424d91129a85194f3a0800a6bb5dcd28f8eb6eb/specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/stable/2025-05-21/azuredatatransfer.json#/components/schemas/components·zh5y8p·schemas·readreadpipelineconnectionproperties·additionalproperties
warning | Modeler/MissingType | The schema 'components·11tlp8x·schemas·readreadinternalmetadataproperties·additionalproperties' has no type or format information whatsoever. Location:
   https://github.com/Azure/azure-rest-api-specs/blob/c424d91129a85194f3a0800a6bb5dcd28f8eb6eb/specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/stable/2025-05-21/azuredatatransfer.json#/components/schemas/components·11tlp8x·schemas·readreadinternalmetadataproperties·additionalproperties
info    | Autorest completed in 38.8s. 576 files generated.

Ran pwsh ./build-module.ps1 afterwards, but no luck.

@vidai-msft
Copy link
Contributor

Can you share the detailed steps?

@vidai-msft
Copy link
Contributor

@fzkhan Per our naming convention, the module should be DataTransfer instead of AzureDataTransfer. Could you please help update the module name and the corresponding folder name? cc @Alex-wdy

@fzkhan
Copy link
Member Author

fzkhan commented Jun 15, 2025

@vidai-msft I have renamed it to DataTransfer. But:

  • I still don't see the file you mentioned. Here is the exact list of steps I went through:
docker run -it -v Z:\Repos\azure-powershell\src:/src autorest
cd DataTransfer/DataTransfer.Autorest
autorest --reset
autorest README.md
pwsh ./build-module.ps1
pwsh ./run-module.ps1
  • I cannot run tests now as I am facing the same error as mentioned in these two threads (thread 1, thread 2). I am not using a local swagger, and I am running this command after running all of the commands I mentioned above: pwsh ./test-module.ps1 -Live
    Error for reference:
PS /src/DataTransfer/DataTransfer.Autorest [Az.DataTransfer]> pwsh ./test-module.ps1 -Live
Creating isolated process...
Installing local Pester module into '/src/DataTransfer/DataTransfer.Autorest/generated/modules'...
Get-Item: /src/DataTransfer/DataTransfer.Autorest/test-module.ps1:44
Line |
  44 |  … ModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resourc …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path '/root/.PSSharedModules/Resources/Az.Resources.TestSupport.psd1' because it does not exist.

@fzkhan
Copy link
Member Author

fzkhan commented Jun 16, 2025

@vidai-msft Able to get around the testing failure now. Please let me know how to generate the file as I still am not able to get the commands to output it.

@vidai-msft
Copy link
Contributor

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

@fzkhan
Copy link
Member Author

fzkhan commented Jun 17, 2025

Formatting of examples is not correct and output is missing:

image

@vidai-msft
Copy link
Contributor

Formatting of examples is not correct and output is missing:

image

@fzkhan Where did you see the output? From PowerShell console or markdown file?

@fzkhan
Copy link
Member Author

fzkhan commented Jun 17, 2025

@vidai-msft This is from the PS window after running ./run-module.ps1 :

image

@vidai-msft
Copy link
Contributor

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@vidai-msft
Copy link
Contributor

/azp run

Copy link
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants