-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Fixing container service warning and arm-types reference #24044
Fixing container service warning and arm-types reference #24044
Conversation
Hi, @allenjzhang Thanks for your PR. I am workflow bot for review process. Here are some small tips. Any feedback about review process or workflow bot, pls contact swagger and tools team. [email protected] |
Swagger Validation Report
|
Rule | Message |
---|---|
InConsistentSwagger |
"details":"The generated swagger file 2022-09-02-preview/fleets.json from typespec specification/containerservice/Fleet.Management is not the same as the '/mnt/vss/_work/1/azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2022-09-02-preview/fleets.json' in PR, please make sure the swagger is consistent with the generated swagger. You can find the difference in the pipeline log." |
InConsistentSwagger |
"details":"The generated swagger file 2023-03-15-preview/fleets.json from typespec specification/containerservice/Fleet.Management is not the same as the '/mnt/vss/_work/1/azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/fleets.json' in PR, please make sure the swagger is consistent with the generated swagger. You can find the difference in the pipeline log." |
️️✔️
PR Summary succeeded [Detail] [Expand]
Validation passes for Summary.
Swagger pipeline restarted successfully, please wait for status update in this comment. |
Generated ApiView
|
@@ -2,7 +2,9 @@ emit: | |||
- '@azure-tools/typespec-autorest' | |||
options: | |||
'@azure-tools/typespec-autorest': | |||
azure-resource-provider-folder: '{cwd}/../resource-manager' | |||
arm-types-dir: ../../../../../../common-types/resource-management |
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.
Is this necessary? That path looks like a recipe for trouble.
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.
arm-types-dir: ../../../../../../common-types/resource-management | |
arm-types-dir: "{project-root}/../../common-types/resource-management" |
it should be using {project-root}
(not sure I fixed it correctly here)
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.
We should not have a relative path here. We should use a path starting from "{project-root}" https://github.com/Azure/typespec-azure/blob/main/packages/typespec-autorest/src/openapi.ts#L799-L808
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 merged @timotheeguerin suggestion, CI pipeline will tell us if it works.
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.
Does this mean that folks with this reference will not be able to run outside of the specs repo? For the most part we have blocked references outside of the service directory but this will be one which goes outside of it.
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.
nvm, repro'd I copied the wrong tspconfig
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 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.
We can remove this config then as it is defualt value. I will remove it from the template definitely.
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 will create a PR to upgrade the specs repo to use the new autorest emitter (and verify it doesn't regress any specs currently building)
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.
PR to update tools: #24100
Pipeline specs - typespec - ci
is passing, which means no spec in the repo was currently relying on the buggy behavior. So we can either:
- Merge this PR, then 24100, then fix the usage of
{project-root}
in a third PR - Merge 24100, then fix the usage of
{project-root}
in this PR, then merge this PR
@@ -2,7 +2,9 @@ emit: | |||
- '@azure-tools/typespec-autorest' | |||
options: | |||
'@azure-tools/typespec-autorest': | |||
azure-resource-provider-folder: '{cwd}/../resource-manager' | |||
arm-types-dir: ../../../../../../common-types/resource-management |
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.
We should not have a relative path here. We should use a path starting from "{project-root}" https://github.com/Azure/typespec-azure/blob/main/packages/typespec-autorest/src/openapi.ts#L799-L808
Co-authored-by: Timothee Guerin <[email protected]>
…fig.yaml" This reverts commit 6896819.
@timotheeguerin, @markcowl: Think this is ready to merge, given this is the best we can do until https://github.com/Azure/typespec-azure/issues/3024 is fixed? |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
@mikeharder, made a hotfix friday for the project-root issue, waiting on the pr bumping the versions and the hotfix should be usable https://github.com/Azure/typespec-azure/pull/3026 Because technically that bug breaks a bad use, there could be some specs that need updating though so if you prefer to merge this for now with relative ref, I have no issue |
Discussed with Stephane, he will send a PR from his side that incorporate these small changes rather than merging. So closing this. |
Actually, he is not merging into the main and won't have time for now. So let's merge this PR then. Reactivated. |
I think it is best to have |
@markcowl, feel free to remove -1 and merge to unblock Mike. |
I think we need to update the version of autorest in the repo to prevent this PR from breaking the CI pipeline. I'll just add the version update to this PR. |
Sorry I misunderstood. I see the plan is to intentionally use the buggy behavior for |
@mikeharder autorest has been updated with the fix. Version 0.30.1 |
Yep, I will create a separate PR to update the version of autorest in root package.json to 0.30.1. In this PR, we will need to fix any usage of |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
- Setting matches default value
@weshaggard: If you think this is ready to merge, can you approve? I'd like to get this merged soon if there are no other comments. We can always make additional improvements in future PRs. |
Passing build in pipeline
specs - typespec - ci
: https://dev.azure.com/azure-sdk/public/_build/results?buildId=2785861&view=logs&j=9cd39ef8-47c1-5b58-08db-8c3708712f1b&t=462145f3-d740-50de-51e9-126e7c0a29e2TypeSpecValidation is showing an error (even though it reports green status), but this is a bug where TypeSpecValidation can't handle multiple versions of the generated swagger in the repo. It should only be comparing the generated swagger against version 2023-03-15, but it tries to compare against 2022-09-02 instead, which fails.