Open konrad-jamrozik opened 10 months ago
I agree this is a bug around error handling, but this is an edge case. Swagger-to-sdk
config in readme is required config to generate SDK.
I will put this bug in my backlog.
I observed that this bug is not triggered if there are no SDKs to generate and there is no AutoRest README diff in the PR. E.g. this PR:
doesn't trigger it.
PR where this issue was first observed
Symptoms
Check is stuck
The following check is stuck on the PR in progress:
ADO pipeline task
SDK / SDK Automation
logs fatal error with$(sdkName)
An example:
ADO pipeline task
Filter SDK / SDK Automation
reports no language SDKs to generateIn ADO pipeline,
Filter SDK / SDK Automation
task does not list any language repositories.An example:
Contrast it with an example working case from PR 26555:
Root-cause
The affected PR did not define in the AutoRest config (
README.md
) any language repository. TheSDK Automation
tooling doesn't gracefully handle this scenario, resulting in the fatal error with$(sdkName)
as mentioned above.You can observe in the PR the following snippet in the README:
If this config would include a line with
azure-sdk-for-*
for one of the supported languages, it would prevent the issue. An example of valid config can be found here, e.g.- repo: azure-sdk-for-js
.Relevant source code
swagger-to-sdk
yaml tag is located withinfindSwaggerToSDKConfiguration
.findSwaggerToSDKConfiguration
is called by workflowFilterSdkMain, which plumbs the information fromswagger-to-sdk
yaml tag to ADO pipeline variables. Notably to theEnabledJobs
variable with property ofsdkName
for each entry.EnabledJobs
variable gets used as input to the matrix strategy inSdkGen
job withinSDKAutomation.yml
.RunSDKAutomation.yml
where it passes$(sdkName)
as value ofSDK_REPO_NAME
.SDK_REPO_NAME
is then used withinschema.ts / SDKAutomationCliConfig
as sdkRepoName / env which is loaded up bycli.ts
for SDK automation and passed tosdkAutoMain
invocation assdkName
.entrypoint.ts / sdkAutoMain
toworkflow.ts / workflow
toworkflowInitConfig
togetSdkRepoConfig
where it throws the fatal error.@raych1 FYI