-
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
[policyinsights] Fix next_link #15165
Conversation
Hi, @msyyc 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. vsswagger@microsoft.com |
[Call for Action] To better understand Azure service dev/test scenario, and support Azure service developer better on Swagger and REST API related tests in early phase, please help to fill in with this survey https://aka.ms/SurveyForEarlyPhase. It will take 5 to 10 minutes. If you already complete survey, please neglect this comment. Thanks. |
Swagger Validation Report
|
Rule | Message |
---|---|
Runtime Exception |
"new":"https://github.com/Azure/azure-rest-api-specs/blob/e4344ba4d12f457486b9f3ca8229fc0da7496fc4/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01", "old":"https://github.com/Azure/azure-rest-api-specs/blob/master/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01", "details":"Command failed: node /home/vsts/work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/@azure/oad@0.8.11/node_modules/autorest/dist/app.js /tmp/readme.oad.new.md --tag=oad-default-tag --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=new --output-folder=/tmp\nERROR: Schema violation: Additional properties not allowed: nextLink?Next paging op for policy events\n - file:///home/vsts/work/1/azure-rest-api-specs/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2019-10-01/policyEvents.json:636:2 ($["x-ms-paths"])\nFATAL: swagger-document/individual/schema-validator - FAILED\nFATAL: Error: [OperationAbortedException] Error occurred. Exiting.\nProcess() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.\n" |
️⚠️
LintDiff: 0 Warnings warning [Detail]
- Linted configuring files (Based on source branch, openapi-validator v1.10.0 , classic-openapi-validator v1.1.8 )
- Linted configuring files (Based on target branch, openapi-validator v1.10.0 , classic-openapi-validator v1.1.8 )
Only 10 items are listed, please refer to log for more details.
Rule | Message |
---|---|
R4013 - IntegerTypeMustHaveFormat |
The integer type does not have a format, please add it. Location: Microsoft.PolicyInsights/stable/2019-07-01/remediations.json#L1233 |
R4013 - IntegerTypeMustHaveFormat |
The integer type does not have a format, please add it. Location: Microsoft.PolicyInsights/stable/2019-07-01/remediations.json#L1238 |
R4013 - IntegerTypeMustHaveFormat |
The integer type does not have a format, please add it. Location: Microsoft.PolicyInsights/stable/2019-07-01/remediations.json#L1243 |
R4013 - IntegerTypeMustHaveFormat |
The integer type does not have a format, please add it. Location: Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json#L1483 |
R4013 - IntegerTypeMustHaveFormat |
The integer type does not have a format, please add it. Location: Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json#L1483 |
R4018 - OperationsApiResponseSchema |
The response schema of operations API '/providers/Microsoft.PolicyInsights/operations' does not match the ARM specification. Please standardize the schema. Location: Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json#L1135 |
R4037 - MissingTypeObject |
The schema 'PolicyTrackedResourcesQueryResults' is considered an object but without a 'type:object', please add the missing 'type:object'. Location: Microsoft.PolicyInsights/preview/2018-07-01-preview/policyTrackedResources.json#L233 |
R4037 - MissingTypeObject |
The schema 'QueryFailure' is considered an object but without a 'type:object', please add the missing 'type:object'. Location: Microsoft.PolicyInsights/preview/2018-07-01-preview/policyTrackedResources.json#L341 |
R4037 - MissingTypeObject |
The schema 'error' is considered an object but without a 'type:object', please add the missing 'type:object'. Location: Microsoft.PolicyInsights/preview/2018-07-01-preview/policyTrackedResources.json#L344 |
R4037 - MissingTypeObject |
The schema 'RemediationListResult' is considered an object but without a 'type:object', please add the missing 'type:object'. Location: Microsoft.PolicyInsights/stable/2019-07-01/remediations.json#L1054 |
️⚠️
Avocado: 1 Warnings warning [Detail]
Rule | Message |
---|---|
The default tag contains multiple API versions swaggers. readme: specification/policyinsights/resource-manager/readme.md tag: specification/policyinsights/resource-manager/readme.md#tag-package-2021-01 |
️❌
ModelValidation: 2 Errors, 0 Warnings failed [Detail]
Rule | Message |
---|---|
MISSING_REQUIRED_PARAMETER |
Value is required but was not provided |
MISSING_REQUIRED_PARAMETER |
Value is required but was not provided |
️❌
SemanticValidation: 2 Errors, 0 Warnings failed [Detail]
Rule | Message |
---|---|
OBJECT_ADDITIONAL_PROPERTIES |
Additional properties not allowed: {nextLink}?Next paging op for policy events JsonUrl: Microsoft.PolicyInsights/stable/2019-10-01/policyEvents.json#L32 |
OBJECT_ADDITIONAL_PROPERTIES |
Additional properties not allowed: {nextLink}?Next paging op for policy states JsonUrl: Microsoft.PolicyInsights/stable/2019-10-01/policyStates.json#L32 |
️️✔️
Cross-Version Breaking Changes succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️
CredScan succeeded [Detail] [Expand]
There is no credential detected.
️❌
[Staging] SDK Track2 Validation: 6 Errors, 5 Warnings failed [Detail]
- The following tags are being changed in this PR
Only 10 items are listed, please refer to log for more details.
Rule | Message |
---|---|
PreCheck/DuplicateSchema |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2021-01", "details":"Duplicate Schema named ErrorResponse -- properties.error.$ref: undefined => "#/components/schemas/schemas:292" ; This error can be temporarily avoided by using the 'modelerfour.lenient-model-deduplication' setting. NOTE: This setting will be removed in a future version of @autorest/modelerfour; schemas should be updated to fix this issue sooner than that." |
PreCheck/DuplicateSchema |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2021-01", "details":"Duplicate Schema named ErrorDefinition -- properties.details.$ref: undefined => "#/components/schemas/schemas:296" ; This error can be temporarily avoided by using the 'modelerfour.lenient-model-deduplication' setting. NOTE: This setting will be removed in a future version of @autorest/modelerfour; schemas should be updated to fix this issue sooner than that." |
PreCheck/DuplicateSchema |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2020-07", "details":"Duplicate Schema named ErrorResponse -- properties.error.$ref: undefined => "#/components/schemas/schemas:292" ; This error can be temporarily avoided by using the 'modelerfour.lenient-model-deduplication' setting. NOTE: This setting will be removed in a future version of @autorest/modelerfour; schemas should be updated to fix this issue sooner than that." |
PreCheck/DuplicateSchema |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2020-07", "details":"Duplicate Schema named ErrorDefinition -- properties.details.$ref: undefined => "#/components/schemas/schemas:296" ; This error can be temporarily avoided by using the 'modelerfour.lenient-model-deduplication' setting. NOTE: This setting will be removed in a future version of @autorest/modelerfour; schemas should be updated to fix this issue sooner than that." |
PreCheck/DuplicateSchema |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2019-10", "details":"Duplicate Schema named ErrorResponse -- properties.error.$ref: undefined => "#/components/schemas/schemas:292" ; This error can be temporarily avoided by using the 'modelerfour.lenient-model-deduplication' setting. NOTE: This setting will be removed in a future version of @autorest/modelerfour; schemas should be updated to fix this issue sooner than that." |
PreCheck/DuplicateSchema |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2019-10", "details":"Duplicate Schema named ErrorDefinition -- properties.details.$ref: undefined => "#/components/schemas/schemas:296" ; This error can be temporarily avoided by using the 'modelerfour.lenient-model-deduplication' setting. NOTE: This setting will be removed in a future version of @autorest/modelerfour; schemas should be updated to fix this issue sooner than that." |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2018-07", "details":"The schema 'TypedErrorInfo-info' has no type or format information whatsoever. Location:\n file:///home/vsts/work/1/azure-rest-api-specs/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/remediations.json#/components/schemas/TypedErrorInfo-info" |
|
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2018-07", "details":"The schema 'components·1twbxlw·schemas·policyevent·additionalproperties' has no type or format information whatsoever. Location:\n file:///home/vsts/work/1/azure-rest-api-specs/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyEvents.json#/components/schemas/components·1twbxlw·schemas·policyevent·additionalproperties" |
|
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2018-07", "details":"The schema 'components·1yhb3ub·schemas·policystate·additionalproperties' has no type or format information whatsoever. Location:\n file:///home/vsts/work/1/azure-rest-api-specs/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json#/components/schemas/components·1yhb3ub·schemas·policystate·additionalproperties" |
|
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2018-04", "details":"The schema 'components·1twbxlw·schemas·policyevent·additionalproperties' has no type or format information whatsoever. Location:\n file:///home/vsts/work/1/azure-rest-api-specs/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2018-04-04/policyEvents.json#/components/schemas/components·1twbxlw·schemas·policyevent·additionalproperties" |
The following errors/warnings exist before current PR submission:
Rule | Message |
---|---|
AutorestCore/Exception |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2021-01", "details":"Error: Plugin prechecker reported failure." |
AutorestCore/Exception |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2020-07", "details":"Error: Plugin prechecker reported failure." |
AutorestCore/Exception |
"readme":"policyinsights/resource-manager/readme.md", "tag":"package-2019-10", "details":"Error: Plugin prechecker reported failure." |
💬 AutorestCore/Exception | "readme":"policyinsights/resource-manager/readme.md", "tag":"package-2021-01", "details":"> Loading AutoRest extension '@autorest/modelerfour' (4.15.456->4.15.456)" |
💬 AutorestCore/Exception | "readme":"policyinsights/resource-manager/readme.md", "tag":"package-2020-07", "details":"> Loading AutoRest extension '@microsoft.azure/openapi-validator' (1.8.0->1.8.0)" |
💬 AutorestCore/Exception | "readme":"policyinsights/resource-manager/readme.md", "tag":"package-2020-07", "details":"> Loading AutoRest extension '@autorest/modelerfour' (4.15.456->4.15.456)" |
💬 AutorestCore/Exception | "readme":"policyinsights/resource-manager/readme.md", "tag":"package-2019-10", "details":"> Loading AutoRest extension '@microsoft.azure/openapi-validator' (1.8.0->1.8.0)" |
💬 AutorestCore/Exception | "readme":"policyinsights/resource-manager/readme.md", "tag":"package-2019-10", "details":"> Loading AutoRest extension '@autorest/modelerfour' (4.15.456->4.15.456)" |
💬 AutorestCore/Exception | "readme":"policyinsights/resource-manager/readme.md", "tag":"package-2018-07", "details":"> Loading AutoRest extension '@microsoft.azure/openapi-validator' (1.8.0->1.8.0)" |
💬 AutorestCore/Exception | "readme":"policyinsights/resource-manager/readme.md", "tag":"package-2018-07", "details":"> Loading AutoRest extension '@autorest/modelerfour' (4.15.456->4.15.456)" |
️️✔️
[Staging] PrettierCheck succeeded [Detail] [Expand]
Validation passes for PrettierCheck.
️️✔️
[Staging] SpellCheck succeeded [Detail] [Expand]
Validation passes for SpellCheck.
️️✔️
[Staging] Lint(RPaaS) succeeded [Detail] [Expand]
Validation passes for Lint(RPaaS).
Swagger Generation Artifacts
|
Does it require all codegen to upgrade |
@lmazuel advise to upgrade to 3.4.5 |
@ArcturusZhang @qiaozha @dw511214992 This change requires codegen upgrade to use |
@@ -634,7 +634,7 @@ | |||
} | |||
}, | |||
"x-ms-paths": { | |||
"/{nextLink}?Next paging op for policy events": { | |||
"{nextLink}?Next paging op for policy events": { |
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.
@msyyc Do you know why ?Next paging op for policy events
is added after {nextLink}
? Usually only {nextLink}
is required.
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.
@weidongxu-microsoft I have test it locally and find it has no influence for generated code. So I guess it is just annotation.
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.
@najagasi and @iscai-msft were the original committers of the x-ms-paths. I imagine the path needed to be "unique" between policyStates.json and policyEvents.json to pass some validation but thats just a guess. They can comment further
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.
@pilor you're correct, x-ms-paths
needs these two to be unique. So we hack the uniqueness by adding "query parameters"
@weidongxu-microsoft We haven't started to use track2 JS codegen, and we are still using track1 JS codegen. However, track1 JS codegen still uses autorest core V2. So I think this PR cannot be merged if it needs js sdk. |
} | ||
}, | ||
"x-ms-paths": { | ||
"{nextLink}?Next paging op for policy states": { |
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.
@iscai-msft had changed this back to {nextLink} in the original PR (cf7a5ea). Should check with them
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.
@pilor I ended up having to revert that change. In "paths"
, we have to have a leading backslash, so I had to move that nextLink
declaration into x-ms-paths
. To distinguish it from the other nextLink
we have in x-ms-paths
, I added the "query parameters"
Java upgrade to 3.4.5 #15165 |
Got it. Will check with Yuchao. We had a daily smoke test and it seems the output folder is fine. https://github.com/Azure/autorest.java/blob/v4/fluent-tests/report.md
|
@dw511214992 I have also met the problem in local environment that the generated codes is always the folder of swagger readme.md. It is not autorest bug but the usage problem. According to my experience: |
/azp run |
@msyyc |
Azure Pipelines successfully started running 1 pipeline(s). |
…into policyinsights-2021-07-13
06843cc
to
f0db776
Compare
We currently disable track 1 Go generation because directive alone cannot solve the generation failure. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
thanks @msyyc |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.
the former fix link does not fix it entirely.
related issue:
Azure/azure-sdk-for-python#17280
Changelog
Please ensure to add changelog with this PR by answering the following questions.
Contribution checklist:
If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist
Ensure to check this box if one of the following scenarios meet updates in the PR, so that label “WaitForARMFeedback” will be added automatically to involve ARM API Review. Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs, all “removals” and “adding a new property” no more require ARM API review.
Please ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.
If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.
Breaking Change Review Checklist
If there are following updates in the PR, ensure to request an approval from Breaking Change Review Board as defined in the Breaking Change Policy.
Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.
Please follow the link to find more details on PR review process.