Skip to content

[Search] Add client names for ResetSkills and ResetDocs#16222

Merged
lmazuel merged 6 commits intomainfrom
mohitc/AddClientNamesForCodeGen
Sep 30, 2021
Merged

[Search] Add client names for ResetSkills and ResetDocs#16222
lmazuel merged 6 commits intomainfrom
mohitc/AddClientNamesForCodeGen

Conversation

@Mohit-Chakraborty
Copy link
Contributor

Without any name provided in the spec, CodeGen sets names like "Paths1Ju2XepSkillsetsSkillsetnameSearchResetskillsPostRequestbodyContentApplicationJsonSchema" and "Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema"

@openapi-workflow-bot
Copy link

Hi, @Mohit-Chakraborty 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. vsswagger@microsoft.com

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Sep 29, 2021

    Swagger Validation Report

    ️⚠️BreakingChange: 1 Warnings warning [Detail]
    Rule Message
    ⚠️ 1026 - TypeChanged The new version has a different type 'object' than the previous one ''.
    New: Azure.Search/preview/2021-04-30-Preview/searchservice.json#L1064:13
    Old: Azure.Search/preview/2021-04-30-Preview/searchservice.json#L1063:13
    ️⚠️LintDiff: 0 Warnings warning [Detail]
    The following errors/warnings exist before current PR submission:
    Rule Message
    ⚠️ R2007 - LongRunningOperationsWithLongRunningExtension The operation 'Indexers_Run' returns 202 status code, which indicates a long running operation, please enable 'x-ms-long-running-operation.
    Location: Azure.Search/preview/2021-04-30-Preview/searchservice.json#L413
    ⚠️ R4000 - ParameterDescriptionRequired 'keysOrIds' parameter lacks 'description' property. Consider adding a 'description' element. Accurate description is essential for maintaining reference documentation.
    Location: Azure.Search/preview/2021-04-30-Preview/searchservice.json#L358
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️ModelValidation succeeded [Detail] [Expand]
    Validation passes for ModelValidation.
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️️✔️Cross-Version Breaking Changes succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️️✔️[Staging] SDK Track2 Validation succeeded [Detail] [Expand]
    Validation passes for SDKTrack2Validation

    ️️✔️[Staging] PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️[Staging] SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    ️️✔️[Staging] Lint(RPaaS) succeeded [Detail] [Expand]
    Validation passes for Lint(RPaaS).
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-workflow-bot
    Copy link

    [Call for Action] To better understand Azure service dev/test scenario, and support Azure service developer better on Swagger and REST API related tests in early phase, please help to fill in with this survey https://aka.ms/SurveyForEarlyPhase. It will take 5 to 10 minutes. If you already complete survey, please neglect this comment. Thanks.

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Sep 29, 2021

    Swagger Generation Artifacts

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

    Breaking Changes Tracking

    ️❌ azure-sdk-for-net-track2 failed [Detail]
    • Failed [Logs]Release - Generate from 4e3ae66. 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	File azure-sdk-for-net_tmp/initOutput.json not found to read
      command	pwsh ./eng/scripts/Automation-Sdk-Generate.ps1 ../azure-sdk-for-net_tmp/generateInput.json ../azure-sdk-for-net_tmp/generateOutput.json
      cmderr	[Automation-Sdk-Generate.ps1] �[91mWrite-Error: �[91mError occurred while generating artifacts for Azure.Search.Documents
      cmderr	[Automation-Sdk-Generate.ps1] �[0m
    • Azure.Search.Documents [View full logs]  [Release SDK Changes]
      info	[Changelog]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-workflow-bot
    Copy link

    Hi @Mohit-Chakraborty, Your PR has some issues. Please fix the CI sequentially by following the order of Avocado, semantic validation, model validation, breaking change, lintDiff.

    TaskHow to fixPrioritySupport (Microsoft alias)
    AvocadoFix-AvocadoHighruowan
    Semantic validationFix-SemanticValidation-ErrorHighraychen, jianyxi
    Model validationFix-ModelValidation-ErrorHighraychen,jianyxi
    LintDiffFix-LintDiffhighjianyxi, ruoxuan
    If you need further help, please feedback via swagger feedback."

    @@ -1061,6 +1062,8 @@
    "in": "body",
    "required": true,
    "schema": {
    Copy link
    Contributor Author

    @Mohit-Chakraborty Mohit-Chakraborty Sep 29, 2021

    Choose a reason for hiding this comment

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

    Still not happy with this part.
    This generates a class with an IList as its only property -

        public partial class SkillNames
        {
            /// <summary> Initializes a new instance of SkillNames. </summary>
            public SkillNames()
            {
                SkillNamesValue = new ChangeTrackingList<string>();
            }
    
            /// <summary> the names of skills to be reset. </summary>
            public IList<string> SkillNamesValue { get; }
        }
    

    Looking for ways to have this parameter as a list itself. Can we do that without breaking the service protocol?

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    I agree it doesn't seem to warrant its own type. @shuyangmsft ?

    Copy link
    Member

    Choose a reason for hiding this comment

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

    @Mohit-Chakraborty If you want to add skillNames as a parameter directly. You can add skillNames parameter like-

    {
          "name": "skillNames",
           "in": "body",
           "required": true,
           "schema": {
              "type": "array",
               "items": {
               "type": "string"
                 }
            },
           "description": "The names of skills to reset."
    }
    

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Thanks @ShivangiReja. Do you know if this will be a breaking change for the service?

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    ❌ 1033 - RemovedProperty The new version is missing a property found in the old version. Was 'skillNames' renamed or removed?Old: Azure.Search/preview/2021-04-30-Preview/searchservice.json#L1064:15

    Validation tells me this is a breaking change.

    Copy link
    Contributor Author

    @Mohit-Chakraborty Mohit-Chakraborty Sep 29, 2021

    Choose a reason for hiding this comment

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

    So, we should probably make this change in the client to make things look better.

    Copy link
    Member

    Choose a reason for hiding this comment

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

    It looks like a breaking change, since previously user was passing the object type in the method and now with this change user will have to pass the list.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    I reverted the change.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    I still have an error -

    ❌ INVALID_TYPE Expected type object but found type arrayUrl: Azure.Search/preview/2021-04-30-Preview/searchservice.json#L1064

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Finally managed to fix all validation errors. The above error was due to a discrepancy between the spec and the example for the ResetSkills operation. I updated the example to follow the design of the spec.

    @openapi-workflow-bot
    Copy link

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

    @Mohit-Chakraborty
    Copy link
    Contributor Author

    cc: @tg-msft

    @Mohit-Chakraborty
    Copy link
    Contributor Author

    @anuchandy, @lmazuel can we merge this PR please.

    @lmazuel lmazuel merged commit 4e3ae66 into main Sep 30, 2021
    @lmazuel lmazuel deleted the mohitc/AddClientNamesForCodeGen branch September 30, 2021 22:06
    jovannikolov-msft pushed a commit to jovannikolov-msft/azure-rest-api-specs that referenced this pull request Dec 1, 2021
    * Add client names for ResetSkills and ResetDocs
    
    * Make 'skillNames' a list of items and not a class with a list property
    
    * Revert "Make 'skillNames' a list of items and not a class with a list property"
    
    This reverts commit 439d1ae.
    
    * Remove outer 'description' property
    
    * Revert "Remove outer 'description' property"
    
    This reverts commit f2896cd.
    
    * Try to fix the example as per the spec
    LeiWang3 pushed a commit to LeiWang3/azure-rest-api-specs that referenced this pull request Mar 31, 2022
    * Add client names for ResetSkills and ResetDocs
    
    * Make 'skillNames' a list of items and not a class with a list property
    
    * Revert "Make 'skillNames' a list of items and not a class with a list property"
    
    This reverts commit 439d1ae.
    
    * Remove outer 'description' property
    
    * Revert "Remove outer 'description' property"
    
    This reverts commit f2896cd.
    
    * Try to fix the example as per the spec
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    5 participants