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

Ksvijayv/purview metadata policies initial #14938

Merged

Conversation

kshitizvijay
Copy link
Contributor

@kshitizvijay kshitizvijay commented Jun 22, 2021

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
    • Ensure to copy the existing version into new directory structure for first commit (including refactoring) and then push new changes including version updates in separate commits. This is required to review the changes efficiently.
    • 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 Breaking Change 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 or public preview version with Breaking Change Validation errors
  • Updating API(s) in public preview over 1 year (refer to Retirement of Previews)

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.

@openapi-workflow-bot
Copy link

Hi, @kshitizvijay 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-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 Jun 22, 2021

    Swagger Validation Report

    ️️✔️BreakingChange succeeded [Detail] [Expand]
    There are no breaking changes.
    ️⚠️LintDiff: 5 Warnings warning [Detail]
    The following errors/warnings are introduced by current PR:
    Rule Message
    ⚠️ R2001 - AvoidNestedProperties Consider using x-ms-client-flatten to provide a better end user experience
    Location: Azure.Analytics.Purview.MetadataPolicies/preview/2021-07-01/purviewMetadataPolicy.json#L388
    ⚠️ R2001 - AvoidNestedProperties Consider using x-ms-client-flatten to provide a better end user experience
    Location: Azure.Analytics.Purview.MetadataPolicies/preview/2021-07-01/purviewMetadataPolicy.json#L499
    ⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'MetadataPolicyModel'. Consider using the plural form of 'MetadataPolicy' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Azure.Analytics.Purview.MetadataPolicies/preview/2021-07-01/purviewMetadataPolicy.json#L59
    ⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'MetadataPolicyModel'. Consider using the plural form of 'MetadataPolicy' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Azure.Analytics.Purview.MetadataPolicies/preview/2021-07-01/purviewMetadataPolicy.json#L110
    ⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'MetadataPolicyModel'. Consider using the plural form of 'MetadataPolicy' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Azure.Analytics.Purview.MetadataPolicies/preview/2021-07-01/purviewMetadataPolicy.json#L168
    ️️✔️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-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jun 22, 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 1424fc4. 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
      warn	No file changes detected after generation
      error	Fatal error: packageFolderFromFileSearch not configured and could not be found in legacy config
      packageFolderFromFileSearch not configured and could not be found in legacy config
      Error: packageFolderFromFileSearch not configured and could not be found in legacy config
          at workflowDetectChangedPackages (/home/vsts/work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/automation/workflow.js:422:23)
          at workflowHandleReadmeMd (/home/vsts/work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/automation/workflow.js:168:11)
          at async Object.exports.workflowMain (/home/vsts/work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/automation/workflow.js:83:9)
          at async Object.exports.sdkAutoMain (/home/vsts/work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/automation/entrypoint.js:152:13)
          at async /home/vsts/work/1/a/unified-pipeline-runtime/private/openapi-sdk-automation/lib/cli/cli.js:20:18
    Posted by Swagger Pipeline | How to fix these errors?

    Copy link
    Member

    @jhendrixMSFT jhendrixMSFT left a comment

    Choose a reason for hiding this comment

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

    @jhendrixMSFT
    Copy link
    Member

    @JeffreyRichter @johanste has this been reviewed by the REST board?

    @markweitzel markweitzel added the APIStewardshipBoard-ReviewRequested This should be reviewed by the Azure API Stewardship team in partnership with the service team. label Jul 12, 2021
    @ghost
    Copy link

    ghost commented Aug 1, 2021

    Hi, @kshitizvijay. Your PR has no update for 14 days and it is marked as stale PR. If no further update for over 14 days, the bot will close the PR. If you want to refresh the PR, please remove no-recent-activity label.

    Copy link
    Member

    @mikekistler mikekistler left a comment

    Choose a reason for hiding this comment

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

    I left a number of comments, all minor but important to fix to get the best results from the SDK generators.

    @kshitizvijay
    Copy link
    Contributor Author

    @mikekistler

    I cannot understand the reason behind the SDK azure-sdk-for-net-track2 failure.
    The logs are not helping.

    @kshitizvijay
    Copy link
    Contributor Author

    @jhendrixMSFT
    I can't seem to pass this check.
    SDK azure-sdk-for-net-track2

    Who Can I contact to solve this?

    @jhendrixMSFT
    Copy link
    Member

    @kshitizvijay the azure-sdk-for-net-track2 isn't a required step, please ignore this failure for now.

    @mikekistler
    Copy link
    Member

    @jhendrixMSFT Why do we run checks that are not required? It seems like this only creates confusion and delay. If this check isn't required, can we remove it from list somehow? Are there other checks here that are not required?

    @jhendrixMSFT
    Copy link
    Member

    @nickzhums do you know the answers?

    @nickzhums
    Copy link
    Contributor

    this repo is maintained by Swagger tooling team. cc @josefree

    Copy link
    Member

    @mikekistler mikekistler left a comment

    Choose a reason for hiding this comment

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

    I found a few more small issues. The x-ms-error - x-ms-error-code is probably on me ... I think I had the wrong name in my earlier comment / suggested change. Sorry about that.

    Outside of these few minor changes, this looks good to me.

    "swagger": "2.0",
    "info": {
    "title": "Purview Metadata Policies Service REST API Document",
    "version": "2021-07-01"
    Copy link
    Member

    Choose a reason for hiding this comment

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

    Suggested change
    "version": "2021-07-01"
    "version": "2021-07-01-preview"

    Copy link
    Contributor Author

    @kshitizvijay kshitizvijay Sep 12, 2021

    Choose a reason for hiding this comment

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

    Would this change mean the requests would have "?api-version=2021-07-01-preview" ?
    Currently the service only works with 2021-07-01.

    Copy link
    Member

    Choose a reason for hiding this comment

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

    Yes -- preview versions of the service should use an api-version that ends in "-preview". If your service does not do that currently then you should leave the version as it is for now, but please use this convention for future previews.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    The service does not implement it right now.
    I will leave the version as it is.

    ],
    "type": "object",
    "properties": {
    "values": {
    Copy link
    Member

    Choose a reason for hiding this comment

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

    @JeffreyRichter @johanste @tg-msft @markweitzel The Azure API Guidelines say that this property should be named "value" rather than "values". Personally I like "values" better since it is an array, so plural feels better to me. Should we allow "value" or "values", or stick to just the one name even though it is a bit clunky?

    Copy link
    Member

    Choose a reason for hiding this comment

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

    Personally, I like "value" better too but Azure has always use "value" in the past.
    @johanste probably has the most experience with how impactful this change would be, so I'd leave it to him to decide.

    Copy link
    Member

    Choose a reason for hiding this comment

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

    The value (singular) naming convention comes from OData. I don't think we've been consistent in Azure. I'd do an inventory of what is being used today and unless there is a clear winner/a large majority uses value, I don't have a strong opinion. We obviously wouldn't want to recommend breaking changes to "fix" the consistency problem, however.

    Copy link
    Member

    Choose a reason for hiding this comment

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

    @kshitizvijay We want all Azure services to use value as the property name for the array in a pageable response. Please update the API to comply with this guidance.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    We will update the API to use value as the property name for the array in a pageable response.
    Any guide on how to introduce this breaking change?

    Copy link
    Member

    Choose a reason for hiding this comment

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

    You need to go through the Breaking Changes Process.

    For APIs in preview this is not onerous -- you just have document the breaking change and then keep the prior version functioning for at least 90 days.

    @lmazuel lmazuel merged commit 1424fc4 into Azure:main Sep 17, 2021
    @mikekistler mikekistler added APIStewardshipBoard-ReviewRequested This should be reviewed by the Azure API Stewardship team in partnership with the service team. and removed Reviewed-ChangesRequested <valid label in PR review process>add this label when assignee request changes after review labels Sep 20, 2021
    @mikekistler mikekistler linked an issue Sep 23, 2021 that may be closed by this pull request
    Hardell pushed a commit to Hardell/azure-rest-api-specs that referenced this pull request Sep 27, 2021
    * initial commit for purview metadata policies
    
    * fixed paths and added fields
    
    * fixed issues and added examples for purview metadatapolicy
    
    * fixed example file name for purview metadatapolicy
    
    * fixed words
    
    * fixed model issue
    
    * removed readonly property from example
    
    * removed readonly proprties from body
    
    * fixed response status codes
    
    * fixed prettier issue
    
    * updated metadata roles API for Purview Metadata policy service
    
    * spellcheck and prettier fix
    
    * removed skiptoken, count and added autorest extension
    
    * sdk changes
    
    * fixed not foundbug
    
    * removed collection path
    
    * removed unreferenced file
    
    * fixed error code
    
    Co-authored-by: Kshitiz Vijayvargiya <kshitiz.v@timesinternet.in>
    LeiWang3 pushed a commit to LeiWang3/azure-rest-api-specs that referenced this pull request Mar 31, 2022
    * initial commit for purview metadata policies
    
    * fixed paths and added fields
    
    * fixed issues and added examples for purview metadatapolicy
    
    * fixed example file name for purview metadatapolicy
    
    * fixed words
    
    * fixed model issue
    
    * removed readonly property from example
    
    * removed readonly proprties from body
    
    * fixed response status codes
    
    * fixed prettier issue
    
    * updated metadata roles API for Purview Metadata policy service
    
    * spellcheck and prettier fix
    
    * removed skiptoken, count and added autorest extension
    
    * sdk changes
    
    * fixed not foundbug
    
    * removed collection path
    
    * removed unreferenced file
    
    * fixed error code
    
    Co-authored-by: Kshitiz Vijayvargiya <kshitiz.v@timesinternet.in>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    APIStewardshipBoard-ReviewRequested This should be reviewed by the Azure API Stewardship team in partnership with the service team. Purview
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    [Cognitive - Purview] Metadata Policies API review
    8 participants