Skip to content
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

azure-sdk-for-go check failing on PR in azure-rest-api-specs-pr repo #1465

Closed
JacomusP opened this issue Nov 11, 2024 · 8 comments
Closed

azure-sdk-for-go check failing on PR in azure-rest-api-specs-pr repo #1465

JacomusP opened this issue Nov 11, 2024 · 8 comments
Assignees

Comments

@JacomusP
Copy link
Member

Hello I have been working on an API spec for an azure resource provider and I noticed today that the azure-sdk-for-go check was failing today when it had previously been successful on my PR. I did make some changes in the tspconfig.yaml file but that was just to adjust what the package name should be. The PR is here and in the check failure message it said that this was a bug and that I should open an issue. Can someone take a look and see if I configured something wrong and if that is what is causing the failure? The error is below and I will also add that I ran autorest locally and it generated the go files without any issues.

command	sh ./eng/scripts/automation_init.sh ../../../../../azure-sdk-for-go-pr_tmp/initInput.json ../../../../../azure-sdk-for-go-pr_tmp/initOutput.json
command	generator automation-v2 ../../../../../azure-sdk-for-go-pr_tmp/generateInput.json ../../../../../azure-sdk-for-go-pr_tmp/generateOutput.json
cmdout	[Go] Start to process typespec project: specification/falcon/Falcon.Management
cmdout	[Go] Start to use template to generate new rp folder and basic package files...
cmdout	[Go] Start to run `tsp-client init` to generate the code...
cmderr	[Go] [ERROR] total 1 error(s):
cmderr	[Go] [ERROR] failed to execute `tsp-client init --tsp-config /mnt/vss/_work/1/s/azure-rest-api-specs-pr/specification/falcon/Falcon.Management/tspconfig.yaml --commit 61f6676d95e1d51ca987bac84942e4b840e25c8a --repo Azure/azure-rest-api-specs-pr --local-spec-repo /mnt/vss/_work/1/s/azure-rest-api-specs-pr/specification/falcon/Falcon.Management --emitter-options module-version=0.1.0 --debug`
cmderr	[Go] [ERROR] ExternalError: Emitter "@azure-tools/typespec-go" crashed! This is a bug.
cmderr	[Go] [ERROR] Please file an issue at https://github.com/Azure/autorest.go/issues
cmderr	[Go] [ERROR] TypeError: Cannot read properties of undefined (reading 'flatMap')
cmderr	[Go] [ERROR] at resolvePathAndParameters (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/node_modules/@typespec/http/src/route.ts:78:32)
cmderr	[Go] [ERROR] at getHttpOperationInternal (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/node_modules/@typespec/http/src/operations.ts:217:5)
cmderr	[Go] [ERROR] at getHttpOperation (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/node_modules/@typespec/http/src/operations.ts:41:10)
cmderr	[Go] [ERROR] at getHttpOperationWithCache (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/node_modules/@azure-tools/typespec-client-generator-core/src/public-utils.ts:613:43)
cmderr	[Go] [ERROR] at updateTypesFromOperation (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/node_modules/@azure-tools/typespec-client-generator-core/src/types.ts:1520:25)
cmderr	[Go] [ERROR] at getAllModelsWithDiagnostics (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/node_modules/@azure-tools/typespec-client-generator-core/src/types.ts:1771:26)
cmderr	[Go] [ERROR] at getSdkPackage (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/node_modules/@azure-tools/typespec-client-generator-core/src/package.ts:568:43)
cmderr	[Go] [ERROR] at Module.createSdkContext (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/node_modules/@azure-tools/typespec-client-generator-core/src/decorators.ts:649:44)
cmderr	[Go] [ERROR] at tcgcToGoCodeModel (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/src/tcgcadapter/adapter.ts:25:33)
cmderr	[Go] [ERROR] at Object.$onEmit [as emitFunction] (file:///mnt/vss/_work/1/s/azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/falcon/armfalcon/TempTypeSpecFiles/node_modules/@azure-tools/typespec-go/src/emitter.ts:27:27)
cmderr	[Go] [ERROR] --------------------------------------------------
cmderr	[Go] [ERROR] Library Version                0.3.0
cmderr	[Go] [ERROR] TypeSpec Compiler Version      0.62.0
cmderr	[Go] [ERROR] --------------------------------------------------
cmderr	[Go] [ERROR] Refer to the detail errors for potential fixes.
cmderr	[Go] [ERROR] If the issue persists, contact the Go language support channel at https://aka.ms/azsdk/go-lang-teams-channel and include this spec pull request.
error	Script return with result [failed] code [1] signal [null] cwd [azure-sdk-for-go-pr/src/github.com/Azure/azure-sdk-for-go]: generator automation-v2
warn	Warning: File azure-sdk-for-go-pr_tmp/generateOutput.json not found to read. Please re-run the pipeline if the error is transitient error or report this issue through https://aka.ms/azsdk/support/specreview-channel.
warn	Warning: Package processing is skipped as the SDK generation fails. Please look into the above generation errors or report this issue through https://aka.ms/azsdk/support/specreview-channel.
@jhendrixMSFT
Copy link
Member

I believe this will be fixed by Azure/azure-sdk-for-go#23720

@JacomusP
Copy link
Member Author

I will restart the check and update here

@jhendrixMSFT
Copy link
Member

The change was just merged.

@tadelesh
Copy link
Member

close since it should be resolved. but it may take time for pipeline to sync azure-sdk-for-go to azure-sdk-for-go-pr.

@JacomusP
Copy link
Member Author

@jhendrixMSFT & @tadelesh It is now failing with this message:

[Go] [ERROR] total 1 error(s):
cmderr	[Go] [ERROR] failed to execute `tsp-client init --tsp-config /mnt/vss/_work/1/s/azure-rest-api-specs-pr/specification/falcon/Falcon.Management/tspconfig.yaml --commit 807298f0e60335a2d91847e8aa43d86fc9bbb25f --repo Azure/azure-rest-api-specs-pr --local-spec-repo /mnt/vss/_work/1/s/azure-rest-api-specs-pr/specification/falcon/Falcon.Management --emitter-options module-version=0.1.0 --debug`
cmderr	[Go] [ERROR] Diagnostics were reported during compilation. Use the `--debug` flag to see the diagnostic output.
cmderr	[Go] [ERROR] Refer to the detail errors for potential fixes.
cmderr	[Go] [ERROR] If the issue persists, contact the Go language support channel at https://aka.ms/azsdk/go-lang-teams-channel and include this spec pull request.

Which is even less information than before.

@jhendrixMSFT jhendrixMSFT reopened this Nov 13, 2024
@JacomusP
Copy link
Member Author

Also let me know if I can provide any more information.

@jhendrixMSFT
Copy link
Member

jhendrixMSFT commented Nov 13, 2024

@tadelesh I'm going to guess that this is because the --module switch is missing (I only see module-version).

@tadelesh
Copy link
Member

no. it is from a bug in tool. as i mentioned, it needs time to sync the fix from sdk repo to sdk-pr repo. so, after i rerun the ci and go automation pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants