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

[HealthInsights] Remove import of typespec-autorest #24598

Merged
merged 3 commits into from
Jun 27, 2023

Conversation

mikeharder
Copy link
Member

@mikeharder mikeharder commented Jun 27, 2023

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Jun 27, 2023

Swagger Validation Report

️️✔️BreakingChange succeeded [Detail] [Expand]
There are no breaking changes.
compared swaggers (via Oad v0.10.4)] new version base version
openapi.json 2023-03-01-preview(2480705) 2023-03-01-preview(main)
️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️CredScan succeeded [Detail] [Expand]
There is no credential detected.
️⚠️LintDiff: 0 Warnings warning [Detail]
compared tags (via openapi-validator v2.1.3) new version base version
2023-03-01-preview 2023-03-01-preview(2480705) 2023-03-01-preview(main)

The following errors/warnings exist before current PR submission:

Rule Message
LroExtension Operations with a 202 response must specify x-ms-long-running-operation: true.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L59
XmsEnumValidation The enum types should have x-ms-enum type extension set with appropriate options.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L105
LroExtension Operations with a 202 response must specify x-ms-long-running-operation: true.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L184
XmsEnumValidation The enum types should have x-ms-enum type extension set with appropriate options.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L230
RequiredReadOnlyProperties Property 'jobId' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1546
RequiredReadOnlyProperties Property 'createdDateTime' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1546
RequiredReadOnlyProperties Property 'expirationDateTime' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1546
RequiredReadOnlyProperties Property 'lastUpdateDateTime' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1546
RequiredReadOnlyProperties Property 'status' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1546
RequiredReadOnlyProperties Property 'jobId' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1902
RequiredReadOnlyProperties Property 'createdDateTime' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1902
RequiredReadOnlyProperties Property 'expirationDateTime' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1902
RequiredReadOnlyProperties Property 'lastUpdateDateTime' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1902
RequiredReadOnlyProperties Property 'status' is a required property. It should not be marked as 'readonly'
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L1902
⚠️ SecurityDefinitionDescription Security definition should have a description.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L43
⚠️ ParameterNamesConvention header parameter name 'Repeatability-Request-ID' should be kebab case.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L70
⚠️ ParameterDescription Parameter should have a description.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L76
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L147
⚠️ ParameterNamesConvention header parameter name 'Repeatability-Request-ID' should be kebab case.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L195
⚠️ ParameterDescription Parameter should have a description.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L201
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L272
⚠️ SchemaDescriptionOrTitle Schema should have a description or title.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L370
⚠️ SchemaNamesConvention Schema name should be Pascal case.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L430
⚠️ SchemaNamesConvention Schema name should be Pascal case.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L465
⚠️ SchemaNamesConvention Schema name should be Pascal case.
Location: HealthInsights/preview/2023-03-01-preview/openapi.json#L478
⚠️ 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: HealthInsights/preview/2023-03-01-preview/openapi.json#L1497
⚠️ 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: HealthInsights/preview/2023-03-01-preview/openapi.json#L1502
⚠️ 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: HealthInsights/preview/2023-03-01-preview/openapi.json#L1515
⚠️ 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: HealthInsights/preview/2023-03-01-preview/openapi.json#L1856
⚠️ 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: HealthInsights/preview/2023-03-01-preview/openapi.json#L1861
️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️ApiReadinessCheck succeeded [Detail] [Expand]
️⚠️~[Staging] ServiceAPIReadinessTest: 0 Warnings warning [Detail]

API Test is not triggered due to precheck failure. Check pipeline log for details.

️️✔️SwaggerAPIView succeeded [Detail] [Expand]
️️✔️CadlAPIView succeeded [Detail] [Expand]
️❌TypeSpecAPIView: 0 Errors, 2 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."
⚠️ 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: 2 Errors, 0 Warnings failed [Detail]
Rule Message
RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE Following response status codes 200 for operation OncoPhenotype_CreateJob were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.
Url: HealthInsights/preview/2023-03-01-preview/openapi.json#L86:18
ExampleUrl: preview/2023-03-01-preview/examples/SuccessfulOncoPhenotypeRequest.json#L52:16
RESPONSE_STATUS_CODE_NOT_IN_EXAMPLE Following response status codes 200 for operation TrialMatcher_CreateJob were present in the swagger spec, however they were not present in x-ms-examples. Please provide them.
Url: HealthInsights/preview/2023-03-01-preview/openapi.json#L211:18
ExampleUrl: preview/2023-03-01-preview/examples/SuccessfulTrialMatcherRequest.json#L149:16
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️PoliCheck succeeded [Detail] [Expand]
Validation passed for PoliCheck.
️️✔️PrettierCheck succeeded [Detail] [Expand]
Validation passes for PrettierCheck.
️️✔️SpellCheck succeeded [Detail] [Expand]
Validation passes for SpellCheck.
️️✔️Lint(RPaaS) succeeded [Detail] [Expand]
Validation passes for Lint(RPaaS).
️️✔️CadlValidation succeeded [Detail] [Expand]
Validation passes for CadlValidation.
️️✔️TypeSpec Validation succeeded [Detail] [Expand]
Validation passes for TypeSpec Validation.
️️✔️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 27, 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 failed [Detail]
    • Pipeline Framework Failed [Logs]Release - Generate from 288b01a. 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/HealthInsights/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
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mInvalidOperation: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/common/scripts/TypeSpec-Project-Process.ps1:21
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m  21 | �[0m   if (�[36;1m$tspConfig["parameters"]["dependencies"] -and $tspConfig["param�[0m …
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mCannot index into a null array.
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mWrite-Error: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/common/scripts/TypeSpec-Project-Process.ps1:26
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m  26 | �[0m   $serviceDir = �[36;1mGet-ServiceDir $tspConfig $repoRoot�[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mMissing service-dir in parameters section of tspconfig.yaml. Please
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1mrefer to
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1mhttps://github.com/Azure/azure-rest-api-specs/blob/main/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml for the right schema.
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mInvalidOperation: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/common/scripts/TypeSpec-Project-Process.ps1:21
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m  21 | �[0m   if (�[36;1m$tspConfig["parameters"]["dependencies"] -and $tspConfig["param�[0m …
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mCannot index into a null array.
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mWrite-Error: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/common/scripts/TypeSpec-Project-Process.ps1:26
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m  26 | �[0m   $serviceDir = �[36;1mGet-ServiceDir $tspConfig $repoRoot�[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mMissing service-dir in parameters section of tspconfig.yaml. Please
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1mrefer to
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1mhttps://github.com/Azure/azure-rest-api-specs/blob/main/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml for the right schema.
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      warn	No file changes detected after generation
      the given reference name 'refs/heads/sdkAuto/' is not valid
      Error: the given reference name 'refs/heads/sdkAuto/' is not valid
    • error	Fatal error: the given reference name 'refs/heads/sdkAuto/' is not valid
      error	The following packages are still pending:
      error
      error
    ️❌ azure-sdk-for-java failed [Detail]
    • Pipeline Framework Failed [Logs]Release - Generate from 288b01a. SDK Automation 14.0.0
      command	./eng/mgmt/automation/init.sh ../azure-sdk-for-java_tmp/initInput.json ../azure-sdk-for-java_tmp/initOutput.json
      cmderr	[init.sh] [notice] A new release of pip is available: 23.0.1 -> 23.1.2
      cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
      cmderr	[init.sh] [notice] A new release of pip is available: 23.0.1 -> 23.1.2
      cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
      warn		specification/cognitiveservices/data-plane/HealthInsights/readme.md skipped due to azure-sdk-for-java not found in swagger-to-sdk
      command	./eng/mgmt/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
      cmderr	[generate.py] �[31;1mInvalidOperation: �[0m/mnt/vss/_work/1/s/azure-sdk-for-java/eng/common/scripts/TypeSpec-Project-Process.ps1:21
      cmderr	[generate.py] �[36;1mLine |
      cmderr	[generate.py] �[36;1m  21 | �[0m   if (�[36;1m$tspConfig["parameters"]["dependencies"] -and $tspConfig["param�[0m …
      cmderr	[generate.py] �[36;1m     | �[31;1m       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[generate.py] �[31;1m�[36;1m     | �[31;1mCannot index into a null array.
      cmderr	[generate.py] �[0m
      cmderr	[generate.py] �[31;1mGet-ServiceDir: �[0m/mnt/vss/_work/1/s/azure-sdk-for-java/eng/common/scripts/TypeSpec-Project-Process.ps1:26
      cmderr	[generate.py] �[36;1mLine |
      cmderr	[generate.py] �[36;1m  26 | �[0m   $serviceDir = �[36;1mGet-ServiceDir $tspConfig $repoRoot�[0m
      cmderr	[generate.py] �[36;1m     | �[31;1m                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[generate.py] �[31;1m�[36;1m     | �[31;1mMissing service-dir in parameters section of tspconfig.yaml. Please
      cmderr	[generate.py] �[36;1m     | �[31;1mrefer to
      cmderr	[generate.py] �[36;1m     | �[31;1mhttps://github.com/Azure/azure-rest-api-specs/blob/main/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml for the right schema.
      cmderr	[generate.py] �[0m
      error	Fatal error: The "path" argument must be of type string. Received undefined
      The "path" argument must be of type string. Received undefined
      TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
          at new NodeError (node:internal/errors:387:5)
          at validateString (node:internal/validators:162:11)
          at Object.basename (node:path:1309:5)
          at Object.exports.getPackageData (/mnt/vss/_work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/types/PackageData.js:38:82)
          at /mnt/vss/_work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/automation/workflow.js:210:194
          at Array.map (<anonymous>)
          at workflowHandleReadmeMdOrTypeSpecProject (/mnt/vss/_work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/automation/workflow.js:210:164)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at async Object.exports.workflowMain (/mnt/vss/_work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/automation/workflow.js:98:13)
          at async Object.exports.sdkAutoMain (/mnt/vss/_work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/automation/entrypoint.js:191:13)
          at async /mnt/vss/_work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/cli/cli.js:20:18
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jun 27, 2023

    Generated ApiView

    Language Package Name ApiView Link
    Swagger cognitiveservices-data-plane-HealthInsights https://apiview.dev/Assemblies/Review/a5fad1fc79444da9812b026573fc69e2

    @ghost ghost added the Cognitive Services label Jun 27, 2023
    @openapi-workflow-bot
    Copy link

    Hi @mikeharder! Your PR has some issues. Please fix the CI issues, if present, in following order: Avocado, SemanticValidation, ModelValidation, Breaking Change, LintDiff.

    TaskHow to fixPriority
    AvocadoFix-AvocadoHigh
    Semantic ValidationFix-SemanticValidation-ErrorHigh
    Model ValidationFix-ModelValidation-ErrorHigh
    LintDiffFix-LintDiffHigh

    If you need further help, please reach out on the Teams channel aka.ms/azsdk/support/specreview-channel.

    @mikeharder
    Copy link
    Member Author

    /azp run

    @azure-pipelines
    Copy link

    Azure Pipelines successfully started running 2 pipeline(s).

    @mikeharder
    Copy link
    Member Author

    @timotheeguerin: I believe this PR is causing this spec to fail check "Swagger ModelValidation". Compare to this no-op PR which passes the same check.

    #24604

    So I think these @example directives were serving some purpose, and we may not be able to simply delete them.

    @mikeharder
    Copy link
    Member Author

    @timotheeguerin: I believe this PR is causing this spec to fail check "Swagger ModelValidation". Compare to this no-op PR which passes the same check.

    #24604

    So I think these @example directives were serving some purpose, and we may not be able to simply delete them.

    Actually this might be a red herring, because "Swagger ModelValidation" always passes if there is no change to the swagger files. Let me update the "no-op" PR to actually change the output swagger.

    @mikeharder
    Copy link
    Member Author

    Errors in "Swagger ModelValidation" are unrelated to this PR. Will open an issue to get them fixed in main.

    @mikeharder mikeharder merged commit 288b01a into Azure:main Jun 27, 2023
    @mikeharder mikeharder deleted the healthinsights-import-autorest branch June 27, 2023 19:08
    @mikeharder mikeharder assigned mikeharder and unassigned tjprescott Jun 27, 2023
    harryli0108 pushed a commit to harryli0108/azure-rest-api-specs that referenced this pull request Jul 28, 2023
    - Causes small change in generated autorest, but I think the removed content was redundant anyway
    - Partially fixes Azure#24565
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Remove imports of typespec-autorest
    4 participants