-
Notifications
You must be signed in to change notification settings - Fork 185
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
Failed to get correct autorest config #9857
base: main
Are you sure you want to change the base?
Conversation
logger.warn(`Don't find autorest configuration in spec PR comment or sdk repository, skip generating codes.`); | ||
logger.warn(`Failed to find autorest configuration in spec PR comment or sdk repository, skip generating codes.`); | ||
logger.warn(`The autorest config file path should be 'sdk/<RP_NAME>-rest/swagger/README.md' in sdk repository, and the autorest config should contain one of the patterns:`); | ||
logger.warn(`- input-file field contains the 'specification/<RP_NAME>/data-plane' in swagger repository.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there're cases where subfolder could exist after data-plane or resource-manager folder https://github.com/Azure/azure-rest-api-specs/blob/main/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/readme.md see this as an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qiaozha , it's a critical issue for sdk automation pipeline v2, could you prioritize the review? we must fix it ASAP.
Looks like the config is messy.
- some sdks has "require" field in swagger/readme.md in sdk repo
- some sdks has "input" field in swagger/readme.md in sk repo
- this one you mention is different, doesn't have above 2 patterns. could you suggest the pattern?
- any more patterns to avoid breaking sdk automation? can we limit the patterns we support? e.g. we only support the first two, if sdk autoamtion due to other patterns, we ask spec PR authors to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why do you even care if it's require or input? That is just how autorest load the input swagger files, it's a codegen implementation detail. What SDK automation should care is the readme.md file location if it's generated from swagger which could exist in either SDK repo or in rest api specs repo.
- if it's in SDK repo, then it must exist in the SDK project folder like sdk/synapse/synapse-access-control-rest/swagger/README.md This is most commonly seeing from the data plane.
- if it's in the rest api specs repo, then it should follow the rest api spec folder guideline https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/directory-structure.md
Any cases that's violating the above two scenarios, should be fixed/reported in the automation.
Please note, the folder structure will change as there's new guideline which will unify the folder structure of both swagger and typespec, mgmt plane and data plane. But I don't think that part of work has started this semester. Please reach out to @mikeharder for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you check line 185, autorest --version=3.9.7 ${path.basename(autorestConfigFilePath)} --output-folder=${packagePath}
, autorest requires autorestConfig.
In case 1, the problem is how to find the swagger/README.md
. From pipeline perspective, it does no know where the swagger/README.md
is, 'cause the input readme file may not contain the info of output location. e.g. https://github.com/Azure/azure-rest-api-specs/blob/master/specification/apicenter/data-plane/readme.md. So the pipeline has to search for the swagger/readme.md
matches the require...
for input...
pattern who indicate the spec is the one the pipeline is generating. If we cannot find it, the pipeline will stop sdk genreration. This is what current pipeline's behavior defined by previous owner.
In case 2, The doc you refer mentions The structure described in this article is recommended. There exist some exceptions for historical reasons. These exceptions are strongly discouraged going forward.
So I'm discussing for cases including historical RPs who does not follow the recommendation.
Any cases that's violating the above two scenarios, should be fixed/reported in the automation.
fix or report? e.g. - from this readme, pipeline cannot locate the swagger/readme.md
in sdk repo.
Bugs:
Test: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4578488&view=logs&j=47092895-c7c8-567a-c7a6-8c88f3ec178e&t=d293a8e8-c6af-5091-cdf7-4c66482dd6f2 (Type
Read temp file azure-sdk-for-js_tmp/generateOutput.json
to check result summay)Issue Fix: JS Automation Tool Fails to Process Multiple Packages #9829