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

AppServicePlans.json 2022-09-01- Duplicate model name in spec #23709

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jackofallops
Copy link
Contributor

@jackofallops jackofallops commented Apr 25, 2023

The models for Create (PUT) and Update (PATCH) of Service Plans are different, but named the same making the parsing of the spec non-deterministic. These should have unique names within the spec.

{
"name": "appServicePlan",
"in": "body",
"description": "Details of the App Service plan.",
"required": true,
"schema": {
"$ref": "./CommonDefinitions.json#/definitions/AppServicePlan"
}
},

{
"name": "appServicePlan",
"in": "body",
"description": "Details of the App Service plan.",
"required": true,
"schema": {
"$ref": "#/definitions/AppServicePlanPatchResource"
}
},

fixes #23708

ARM API Information (Control Plane)

MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.

Azure 1st Party Service can try out the Shift Left experience to initiate API design review from ADO code repo. If you are interested, may request engineering support by filling in with the form https://aka.ms/ShiftLeftSupportForm.

Changelog

Add a changelog entry for this PR by answering the following questions:

  1. What's the purpose of the update?
    • new service onboarding
    • new API version
    • update existing version for new feature
    • update existing version to fix swagger quality issue in s360
    • Other, please clarify
  2. When are you targeting to deploy the new service/feature to public regions? Please provide the date or, if the date is not yet available, the month.
  3. When do you expect to publish the swagger? Please provide date or, the the date is not yet available, the month.
  4. By default, Azure SDKs of all languages (.NET/Python/Java/JavaScript for both management-plane SDK and data-plane SDK, Go for management-plane SDK only ) MUST be refreshed with/after swagger of new version is published. If you prefer NOT to refresh any specific SDK language upon swagger updates in the current PR, please leave details with justification here.

Contribution checklist (MS Employees Only):

If any further question about AME onboarding or validation tools, please view the FAQ.

ARM API Review Checklist

Applicability: ⚠️

If your changes encompass only the following scenarios, you should SKIP this section, as these scenarios do not require ARM review.

  • Change to data plane APIs
  • Adding new properties
  • All removals

Otherwise your PR may be subject to ARM review requirements. Complete the following:

  • Check this box if any of the following apply to the PR so that the label "ARMReview" and "WaitForARMFeedback" will be added by bot to kick off ARM API Review. Missing to check this box in the following scenario may result in delays to the ARM manifest review and deployment.

    • Adding a new service
    • Adding new API(s)
    • Adding a new API version
      -[ ] To review changes efficiently, ensure you copy the existing version into the new directory structure for first commit and then push new changes, including version updates, in separate commits. You can use OpenAPIHub to initialize the PR for adding a new version. For more details refer to the wiki.
  • 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 you have any breaking changes as defined in the Breaking Change Policy, request approval from the Breaking Change Review Board.

Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Additional details on the process and office hours are on the Breaking Change Wiki.

NOTE: To update API(s) in public preview for over 1 year (refer to Retirement of Previews)

Please follow the link to find more details on PR review process.

fixes #23708

@openapi-workflow-bot
Copy link

Hi, @jackofallops 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 Apr 25, 2023

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

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Apr 25, 2023

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

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Apr 25, 2023

    Swagger pipeline restarted successfully. If there is ApiView generated, it will be updated in this comment.

    @ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Apr 25, 2023
    @ghost
    Copy link

    ghost commented Apr 25, 2023

    Thank you for your contribution jackofallops! We will review the pull request and get back to you soon.

    @openapi-workflow-bot
    Copy link

    Hi @jackofallops, 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 @jackofallops, 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.

    @jackofallops
    Copy link
    Contributor Author

    @microsoft-github-policy-service agree company="Hashicorp"

    @v-jiaodi
    Copy link
    Member

    @jackofallops Please fill in the correct checkboxes in the first comment so we can get a quick overview of what's going on with this PR and make sure you've understood the relevant linked docs.

    @v-jiaodi
    Copy link
    Member

    /azp run

    @azure-pipelines
    Copy link

    Azure Pipelines successfully started running 1 pipeline(s).

    @navba-MSFT
    Copy link
    Contributor

    @jackofallops Please fill in the correct checkboxes in the first comment so we can get a quick overview of what's going on with this PR and make sure you've understood the relevant linked docs.

    @jackofallops Could you please follow this suggestion ?

    @jackofallops
    Copy link
    Contributor Author

    @jackofallops Please fill in the correct checkboxes in the first comment so we can get a quick overview of what's going on with this PR and make sure you've understood the relevant linked docs.

    @jackofallops Could you please follow this suggestion ?

    Hi @navba-MSFT - The referenced comment was made at 5am my time (UK), so I've only just seen it. I'm not a Microsoft employee, so do not have access to the links in the first comment, and the section is for MSFT employees only? Can you be more specific about the additional information needed? The issue describes the problem, and this PR is a self-explanatory change to address a violation in the spec, but I'm happy to provide additional info as required or make amendments to the PR as needed?

    Thanks!

    @navba-MSFT
    Copy link
    Contributor

    @jackofallops Please fill in the correct checkboxes in the first comment so we can get a quick overview of what's going on with this PR and make sure you've understood the relevant linked docs.

    @jackofallops Could you please follow this suggestion ?

    Hi @navba-MSFT - The referenced comment was made at 5am my time (UK), so I've only just seen it. I'm not a Microsoft employee, so do not have access to the links in the first comment, and the section is for MSFT employees only? Can you be more specific about the additional information needed? The issue describes the problem, and this PR is a self-explanatory change to address a violation in the spec, but I'm happy to provide additional info as required or make amendments to the PR as needed?

    Thanks!

    @jackofallops Please update the PR description here.

    @jackofallops
    Copy link
    Contributor Author

    jackofallops commented Apr 26, 2023

    @jackofallops Please fill in the correct checkboxes in the first comment so we can get a quick overview of what's going on with this PR and make sure you've understood the relevant linked docs.

    @jackofallops Could you please follow this suggestion ?

    Hi @navba-MSFT - The referenced comment was made at 5am my time (UK), so I've only just seen it. I'm not a Microsoft employee, so do not have access to the links in the first comment, and the section is for MSFT employees only? Can you be more specific about the additional information needed? The issue describes the problem, and this PR is a self-explanatory change to address a violation in the spec, but I'm happy to provide additional info as required or make amendments to the PR as needed?
    Thanks!

    @jackofallops Please update the PR description here.

    Hi @navba-MSFT - I'd be happy to. Can you please be specific about what is necessary to be updated? I have completed all I that I am instructed to in the template, and having checked many other open PRs none have any further information than I have provided. Please elaborate.

    @jackofallops I have updated the PR description

    @navba-MSFT navba-MSFT changed the title update Patch model name AppServicePlans.json 2022-09-01- Duplicate model name in spec Apr 27, 2023
    @navba-MSFT
    Copy link
    Contributor

    @v-jiaodi @naveedaz Could you please review this PR once you get a chance ? Thanks in advance.

    @v-jiaodi
    Copy link
    Member

    @JeffreyRichter Could you help take a look at the breaking change of this PR ? Thanks

    @JeffreyRichter
    Copy link
    Member

    Ideally, the models for PUT and PATCH are identical. This way, a customer could create and initialize a struct via an SDK and then pass that to either a PUT or PATCH method. Or call a GET (which returns an initialized struct) and then pass that to PUT or PATCH. It seems to me that you are purposely making the models different.

    That being said, if the service has already GA'd then we don't want to introduce a breaking change. So is this change correcting the swagger to make it accurately reflect the currently-shipping service behavior?

    Copy link
    Member

    @weidongxu-microsoft weidongxu-microsoft left a comment

    Choose a reason for hiding this comment

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

    Comment added. The "name" of body parameter seems cosmetic.

    Also, should you target the next api-version release branch? e.g. as #23567

    @@ -279,7 +279,7 @@
    "type": "string"
    },
    {
    "name": "appServicePlan",
    "name": "appServicePlanPatch",
    Copy link
    Member

    @weidongxu-microsoft weidongxu-microsoft Apr 28, 2023

    Choose a reason for hiding this comment

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

    the change of "name" on body parameter seems unnecessary, as probably only python uses the "name" (it won't affect REST API -- body is body, but it may break SDK if they indeed uses the "name" of body).

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    This makes the SDK generation non-deterministic? If this is used as is, the wrong model will be selected (without some override) in some languages SDKs (Python/Go etc). So the PATCH will use the PUT model here, so this is correcting this. This should have a unique name in this spec as it refers to a different model to the PUT, as @JeffreyRichter called out above:

    That being said, if the service has already GA'd then we don't want to introduce a breaking change. So is this change correcting the swagger to make it accurately reflect the currently-shipping service behavior?

    Ideally, we'd not want this to refer to another model, as this doesn't match standard behaviour in this and other APIs, but if there's legitimate reason not to, we should update here for the name to be unique?

    Copy link
    Member

    @weidongxu-microsoft weidongxu-microsoft May 5, 2023

    Choose a reason for hiding this comment

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

    This is a parameter name, not a model name.

    The model is here (which is the correct one AppServicePlanPatchResource?)

    "schema": {
    "$ref": "#/definitions/AppServicePlanPatchResource"
    }

    This model will be used whatever the parameter name.


    I know Java don't need this change (though it won't break as well; probably same for .NET). API signature would be patch(String, String, ..., AppServicePlanPatchResource), parameter name would not show anywhere.

    Add @msyyc for Python, @tadelesh for Go.

    @jackofallops If this change is intended for SDK, do talk to SDK owners. I've already added them above.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    @jackofallops Could you please let us know the intended SDK ? Depending on that we can tag the right SDK owners.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    @navba-MSFT this change is for github.com/hashicorp/go-azure-sdk (so we'd be the owners/folks to tag there, fwiw)

    Copy link
    Member

    Choose a reason for hiding this comment

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

    It will not break Azure Go SDK. But it is labeled as a swagger breaking change (though I don't think it will break payload), it's better to get approval from Jeff.

    Copy link
    Member

    Choose a reason for hiding this comment

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

    Here's what I think is happening: Today, there is an SDK-only method parameter named appServicePlan and there is desire to change this name to appServicePlanPatch. I'm not sure why this desire exists but the only real language it might affect is C#; not Go. And this has such a small chance of breaking .NET that we'd approve it. But I don't understand the motivation for making this change?

    Do I have this right?

    @v-jiaodi
    Copy link
    Member

    /azp run

    @azure-pipelines
    Copy link

    Azure Pipelines successfully started running 1 pipeline(s).

    Copy link

    Next Steps to Merge

    Next steps that must be taken to merge this PR:
    • ❌ Your PR has at least one breaking change (label: BreakingChangeReviewRequired). See the PR description for help.
    • ❌ The required check named Swagger BreakingChange has failed. Refer to the check in the PR's 'Checks' tab for details on how to fix it. In addition, refer to step 1 in the PR workflow diagram (even if your PR is for data plane, not ARM).

    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 customer-reported Issues that are reported by GitHub users external to the Azure organization. FixS360 resource-manager Web Apps
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    AppServicePlans.json 2022-09-01- Duplicate model name in spec
    10 participants