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

Fix Swagger Correctness and Linting Issues for Microsoft.AAD/DomainServices #11994

Merged
merged 7 commits into from
Dec 18, 2020
Merged

Conversation

jihochang
Copy link
Contributor

@jihochang jihochang commented Dec 7, 2020

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

Changelog

Please ensure to add changelog with 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 you are targeting to deploy new service/feature to public regions? Please provide date, or month to public if date is not available yet.
  3. When you expect to publish swagger? Please provide date, or month to public if date is not available yet.
  4. If it's an update to existing version, please select SDKs of specific language and CLIs that require refresh after swagger is published.
    • SDK of .NET (need service team to ensure code readiness)
    • SDK of Python
    • SDK of Java
    • SDK of Js
    • SDK of Go
    • PowerShell
    • CLI
    • Terraform
    • No, no need to refresh for updates in this PR

Contribution checklist:

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

ARM API Review Checklist

  • Ensure to check this box if one of the following scenarios meet updates in the PR, so that label “WaitForARMFeedback” will be added automatically to involve ARM API Review. Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs, all “removals” and “adding a new property” no more require ARM API review.

    • Adding new API(s)
    • Adding a new API version
    • Adding a new service
  • Please 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 there are following updates in the PR, ensure to request an approval from API Review Board as defined in the Breaking Change Policy.

  • Removing API(s) in stable version
  • Removing properties in stable version
  • Removing API version(s) in stable version
  • Updating API in stable version with Breaking Change Validation errors
  • Updating API(s) in preview over 1 year

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.

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

Update to use 2020-01 as the default package
Update default values for ldapsSetting and domainSecurity
Update default values for domainSecurity and ldapsSettings
Add type and format for Version property
Add type and format for Version property
@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Dec 7, 2020

Swagger Validation Report

️❌BreakingChange: 40 Errors, 0 Warnings failed [Detail] Only 10 items are listed, please refer to log for more details.

Rule Message
1023 - TypeFormatChanged The new version has a different format than the previous one.
New: Microsoft.AAD/stable/2017-06-01/domainservices.json#L431:9
Old: Microsoft.AAD/stable/2017-06-01/domainservices.json#L431:9
1023 - TypeFormatChanged The new version has a different format than the previous one.
New: Microsoft.AAD/stable/2020-01-01/domainservices.json#L431:9
Old: Microsoft.AAD/stable/2020-01-01/domainservices.json#L431:9
1023 - TypeFormatChanged The new version has a different format than the previous one.
New: Microsoft.AAD/stable/2017-06-01/domainservices.json#L431:9
Old: Microsoft.AAD/stable/2017-06-01/domainservices.json#L431:9
1023 - TypeFormatChanged The new version has a different format than the previous one.
New: Microsoft.AAD/stable/2020-01-01/domainservices.json#L431:9
Old: Microsoft.AAD/stable/2020-01-01/domainservices.json#L431:9
1027 - DefaultValueChanged The new version has a different default value than the previous one.
New: Microsoft.AAD/stable/2017-06-01/domainservices.json#L797:9
Old: Microsoft.AAD/stable/2017-06-01/domainservices.json#L789:9
1027 - DefaultValueChanged The new version has a different default value than the previous one.
New: Microsoft.AAD/stable/2017-06-01/domainservices.json#L810:9
Old: Microsoft.AAD/stable/2017-06-01/domainservices.json#L801:9
1027 - DefaultValueChanged The new version has a different default value than the previous one.
New: Microsoft.AAD/stable/2017-06-01/domainservices.json#L823:9
Old: Microsoft.AAD/stable/2017-06-01/domainservices.json#L813:9
1027 - DefaultValueChanged The new version has a different default value than the previous one.
New: Microsoft.AAD/stable/2017-06-01/domainservices.json#L836:9
Old: Microsoft.AAD/stable/2017-06-01/domainservices.json#L825:9
1027 - DefaultValueChanged The new version has a different default value than the previous one.
New: Microsoft.AAD/stable/2020-01-01/domainservices.json#L850:9
Old: Microsoft.AAD/stable/2020-01-01/domainservices.json#L840:9
1027 - DefaultValueChanged The new version has a different default value than the previous one.
New: Microsoft.AAD/stable/2020-01-01/domainservices.json#L837:9
Old: Microsoft.AAD/stable/2020-01-01/domainservices.json#L828:9
️️✔️LintDiff succeeded [Detail] [Expand]
Validation passes for LintDiff.

️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️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.
Posted by Swagger Pipeline | How to fix these errors?

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Dec 7, 2020

Swagger Generation Artifacts

️️✔️ azure-sdk-for-go succeeded [Detail] [Expand]
  • ️✔️Succeeded [Logs]Release - Generate from 394ab55. 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
  • ️✔️domainservices/mgmt/2020-01-01/aad [View full logs]  [Release SDK Changes]
    info	[Changelog] ## Struct Changes
    info	[Changelog]
    info	[Changelog] ### New Structs
    info	[Changelog]
    info	[Changelog] 1. MigrationProgress
    info	[Changelog] 1. MigrationProperties
    info	[Changelog]
    info	[Changelog] ### New Struct Fields
    info	[Changelog]
    info	[Changelog] 1. DomainServiceProperties.MigrationProperties
    info	[Changelog]
  • ️✔️domainservices/mgmt/2017-06-01/aad [View full logs]  [Release SDK Changes]
    info	[Changelog] ## Struct Changes
    info	[Changelog]
    info	[Changelog] ### New Structs
    info	[Changelog]
    info	[Changelog] 1. MigrationProgress
    info	[Changelog] 1. MigrationProperties
    info	[Changelog]
    info	[Changelog] ### New Struct Fields
    info	[Changelog]
    info	[Changelog] 1. DomainServiceProperties.MigrationProperties
    info	[Changelog]
  • ️✔️domainservices/mgmt/2017-01-01/aad [View full logs]  [Release SDK Changes]
    info	[Changelog] No exported changes
️️✔️ azure-sdk-for-net succeeded [Detail] [Expand]
  • ️✔️Succeeded [Logs]Release - Generate from 394ab55. 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/domainservices/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.DomainServices [View full logs]  [Release SDK Changes]
    warn	Skip artifact folder because it doesn't exist: artifacts/packages
️️✔️ azure-sdk-for-js succeeded [Detail] [Expand]
  • ️✔️Succeeded [Logs]Release - Generate from 394ab55. 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/domainservices/resource-manager/readme.md
  • ️✔️@azure/arm-domainservices [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/domainservicesManagementClient.js → ./dist/arm-domainservices.js...
    cmderr	[npmPack] created ./dist/arm-domainservices.js in 312ms
️️✔️[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

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

Copy link
Member

@evelyn-ys evelyn-ys left a comment

Choose a reason for hiding this comment

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

Little concern when authoring CLI
Shall migrationProperties under domainserviceProperties be marked as read-only?
definition code:

    "DomainServiceProperties": {
      "description": "Properties of the Domain Service.",
      "properties": {
        ...
        "migrationProperties": {
          "$ref": "#/definitions/MigrationProperties",
          "description": "Migration Properties"
        },
        ...
      }
    },
    ...
    "MigrationProperties": {
      "description": "Migration Properties",
      "properties": {
        "oldSubnetId": {
          "type": "string",
          "description": "Old Subnet Id"
        },
        "oldVnetSiteId": {
          "type": "string",
          "description": "Old Vnet Site Id"
        },
        "migrationProgress": {
          "$ref": "#/definitions/MigrationProgress",
          "description": "Migration Progress"
        }
      }
    },
    "MigrationProgress": {
      "description": "Migration Progress",
      "properties": {
        "completionPercentage": {
          "type": "number",
          "format": "double",
          "description": "Completion Percentage"
        },
        "progressMessage": {
          "type": "string",
          "description": "Progress Message"
        }
      }
    },

It seems not some property which can be set or modified by any PUT operation.

@jihochang
Copy link
Contributor Author

Little concern when authoring CLI
Shall migrationProperties under domainserviceProperties be marked as read-only?
definition code:

    "DomainServiceProperties": {
      "description": "Properties of the Domain Service.",
      "properties": {
        ...
        "migrationProperties": {
          "$ref": "#/definitions/MigrationProperties",
          "description": "Migration Properties"
        },
        ...
      }
    },
    ...
    "MigrationProperties": {
      "description": "Migration Properties",
      "properties": {
        "oldSubnetId": {
          "type": "string",
          "description": "Old Subnet Id"
        },
        "oldVnetSiteId": {
          "type": "string",
          "description": "Old Vnet Site Id"
        },
        "migrationProgress": {
          "$ref": "#/definitions/MigrationProgress",
          "description": "Migration Progress"
        }
      }
    },
    "MigrationProgress": {
      "description": "Migration Progress",
      "properties": {
        "completionPercentage": {
          "type": "number",
          "format": "double",
          "description": "Completion Percentage"
        },
        "progressMessage": {
          "type": "string",
          "description": "Progress Message"
        }
      }
    },

It seems not some property which can be set or modified by any PUT operation.

Both of these are not readonly properties.

@JeffreyRichter JeffreyRichter added the Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 label Dec 9, 2020
@jihochang
Copy link
Contributor Author

Little concern when authoring CLI
Shall migrationProperties under domainserviceProperties be marked as read-only?
definition code:

    "DomainServiceProperties": {
      "description": "Properties of the Domain Service.",
      "properties": {
        ...
        "migrationProperties": {
          "$ref": "#/definitions/MigrationProperties",
          "description": "Migration Properties"
        },
        ...
      }
    },
    ...
    "MigrationProperties": {
      "description": "Migration Properties",
      "properties": {
        "oldSubnetId": {
          "type": "string",
          "description": "Old Subnet Id"
        },
        "oldVnetSiteId": {
          "type": "string",
          "description": "Old Vnet Site Id"
        },
        "migrationProgress": {
          "$ref": "#/definitions/MigrationProgress",
          "description": "Migration Progress"
        }
      }
    },
    "MigrationProgress": {
      "description": "Migration Progress",
      "properties": {
        "completionPercentage": {
          "type": "number",
          "format": "double",
          "description": "Completion Percentage"
        },
        "progressMessage": {
          "type": "string",
          "description": "Progress Message"
        }
      }
    },

It seems not some property which can be set or modified by any PUT operation.

Both of these are not readonly properties.

I think migrationProperties should be marked as readonly. Let me make that change here.

@weidongxu-microsoft
Copy link
Member

@jihochang
You seems to be waiting for reviewers. Ping me when you need this merged.

Copy link
Member

@evelyn-ys evelyn-ys left a comment

Choose a reason for hiding this comment

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

Some other concerns:

  • Shall etag property under Resource be readOnly? It seems operation time returned from server.
  • Do sku property under DomainServiceProperties have some allowed values? Shall we add an enum list for it? Same question for domainConfigurationType under DomainServiceProperties
  • Is resourceForset property under ResourceForestSettings name or type? Is there any enum values for it if it means resource forest type?

@jihochang
Copy link
Contributor Author

jihochang commented Dec 18, 2020

@weidongxu-microsoft Could we get this PR merged? Additional requests by @evelyn-ys will be in a separate PR.

Copy link
Member

@evelyn-ys evelyn-ys left a comment

Choose a reason for hiding this comment

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

After discussion offline, enum definition will be updated in next version.

giromm2ms pushed a commit to giromm2ms/azure-rest-api-specs that referenced this pull request Dec 20, 2020
…rvices (Azure#11994)

* Update readme.md

Update to use 2020-01 as the default package

* Update domainservices.json

Update default values for ldapsSetting and domainSecurity

* Update domainservices.json

Update default values for domainSecurity and ldapsSettings

* Update domainservices.json

Add type and format for Version property

* Update domainservices.json

Add type and format for Version property

* Mark MigrationProperties as readonly

* Update MigrationProperties as readonly
josuhazure pushed a commit to josuhazure/azure-rest-api-specs that referenced this pull request Jan 6, 2021
…rvices (Azure#11994)

* Update readme.md

Update to use 2020-01 as the default package

* Update domainservices.json

Update default values for ldapsSetting and domainSecurity

* Update domainservices.json

Update default values for domainSecurity and ldapsSettings

* Update domainservices.json

Add type and format for Version property

* Update domainservices.json

Add type and format for Version property

* Mark MigrationProperties as readonly

* Update MigrationProperties as readonly
@metaxasa
Copy link

@evelyn-ys it doesn't seem that there was ever a follow up PR to fix the resourceForest issue... Is this property documented anywhere? What are the allowed / expected values?

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants