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

[typespec-next] React to azure/typespec-azure#3180 #24561

Merged

Conversation

mikeharder
Copy link
Member

@mikeharder mikeharder commented Jun 23, 2023

This PR includes changes reacting to the fix for Azure/typespec-azure#3180

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Jun 23, 2023

Swagger Validation Report

️❌BreakingChange: 18 Errors, 0 Warnings failed [Detail]
compared swaggers (via Oad v0.10.4)] new version base version
generated.json 2023-06-01-preview(480dccf) 2023-06-01-preview(main)
generated.json 2022-12-01(480dccf) 2022-12-01(main)
generated.json 2023-05-15(480dccf) 2023-05-15(main)
Rule Message
1017 - ReferenceRedirection The '$ref' property points to different models in the old and new versions.
New: inference/preview/2023-06-01-preview/generated.json#L385:9
Old: inference/preview/2023-06-01-preview/generated.json#L385:9
1017 - ReferenceRedirection The '$ref' property points to different models in the old and new versions.
New: inference/preview/2023-06-01-preview/generated.json#L589:9
Old: inference/preview/2023-06-01-preview/generated.json#L587:9
1017 - ReferenceRedirection The '$ref' property points to different models in the old and new versions.
New: inference/stable/2022-12-01/generated.json#L444:9
Old: inference/stable/2022-12-01/generated.json#L442:9
1017 - ReferenceRedirection The '$ref' property points to different models in the old and new versions.
New: inference/stable/2022-12-01/generated.json#L240:9
Old: inference/stable/2022-12-01/generated.json#L240:9
1017 - ReferenceRedirection The '$ref' property points to different models in the old and new versions.
New: inference/stable/2023-05-15/generated.json#L291:9
Old: inference/stable/2023-05-15/generated.json#L291:9
1017 - ReferenceRedirection The '$ref' property points to different models in the old and new versions.
New: inference/stable/2023-05-15/generated.json#L495:9
Old: inference/stable/2023-05-15/generated.json#L493:9
1026 - TypeChanged The new version has a different type 'string' than the previous one ''.
New: inference/preview/2023-06-01-preview/generated.json#L385:9
Old: inference/preview/2023-06-01-preview/generated.json#L385:9
1026 - TypeChanged The new version has a different type 'string' than the previous one ''.
New: inference/preview/2023-06-01-preview/generated.json#L589:9
Old: inference/preview/2023-06-01-preview/generated.json#L587:9
1026 - TypeChanged The new version has a different type 'string' than the previous one ''.
New: inference/stable/2022-12-01/generated.json#L444:9
Old: inference/stable/2022-12-01/generated.json#L442:9
1026 - TypeChanged The new version has a different type 'string' than the previous one ''.
New: inference/stable/2022-12-01/generated.json#L240:9
Old: inference/stable/2022-12-01/generated.json#L240:9
1026 - TypeChanged The new version has a different type 'string' than the previous one ''.
New: inference/stable/2023-05-15/generated.json#L291:9
Old: inference/stable/2023-05-15/generated.json#L291:9
1026 - TypeChanged The new version has a different type 'string' than the previous one ''.
New: inference/stable/2023-05-15/generated.json#L495:9
Old: inference/stable/2023-05-15/generated.json#L493:9
1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
New: inference/preview/2023-06-01-preview/generated.json#L385:9
Old: inference/preview/2023-06-01-preview/generated.json#L385:9
1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
New: inference/preview/2023-06-01-preview/generated.json#L589:9
Old: inference/preview/2023-06-01-preview/generated.json#L587:9
1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
New: inference/stable/2022-12-01/generated.json#L444:9
Old: inference/stable/2022-12-01/generated.json#L442:9
1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
New: inference/stable/2022-12-01/generated.json#L240:9
Old: inference/stable/2022-12-01/generated.json#L240:9
1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
New: inference/stable/2023-05-15/generated.json#L291:9
Old: inference/stable/2023-05-15/generated.json#L291:9
1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
New: inference/stable/2023-05-15/generated.json#L495:9
Old: inference/stable/2023-05-15/generated.json#L493:9
️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
There are no breaking changes.
️⚠️LintDiff: 6 Warnings warning [Detail]
compared tags (via openapi-validator v2.1.3) new version base version
release_2022_12_01_autogen release_2022_12_01_autogen(480dccf) release_2022_12_01_autogen(typespec-next)
release_2023_05_15_autogen release_2023_05_15_autogen(480dccf) release_2023_05_15_autogen(typespec-next)
release_2023_06_01_preview_autogen release_2023_06_01_preview_autogen(480dccf) release_2023_06_01_preview_autogen(typespec-next)

[must fix]The following errors/warnings are introduced by current PR:

Rule Message Related RPC [For API reviewers]
⚠️ Nullable Avoid the use of x-nullable.
Location: inference/preview/2023-06-01-preview/generated.json#L387
⚠️ Nullable Avoid the use of x-nullable.
Location: inference/preview/2023-06-01-preview/generated.json#L591
⚠️ Nullable Avoid the use of x-nullable.
Location: inference/stable/2022-12-01/generated.json#L242
⚠️ Nullable Avoid the use of x-nullable.
Location: inference/stable/2022-12-01/generated.json#L446
⚠️ Nullable Avoid the use of x-nullable.
Location: inference/stable/2023-05-15/generated.json#L293
⚠️ Nullable Avoid the use of x-nullable.
Location: inference/stable/2023-05-15/generated.json#L497


The following errors/warnings exist before current PR submission:

Only 30 items are listed, please refer to log for more details.

Rule Message
⚠️ SecurityDefinitionDescription Security definition should have a description.
Location: inference/preview/2023-06-01-preview/generated.json#L46
⚠️ SecurityDefinitionDescription Security definition should have a description.
Location: inference/preview/2023-06-01-preview/generated.json#L51
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L64
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/preview/2023-06-01-preview/generated.json#L70
⚠️ ParameterDescription Parameter should have a description.
Location: inference/preview/2023-06-01-preview/generated.json#L77
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L115
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/preview/2023-06-01-preview/generated.json#L121
⚠️ ParameterDescription Parameter should have a description.
Location: inference/preview/2023-06-01-preview/generated.json#L128
⚠️ PaginationResponse Operation might be pageable. Consider adding the x-ms-pageable extension.
Location: inference/preview/2023-06-01-preview/generated.json#L165
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L166
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/preview/2023-06-01-preview/generated.json#L172
⚠️ ParameterDescription Parameter should have a description.
Location: inference/preview/2023-06-01-preview/generated.json#L179
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L217
⚠️ ParameterDescription Parameter should have a description.
Location: inference/preview/2023-06-01-preview/generated.json#L223
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L268
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/preview/2023-06-01-preview/generated.json#L274
⚠️ SchemaNamesConvention Schema name should be Pascal case.
Location: inference/preview/2023-06-01-preview/generated.json#L311
⚠️ SchemaNamesConvention Schema name should be Pascal case.
Location: inference/preview/2023-06-01-preview/generated.json#L346
⚠️ SchemaNamesConvention Schema name should be Pascal case.
Location: inference/preview/2023-06-01-preview/generated.json#L359
⚠️ EnumInsteadOfBoolean Booleans properties are not descriptive in all cases and can make them to use, evaluate whether is makes sense to keep the property as boolean or turn it into an enum.
Location: inference/preview/2023-06-01-preview/generated.json#L505
⚠️ Nullable Avoid the use of x-nullable.
Location: inference/preview/2023-06-01-preview/generated.json#L585
⚠️ Nullable Avoid the use of x-nullable.
Location: inference/preview/2023-06-01-preview/generated.json#L685
⚠️ EnumInsteadOfBoolean Booleans properties are not descriptive in all cases and can make them to use, evaluate whether is makes sense to keep the property as boolean or turn it into an enum.
Location: inference/preview/2023-06-01-preview/generated.json#L774
⚠️ EnumInsteadOfBoolean Booleans properties are not descriptive in all cases and can make them to use, evaluate whether is makes sense to keep the property as boolean or turn it into an enum.
Location: inference/preview/2023-06-01-preview/generated.json#L804
⚠️ SchemaDescriptionOrTitle Schema should have a description or title.
Location: inference/preview/2023-06-01-preview/generated.json#L1110
⚠️ SecurityDefinitionDescription Security definition should have a description.
Location: inference/stable/2022-12-01/generated.json#L46
⚠️ SecurityDefinitionDescription Security definition should have a description.
Location: inference/stable/2022-12-01/generated.json#L51
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/stable/2022-12-01/generated.json#L64
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/stable/2022-12-01/generated.json#L70
⚠️ ParameterDescription Parameter should have a description.
Location: inference/stable/2022-12-01/generated.json#L77
️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️SwaggerAPIView succeeded [Detail] [Expand]
️️✔️CadlAPIView succeeded [Detail] [Expand]
️❌TypeSpecAPIView: 0 Errors, 1 Warnings failed [Detail]
Rule Message
⚠️ Failed to generate TypeSpec APIView. Please check the detail log and make sure TypeSpec compiler version is the latest. "How to fix":"Check the detailed log and verify if the TypeSpec emitter is able to create API review file for the changes in PR."
️️✔️ModelValidation succeeded [Detail] [Expand]
Validation passes for ModelValidation.
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️PrettierCheck succeeded [Detail] [Expand]
Validation passes for PrettierCheck.
️️✔️SpellCheck succeeded [Detail] [Expand]
Validation passes for SpellCheck.
️️✔️CadlValidation succeeded [Detail] [Expand]
Validation passes for CadlValidation.
️❌TypeSpec Validation: 3 Errors, 6 Warnings failed [Detail]
Rule Message
InConsistentSwagger "details":"The generated swagger file 2023-06-01-preview/generated.json from typespec specification/cognitiveservices/OpenAI.Inference is not the same as the '/mnt/vss/_work/1/azure-rest-api-specs/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.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 2022-12-01/generated.json from typespec specification/cognitiveservices/OpenAI.Inference is not the same as the '/mnt/vss/_work/1/azure-rest-api-specs/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2022-12-01/generated.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-05-15/generated.json from typespec specification/cognitiveservices/OpenAI.Inference is not the same as the '/mnt/vss/_work/1/azure-rest-api-specs/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json' in PR,
please make sure the swagger is consistent with the generated swagger. You can find the difference in the pipeline log."
⚠️ @azure-tools/typespec-autorest/union-unsupported Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.
Location: cognitiveservices/OpenAI.Inference/models/completions.create.tsp#L200
⚠️ @azure-tools/typespec-autorest/union-unsupported Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.
Location: cognitiveservices/OpenAI.Inference/models/chat.completions.tsp#L164
⚠️ @azure-tools/typespec-autorest/union-unsupported Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.
Location: cognitiveservices/OpenAI.Inference/models/completions.create.tsp#L200
⚠️ @azure-tools/typespec-autorest/union-unsupported Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.
Location: cognitiveservices/OpenAI.Inference/models/chat.completions.tsp#L164
⚠️ @azure-tools/typespec-autorest/union-unsupported Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.
Location: cognitiveservices/OpenAI.Inference/models/completions.create.tsp#L200
⚠️ @azure-tools/typespec-autorest/union-unsupported Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.
Location: cognitiveservices/OpenAI.Inference/models/chat.completions.tsp#L164
️️✔️PR Summary succeeded [Detail] [Expand]
Validation passes for Summary.
Posted by Swagger Pipeline | How to fix these errors?

@openapi-workflow-bot
Copy link

Hi, @mikeharder Thanks for your PR. I am workflow bot for review process. Here are some small tips.

  • Please ensure to do self-check against checklists in first PR comment.
  • PR assignee is the person auto-assigned and responsible for your current PR reviewing and merging.
  • For specs comparison cross API versions, Use API Specs Comparison Report Generator
  • If there is CI failure(s), to fix CI error(s) is mandatory for PR merging; or you need to provide justification in PR comment for explanation. How to fix?

  • Any feedback about review process or workflow bot, pls contact swagger and tools team. [email protected]

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jun 23, 2023

    Swagger Generation Artifacts

    ️️✔️ApiDocPreview succeeded [Detail] [Expand]
     Please click here to preview with your @microsoft account. 
    ️️✔️SDK Breaking Change Tracking succeeded [Detail] [Expand]

    Breaking Changes Tracking

    ️️✔️ azure-sdk-for-net-track2 succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs] Generate from 310dad6b1b594716a903a224a633a22781ab2a13. SDK Automation 14.0.0
      command	pwsh ./eng/scripts/Automation-Sdk-Init.ps1 ../azure-sdk-for-net_tmp/initInput.json ../azure-sdk-for-net_tmp/initOutput.json
      warn		specification/cognitiveservices/data-plane/AzureOpenAI/inference/readme.md skipped due to azure-sdk-for-net-track2 not found in swagger-to-sdk
      command	pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1 ../azure-sdk-for-net_tmp/generateInput.json ../azure-sdk-for-net_tmp/generateOutput.json
    • ️✔️Azure.AI.OpenAI [View full logs]  [Preview SDK Changes]
      info	[Changelog]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jun 23, 2023

    Generated ApiView

    Language Package Name ApiView Link
    Swagger cognitiveservices-data-plane-AzureOpenAI-inference https://apiview.dev/Assemblies/Review/54dfbbc9f7cf45a5a8a93884aacbba2c
    .Net Azure.AI.OpenAI https://apiview.dev/Assemblies/Review/25979512d4f74720ab35e720661876da

    @ghost ghost added the Cognitive Services label Jun 23, 2023
    @AzureRestAPISpecReview AzureRestAPISpecReview added BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required data-plane labels Jun 23, 2023
    @openapi-workflow-bot
    Copy link

    Hi @mikeharder! The automation detected breaking changes in this pull request. As a result, it added the BreakingChangeReviewRequired label.

    You cannot proceed with merging this PR until you complete one of the following action items:

    ACTION ITEM ALTERNATIVE A: Fix the breaking change.
    Please consult the documentation provided in the relevant validation failures.

    ACTION ITEM ALTERNATIVE B: Request approval.
    Alternatively, if you cannot fix the breaking changes, then you can request an approval for them. Please follow the process described in the High-level Breaking Change Process doc.

    ACTION ITEM ALTERNATIVE C: Report false positive.
    If you think there are no breaking changes, i.e. the validation should pass yet it fails, then please explain why in a PR comment and @ the PR assignee.

    @mikeharder mikeharder merged commit 2fe0db2 into Azure:typespec-next Jun 23, 2023
    @mikeharder mikeharder deleted the typespec-next-nullable-enum branch June 23, 2023 21:27
    @mikeharder mikeharder self-assigned this Jun 24, 2023
    @mikeharder mikeharder changed the title [typespec-next] React to fix for Azure/typespec-azure#3180 [typespec-next] React to azure/typespec-azure#3180 Jun 27, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required Cognitive Services data-plane
    Projects
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    3 participants