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

[Microsoft.DevCenter] Update operation ID for SDK generation #25333

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

chrissmiller
Copy link
Contributor

@chrissmiller chrissmiller commented Aug 16, 2023

Data Plane API - Pull Request

We are starting the process of generating SDKs for the 2023-07-01-preview API version, and per previous guidance from the SDK board we need to ensure our operation IDs are consistent across our APIs. This PR updates our new operations APIs to follow the operationId pattern we've been recommended to use. This is the first API that introduces these operations, and there are no previously generated SDKs that include them.

API Info: The Basics

Most of the information about your service should be captured in the issue that serves as your API Spec engagement record.

Is this review for (select one):

  • a private preview
  • a public preview
  • GA release

❔Got questions? Need additional info?? We are here to help!

Contact us!

The Azure API Review Board is dedicated to helping you create amazing APIs. You can read about our mission and learn more about our process on our wiki.

Click here for links to tools, specs, guidelines & other good stuff

Tooling

Guidelines & Specifications

Helpful Links

@chrissmiller chrissmiller requested a review from a team as a code owner August 16, 2023 14:12
@chrissmiller chrissmiller requested review from scgbear and bexxx and removed request for a team August 16, 2023 14:12
@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Aug 16, 2023

Next Steps to Merge

⚠️ This is an experimental comment. It may not always be up-to-date. ⚠️

✔️ All automated merging requirements have been met! Refer to step 4 in the PR workflow diagram (even if your PR is for data plane, not ARM).

@openapi-workflow-bot
Copy link

Hi, @chrissmiller! Thank you for your pull request. To help get your PR merged:

  • Ensure you reviewed the checklists in the PR description.
  • Know that PR assignee is the person auto-assigned and responsible for your current PR review and approval.
  • For convenient view of the API changes made by this PR, refer to the URLs provided in the table in the Generated ApiView comment added to this PR. You can use ApiView to show API versions diff.
  • @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Aug 16, 2023

    Swagger Validation Report

    ️❌BreakingChange: 4 Errors, 0 Warnings failed [Detail]
    compared swaggers (via Oad v0.10.4)] new version base version
    environments.json 2023-07-01-preview(eac615d) 2023-07-01-preview(main)
    Rule Message
    1008 - ModifiedOperationId The operation id has been changed from 'EnvironmentOperations_ListByEnvironment' to 'Environments_ListOperations'. This will impact generated code.
    New: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L314:7
    Old: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L314:7
    1008 - ModifiedOperationId The operation id has been changed from 'EnvironmentOperations_GetByEnvironment' to 'Environments_GetOperation'. This will impact generated code.
    New: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L372:7
    Old: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L372:7
    1008 - ModifiedOperationId The operation id has been changed from 'EnvironmentOperations_GetLogs' to 'Environments_GetLogsByOperation'. This will impact generated code.
    New: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L424:7
    Old: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L424:7
    Runtime Exception "new":"https://github.com/Azure/azure-rest-api-specs/blob/eac615dd9bcfd8e8f7f8d367e13fb767487af1e1/specification/devcenter/data-plane/Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json",
    "old":"https://github.com/Azure/azure-rest-api-specs/blob/main/specification/devcenter/data-plane/Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json",
    "details":"Command failed: node "/mnt/vss/_work/_tasks/AzureApiValidation_5654d05d-82c1-48da-ad8f-161b817f6d41/0.0.57/common/temp/node_modules/.pnpm/@Azure[email protected]/node_modules/autorest/dist/app.js" --v2 --input-file=/mnt/vss/_work/1/same-version-c93b354fd9c14905bb574a8834c4d69b/specification/devcenter/data-plane/Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=old --output-folder=/tmp\nERROR: Schema violation: No enum match for: operation-location\n - file:///mnt/vss/_work/1/same-version-c93b354fd9c14905bb574a8834c4d69b/specification/devcenter/data-plane/Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json:825:10 ($.paths["/projects/projectName/users/userId/devboxes/devBoxName:repair"].post["x-ms-long-running-operation-options"]["final-state-via"])\nERROR: Schema violation: No enum match for: operation-location\n - file:///mnt/vss/_work/1/same-version-c93b354fd9c14905bb574a8834c4d69b/specification/dev"
    ️️✔️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.4) new version base version
    package-2023-07-01-preview package-2023-07-01-preview(eac615d) package-2023-07-01-preview(main)

    The following errors/warnings exist before current PR submission:

    Rule Message
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'DevBoxes' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L421
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L62
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L113
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L164
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L219
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L275
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L588
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L639
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L690
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Environments' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L735
    ⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L264
    ⚠️ OperationId OperationId for put method should contain both 'Create' and 'Update'
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L528
    ⚠️ SchemaTypeAndFormat Schema with type: number should specify format
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L592
    ⚠️ LongRunningOperationsOptionsValidator A LRO Post operation with return schema must have 'x-ms-long-running-operation-options' extension enabled.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L625
    ⚠️ SchemaTypeAndFormat Schema with type: number should specify format
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L653
    ⚠️ LongRunningOperationsOptionsValidator A LRO Post operation with return schema must have 'x-ms-long-running-operation-options' extension enabled.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L683
    ⚠️ SchemaTypeAndFormat Schema with type: number should specify format
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L714
    ⚠️ LongRunningOperationsOptionsValidator A LRO Post operation with return schema must have 'x-ms-long-running-operation-options' extension enabled.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L744
    ⚠️ SchemaTypeAndFormat Schema with type: number should specify format
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L772
    ⚠️ LongRunningOperationsOptionsValidator A LRO Post operation with return schema must have 'x-ms-long-running-operation-options' extension enabled.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L802
    ⚠️ SchemaTypeAndFormat Schema with type: number should specify format
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L830
    ⚠️ ListInOperationName Since operation response has model definition in array type, it should be of the form '_list'.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L1114
    ⚠️ SchemaNamesConvention Schema name should be Pascal case.
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L1742
    ⚠️ 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: Microsoft.DevCenter/preview/2023-07-01-preview/devbox.json#L2326
    ⚠️ SchemaTypeAndFormat Schema with type: number should specify format
    Location: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L280
    ⚠️ 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: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L997
    ⚠️ 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: Microsoft.DevCenter/preview/2023-07-01-preview/environments.json#L1001
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️SwaggerAPIView 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).
    ️️✔️PR Summary succeeded [Detail] [Expand]
    Validation passes for Summary.
    ️️✔️Automated merging requirements met succeeded [Detail] [Expand]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Aug 16, 2023

    Swagger pipeline restarted successfully, please wait for status update in this comment.

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Aug 16, 2023

    Generated ApiView

    Language Package Name ApiView Link
    Swagger Microsoft.DevCenter https://apiview.dev/Assemblies/Review/8ee082f857d34460a84cc512d56284ed

    @AzureRestAPISpecReview AzureRestAPISpecReview added BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required data-plane labels Aug 16, 2023
    @openapi-workflow-bot
    Copy link

    Hi @chrissmiller! 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 breaking changes process.
    This case applies even if:

    • The tool fails while it shouldn't, e.g. due to runtime exception, or incorrect detection of breaking changes.
    • You believe there is no need for you to request breaking change approval, for any reason. Such claims must be reviewed, and the process is the same.

    @chrissmiller
    Copy link
    Contributor Author

    Breaking change justification:

    • Runtime error is a known bug tracked by this issue
    • OperationId changes are for operations not included in any generated SDK yet; we are updating the IDs as part of the SDK generation/design process.

    @chrissmiller
    Copy link
    Contributor Author

    @jhendrixMSFT @scgbear @bexxx , would appreciate any review/next steps, provided justification/confirmation that the breaking change alert is a false alarm above (since SDKs have not been generated, and this change is a prereq for SDK gen for us).

    @jhendrixMSFT jhendrixMSFT added Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 and removed BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required labels Aug 30, 2023
    @jhendrixMSFT jhendrixMSFT merged commit e1faef4 into main Aug 30, 2023
    @jhendrixMSFT jhendrixMSFT deleted the chrismiller/sdkOperationName branch August 30, 2023 16:35
    @openapi-pipeline-app
    Copy link

    Swagger pipeline restarted successfully, please wait for status update in this comment.

    jnlycklama pushed a commit that referenced this pull request Nov 8, 2023
    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 data-plane
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants