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

Convert sample project to TypeSpec #23168

Merged
merged 15 commits into from
Apr 4, 2023

Conversation

weshaggard
Copy link
Member

This PR updates the root project.json to include both cadl and typespec packages for now until we convert everything. This also updates the sample project to typespec

@weshaggard weshaggard requested a review from a team as a code owner March 17, 2023 22:21
@weshaggard weshaggard requested review from bexxx and mikekistler and removed request for a team March 17, 2023 22:21
@openapi-workflow-bot
Copy link

Hi, @weshaggard 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. vscswagger@microsoft.com

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Mar 17, 2023

    Swagger Validation Report

    ️❌BreakingChange: 1 Errors, 0 Warnings failed [Detail]
    compared swaggers (via Oad v0.10.4)] new version base version
    widgets.json 2022-11-01-preview(0d6d14d) 2022-11-01-preview(main)
    Rule Message
    1033 - RemovedProperty The new version is missing a property found in the old version. Was 'widgetName' renamed or removed?
    New: Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json#L296:15
    Old: Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json#L272:15
    ️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️️✔️LintDiff succeeded [Detail] [Expand]
    Validation passes for LintDiff.
    compared tags (via openapi-validator v2.0.0) new version base version
    package-2022-11-01-preview package-2022-11-01-preview(0d6d14d) default(main)
    ️️✔️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 succeeded [Detail] [Expand]
    ️️✔️ModelValidation succeeded [Detail] [Expand]
    Validation passes for ModelValidation.
    ️️✔️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-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Mar 17, 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-python warning [Detail]
    • ⚠️Warning [Logs]Release - Generate from 9a46bdb. SDK Automation 14.0.0
      command	sh scripts/automation_init.sh ../azure-sdk-for-python_tmp/initInput.json ../azure-sdk-for-python_tmp/initOutput.json
      cmderr	[automation_init.sh] WARNING: Skipping azure-nspkg as it is not installed.
      warn		specification/contosowidgetmanager/data-plane/readme.md skipped due to azure-sdk-for-python not found in swagger-to-sdk
      command	sh scripts/automation_generate.sh ../azure-sdk-for-python_tmp/generateInput.json ../azure-sdk-for-python_tmp/generateOutput.json
      cmderr	[automation_generate.sh] npm notice
      cmderr	[automation_generate.sh] npm notice New minor version of npm available! 9.5.0 -> 9.6.3
      cmderr	[automation_generate.sh] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.3>
      cmderr	[automation_generate.sh] npm notice Run `npm install -g npm@9.6.3` to update!
      cmderr	[automation_generate.sh] npm notice
    • ️✔️azure-contoso-widgetmanager [View full logs]  [Release SDK Changes]
      info	[Changelog] data-plan skip changelog generation temporarily
    ️❌ azure-sdk-for-net-track2 failed [Detail]
    • Failed [Logs]Release - Generate from 9a46bdb. 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/contosowidgetmanager/data-plane/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;1mGeneratePackage: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:145
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m 145 | �[0m         �[36;1mGeneratePackage `�[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m         ~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mFailed to generate sdk. exit code: False
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGet-ChildItem: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/automation/GenerateAndBuildLib.ps1:759
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m 759 | �[0m … rtifacts += �[36;1mGet-ChildItem $artifactsPath -Filter *.nupkg -exclude *.s�[0m …
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mCannot find path
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m'/mnt/vss/_work/1/s/azure-sdk-for-net/artifacts/packages/Debug/' because
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1mit does not exist.
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGeneratePackage: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:145
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m 145 | �[0m         �[36;1mGeneratePackage `�[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m         ~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mFailed to generate sdk artifact
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
    • Azure.Contoso.WidgetManager [View full logs]  [Release SDK Changes]
      info	[Changelog]
    ️️✔️ azure-sdk-for-js succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs]Release - Generate from 9a46bdb. SDK Automation 14.0.0
      command	sh .scripts/automation_init.sh ../azure-sdk-for-js_tmp/initInput.json ../azure-sdk-for-js_tmp/initOutput.json
      warn	File azure-sdk-for-js_tmp/initOutput.json not found to read
      warn		specification/contosowidgetmanager/data-plane/readme.md skipped due to azure-sdk-for-js not found in swagger-to-sdk
      command	sh .scripts/automation_generate.sh ../azure-sdk-for-js_tmp/generateInput.json ../azure-sdk-for-js_tmp/generateOutput.json
    • ️✔️@azure-rest/contoso-widgetmanager-rest [View full logs]  [Release SDK Changes]
      info	[Changelog]
      error	breakingChangeTracking is enabled, but version or changelogItem is not found in output.
    ️⚠️ azure-sdk-for-java warning [Detail]
    • ⚠️Warning [Logs]Release - Generate from 9a46bdb. 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
      warn		specification/contosowidgetmanager/data-plane/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] npm notice
      cmderr	[generate.py] npm notice New major version of npm available! 8.19.3 -> 9.6.3
      cmderr	[generate.py] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.3>
      cmderr	[generate.py] npm notice Run `npm install -g npm@9.6.3` to update!
      cmderr	[generate.py] npm notice
    • ️✔️azure-contoso-widgetmanager [View full logs]  [Release SDK Changes]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Mar 17, 2023

    Generated ApiView

    Language Package Name ApiView Link
    Python azure-contoso-widgetmanager https://apiview.dev/Assemblies/Review/9b4d4a0a719e496c9fe5497b60a437f8
    Java azure-contoso-widgetmanager https://apiview.dev/Assemblies/Review/99aac979b981499daf419cc899d32eef
    JavaScript @azure-rest/contoso-widgetmanager-rest https://apiview.dev/Assemblies/Review/5e8a571f9d614e9f80e3d74c8a925ab8

    @AzureRestAPISpecReview AzureRestAPISpecReview added BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required Cadl Authored with Cadl CI-FixRequiredOnFailure data-plane labels Mar 17, 2023
    @openapi-workflow-bot
    Copy link

    Hi @weshaggard, one or multiple breaking change(s) is detected in your PR. Please check out the breaking change(s), and provide business justification in the PR comment and @ PR assignee why you must have these change(s), and how external customer impact can be mitigated. Please ensure to follow breaking change policy to request breaking change review and approval before proceeding swagger PR review.
    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.
    If you want to know the production traffic statistic, please see ARM Traffic statistic.
    If you think it is false positive breaking change, please provide the reasons in the PR comment, report to Swagger Tooling Team via https://aka.ms/swaggerfeedback.
    Note: To avoid breaking change, you can refer to Shift Left Solution for detecting breaking change in early phase at your service code repository.

    @openapi-workflow-bot
    Copy link

    Hi @weshaggard, Your PR has some issues. Please fix the CI sequentially by following the order of Avocado, semantic validation, model validation, breaking change, lintDiff. If you have any questions, please post your questions in this channel https://aka.ms/swaggersupport.

    TaskHow to fixPriority
    AvocadoFix-AvocadoHigh
    Semantic validationFix-SemanticValidation-ErrorHigh
    Model validationFix-ModelValidation-ErrorHigh
    LintDiffFix-LintDiffhigh
    If you need further help, please feedback via swagger feedback.

    @weshaggard
    Copy link
    Member Author

    @mikeharder we can use changes in this PR to test out the CadlValidation changes.

    @praveenkuttappan
    Copy link
    Member

    /azp run

    @azure-pipelines
    Copy link

    Azure Pipelines successfully started running 1 pipeline(s).

    Copy link
    Member

    @mikekistler mikekistler left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Looks good! 👍

    @openapi-workflow-bot
    Copy link

    Hi @weshaggard, one or multiple validation error/warning suppression(s) is detected in your PR. Please follow the Swagger-Suppression-Process to get approval.

    @azure-sdk
    Copy link
    Collaborator

    API change check

    APIView has identified API level changes in this PR and created following API reviews.

    /
    azure-contoso-widgetmanager
    Contoso.WidgetManager
    @azure-rest/contosowidgetmanager-rest
    contosowidgetmanager-data-plane-Azure.Contoso.WidgetManager

    @mikeharder
    Copy link
    Member

    /azp run

    @azure-pipelines
    Copy link

    Azure Pipelines successfully started running 1 pipeline(s).

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required Cadl Authored with Cadl data-plane SuppressionReviewRequired
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.