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

Linting and Completeness fixes S360 #11958

Merged
merged 18 commits into from
Dec 17, 2020
Merged

Linting and Completeness fixes S360 #11958

merged 18 commits into from
Dec 17, 2020

Conversation

navysingla
Copy link
Contributor

Swagger validation team added some new validations which triggered S360 on our team for old versions. Fixing swaggers for older versions to remove S360

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Dec 4, 2020

Swagger Validation Report

️️✔️BreakingChange succeeded [Detail] [Expand]
There are no breaking changes.

️⚠️LintDiff: 3 Warnings warning [Detail]

Rule Message
⚠️ R2007 - LongRunningOperationsWithLongRunningExtension The operation 'SubscriptionOperation_Get' returns 202 status code, which indicates a long running operation, please enable 'x-ms-long-running-operation.
New: Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json#L50
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'SubscriptionOperationModel'. Consider using the plural form of 'SubscriptionOperation' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json#L52
⚠️ R4030 - UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: getPendingSubscriptionOperations
New: Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json#L53
️⚠️Avocado: 1 Warnings warning [Detail]
Rule Message
⚠️ MULTIPLE_API_VERSION The default tag contains multiple API versions swaggers.
readme: specification/subscription/resource-manager/readme.md
tag: specification/subscription/resource-manager/readme.md#tag-package-2020-09
️️✔️ModelValidation succeeded [Detail] [Expand]
Validation passes for ModelValidation.
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️[Staging] Cross Version BreakingChange (Base on preview version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️[Staging] Cross Version BreakingChange (Base on stable version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️CredScan succeeded [Detail] [Expand]
There is no credential detected.
Posted by Swagger Pipeline | How to fix these errors?

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Dec 4, 2020

Swagger Generation Artifacts

️️✔️ azure-sdk-for-go succeeded [Detail] [Expand]
  • ️✔️Succeeded [Logs]Release - Generate from adfab43. SDK Automation 14.0.0
    command	sh ./initScript.sh ../../../../../azure-sdk-for-go_tmp/initInput.json ../../../../../azure-sdk-for-go_tmp/initOutput.json
    command	go run ./tools/generator/main.go ../../../../../azure-sdk-for-go_tmp/generateInput.json ../../../../../azure-sdk-for-go_tmp/generateOutput.json
  • ️✔️subscription/mgmt/2020-09-01/subscription [View full logs]  [Release SDK Changes]
    info	[Changelog] No exported changes
  • ️✔️preview/subscription/mgmt/2019-10-01-preview/subscription [View full logs]  [Release SDK Changes]
    info	[Changelog] No exported changes
  • ️✔️preview/subscription/mgmt/2018-03-01-preview/subscription [View full logs]  [Release SDK Changes]
    info	[Changelog] ### New Funcs
    info	[Changelog]
    info	[Changelog] 1. NewOperationClient() OperationClient
    info	[Changelog] 1. NewOperationClientWithBaseURI(string) OperationClient
    info	[Changelog] 1. OperationClient.Get(context.Context, string) (CreationResult, error)
    info	[Changelog] 1. OperationClient.GetPreparer(context.Context, string) (*http.Request, error)
    info	[Changelog] 1. OperationClient.GetResponder(*http.Response) (CreationResult, error)
    info	[Changelog] 1. OperationClient.GetSender(*http.Request) (*http.Response, error)
    info	[Changelog]
    info	[Changelog] ## Struct Changes
    info	[Changelog]
    info	[Changelog] ### New Structs
    info	[Changelog]
    info	[Changelog] 1. ErrorResponseBody
    info	[Changelog] 1. OperationClient
    info	[Changelog]
  • ️✔️preview/subscription/mgmt/2017-11-01-preview/subscription [View full logs]  [Release SDK Changes]
    info	[Changelog] No exported changes
️️✔️ azure-sdk-for-net succeeded [Detail] [Expand]
  • ️✔️Succeeded [Logs]Release - Generate from adfab43. SDK Automation 14.0.0
    warn	Skip initScript due to not configured
    command	sudo apt-get install -y dotnet-sdk-5.0
    command	autorest --version=V2 --csharp --reflect-api-versions --license-header=MICROSOFT_MIT_NO_VERSION --use=@microsoft.azure/autorest.csharp@2.3.82 --csharp-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-net/sdk ../azure-rest-api-specs/specification/subscription/resource-manager/readme.md
    cmderr	[Autorest] realpath(): Permission denied
    cmderr	[Autorest] realpath(): Permission denied
    cmderr	[Autorest] realpath(): Permission denied
    cmderr	[Autorest] realpath(): Permission denied
    cmderr	[Autorest] realpath(): Permission denied
    cmderr	[Autorest] realpath(): Permission denied
  • ️✔️Microsoft.Azure.Management.Subscription [View full logs]  [Release SDK Changes]
️️✔️ azure-resource-manager-schemas succeeded [Detail] [Expand]
  • ️✔️Succeeded [Logs]Release - Generate from adfab43. Schema Automation 14.0.0
    warn	Skip initScript due to not configured
    command	npx n 12
    command	autorest --use=@autorest/azureresourceschema@3.0.92 --version=3.0.6320 --azureresourceschema --multiapi --title=none --pass-thru:subset-reducer --azureresourceschema-folder=/home/vsts/work/1/s/azure-resource-manager-schemas/azure-resource-manager-schemas ../../azure-rest-api-specs/specification/subscription/resource-manager/readme.md
  • ️✔️subscription [View full logs]  [Release Schema Changes]
    cmderr	[resource-manager] node-pre-gyp
    cmderr	[resource-manager] WARN Using request for node-pre-gyp https download
    cmderr	[resource-manager]  template-schema-validation-tools@1.0.0 No repository field.
    cmderr	[resource-manager]  optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
    cmderr	[resource-manager] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
️️✔️ azure-cli-extensions succeeded [Detail] [Expand]
  • ️✔️Succeeded [Logs]Release - Generate from adfab43. Azure CLI Automation 14.0.0
    warn	Skip initScript due to not configured
    command	npx n 12
    command	python3 -m venv venv
    command	pip install --upgrade setuptools wheel pip
    command	pip install pathlib jinja2 msrestazure
    command	autorest --az --use=@autorest/az@latest --version=3.0.6271 --clear-output-folder=true --azure-cli-extension-folder=/home/vsts/work/1/s/azure-cli-extensions ../azure-rest-api-specs/specification/subscription/resource-manager/readme.md
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'Location' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'LocationListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'Subscription' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'SubscriptionPolicies' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'SubscriptionListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'TenantIdDescription' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'TenantListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'CanceledSubscriptionId' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'RenamedSubscriptionId' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'EnabledSubscriptionId' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'OperationListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'Operation-display' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'PutAliasRequestProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'PutAliasResponse' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'PutAliasResponseProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/SchemaMissingType): The schema 'PutAliasListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'
    cmdout	[Autorest] WARNING (PreCheck/CheckDuplicateSchemas): Checking for duplicate schemas, this could take a (long) while.  Run with --verbose for more detail.
    cmdout	[Autorest] WARNING (): cli.auto-parameter-hidden is not true, skip visibility cleaner
    cmderr	[Autorest] NO TEST SCENARIO PROVIDED - DEFAULT WILL BE USED
    cmderr	[Autorest] ADD FOLLOWING SECTION TO readme.cli.md FILE TO MODIFY IT
    cmderr	[Autorest] --------------------------------------------------------
    cmderr	[Autorest]   test-scenario:
    cmderr	[Autorest]     - name: /Alias/put/CreateAlias
    cmderr	[Autorest]     - name: /Alias/get/GetAlias
    cmderr	[Autorest]     - name: /Alias/get/GetAlias
    cmderr	[Autorest]     - name: /Alias/delete/DeleteAlias
    cmderr	[Autorest]     - name: /Subscriptions/get/getSubscription
    cmderr	[Autorest]     - name: /Subscriptions/get/listLocations
    cmderr	[Autorest]     - name: /Subscriptions/get/listSubscriptions
    cmderr	[Autorest]     - name: /Subscription/post/cancelSubscription
    cmderr	[Autorest]     - name: /Subscription/post/enableSubscription
    cmderr	[Autorest]     - name: /Subscription/post/renameSubscription
    cmderr	[Autorest]     - name: /Tenants/get/listTenants
    cmderr	[Autorest] --------------------------------------------------------
️️✔️ azure-sdk-for-js succeeded [Detail] [Expand]
  • ️✔️Succeeded [Logs]Release - Generate from adfab43. SDK Automation 14.0.0
    warn	Skip initScript due to not configured
    command	autorest --version=V2 --typescript --license-header=MICROSOFT_MIT_NO_VERSION --use=@microsoft.azure/autorest.typescript@4.4.4 --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js/azure-sdk-for-js ../../azure-rest-api-specs/specification/subscription/resource-manager/readme.md
  • ️✔️@azure/arm-subscriptions [View full logs]  [Release SDK Changes]
    cmderr	[npmPack] loaded rollup.config.js with warnings
    cmderr	[npmPack] (!) Unused external imports
    cmderr	[npmPack] default imported from external module 'rollup' but never used
    cmderr	[npmPack] ./esm/subscriptionClient.js → ./dist/arm-subscriptions.js...
    cmderr	[npmPack] created ./dist/arm-subscriptions.js in 241ms
️⚠️ azure-sdk-for-python warning [Detail]
  • ⚠️Warning [Logs]Release - Generate from adfab43. SDK Automation 14.0.0
    warn	Skip initScript due to not configured
    command	npx n 12
    command	python3 -m venv venv
    command	pip install --upgrade setuptools wheel pip
    command	pip install pathlib jinja2 msrestazure
    command	autorest --version=V2 --use=@microsoft.azure/autorest.python@~4.0.71 --python --python-mode=update --multiapi --keep-version-file --no-async --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk ../azure-rest-api-specs/specification/subscription/resource-manager/readme.md
    warn	No file changes detected after generation
    warn	No package detected after generation
️️✔️[Staging] ApiDocPreview succeeded [Detail] [Expand]
 Please click here to preview with your @microsoft account. 
Posted by Swagger Pipeline | How to fix these errors?

@openapi-workflow-bot
Copy link

NewApiVersionRequired reason:

A service’s API is a contract with customers and is represented by using the api-version query parameter. Changes such as adding an optional property to a request/response or introducing a new operation is a change to the service’s contract and therefore requires a new api-version value. This is critically important for documentation, client libraries, and customer support.

EXAMPLE: if a customer calls a service in the public cloud using api-version=2020-07-27, the new property or operation may exist but if they call the service in a government cloud, air-gapped cloud, or Azure Stack Hub cloud using the same api-version, the property or operation may not exist. Because there is no clear relationship between the service api-version and the new property/operation, customers can’t trust the documentation and Azure customer have difficulty helping customers diagnose issues. In addition, each client library version documents the service version it supports. When an optional property or new operation is added to a service and its Swagger, new client libraries must be produced to expose this functionality to customers. Without updating the api-version, it is unclear to customers which version of a client library supports these new features.

@openapi-workflow-bot
Copy link

Hi @navysingla, 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 think it is false positive breaking change, please provide the reasons in the PR comment, report to Swagger Tooling Team via https://aka.ma/swaggerfeedback.

@lirenhe
Copy link
Member

lirenhe commented Dec 8, 2020

Could you take a look at the lint issue? It seems in readme.md, you put preview/2018-11-01-preview/subscriptions.json and /preview/2018-03-01-preview/subscriptions.json together, which cause the conflict

Tag: package-2019-03-preview
These settings apply only when --tag=package-2019-03-preview is specified on the command line.

input-file:

  • Microsoft.Subscription/preview/2019-03-01-preview/subscriptions.json
  • Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json
  • Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json

@lirenhe lirenhe added the Reviewed-ChangesRequested <valid label in PR review process>add this label when assignee request changes after review label Dec 8, 2020
@navysingla
Copy link
Contributor Author

Could you take a look at the lint issue? It seems in readme.md, you put preview/2018-11-01-preview/subscriptions.json and /preview/2018-03-01-preview/subscriptions.json together, which cause the conflict

Tag: package-2019-03-preview
These settings apply only when --tag=package-2019-03-preview is specified on the command line.

input-file:

  • Microsoft.Subscription/preview/2019-03-01-preview/subscriptions.json
  • Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json
  • Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json

But in the past we have generated SDK with these versions together

@lirenhe lirenhe removed BreakingChangeReviewRequired Reviewed-ChangesRequested <valid label in PR review process>add this label when assignee request changes after review labels Dec 17, 2020
@lirenhe lirenhe merged commit adfab43 into Azure:master Dec 17, 2020
giromm2ms pushed a commit to giromm2ms/azure-rest-api-specs that referenced this pull request Dec 20, 2020
* New Version for subscription RP

* S360 fixes

* Update readme.md

* Update subscriptions.json

* Update subscriptions.json

* Update subscriptions.json
josuhazure pushed a commit to josuhazure/azure-rest-api-specs that referenced this pull request Jan 6, 2021
* New Version for subscription RP

* S360 fixes

* Update readme.md

* Update subscriptions.json

* Update subscriptions.json

* Update subscriptions.json
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.

2 participants