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

Azure Purview Policy Store Self-service Policies Spec #21750

Merged
merged 7 commits into from
Jan 24, 2023

Conversation

saranya-azuredev
Copy link
Contributor

Data Plane API - Pull Request

API Info: The Basics

Most of the information about your service should be captured in the issue that serves as your engagement record.

  • Link to engagement record issue:

Is this review for (select one):

  • a private preview
  • a public preview
  • GA release

Change Scope

This section will help us focus on the specific parts of your API that are new or have been modified.
Please share a link to the design document for the new APIs, a link to the previous Open API document (swagger) if applicable, and the root paths that have been updated.

  • Design Document:
  • Previous Open API Doc:
  • Updated paths:

❔Got questions? Need additional info?? We are here to help!

Contact us!

The Azure API Review Board is dedicated to helping you create amazing APIs. You can read about our mission and learn more about our process on our wiki.

Click here for links to tools, specs, guidelines & other good stuff

Tooling

Guidelines & Specifications

Helpful Links

@openapi-workflow-bot
Copy link

Hi, @saranya-azuredev 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 Dec 5, 2022

    Swagger Validation Report

    ️️✔️BreakingChange succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️⚠️LintDiff: 2 Warnings warning [Detail]
    compared tags (via openapi-validator v2.0.0) new version base version
    package-2022-12-01-preview package-2022-12-01-preview(ca559df) default(main)

    [must fix]The following errors/warnings are introduced by current PR:

    Rule Message Related RPC [For API reviewers]
    ⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
    Location: Azure.Analytics.Purview.SelfServicePolicies/preview/2022-12-01-preview/purviewSelfServicePolicy.json#L65
    ⚠️ PathParameterSchema Path parameter should specify characters allowed (pattern).
    Location: Azure.Analytics.Purview.SelfServicePolicies/preview/2022-12-01-preview/purviewSelfServicePolicy.json#L109
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️ApiReadinessCheck succeeded [Detail] [Expand]
    ️⚠️~[Staging] ServiceAPIReadinessTest: 0 Warnings warning [Detail]

    API Test is not triggered due to precheck failure. Check pipeline log for details.

    ️️✔️~[Staging] SwaggerAPIView succeeded [Detail] [Expand]
    ️️✔️~[Staging] CadlAPIView succeeded [Detail] [Expand]
    ️️✔️ModelValidation succeeded [Detail] [Expand]
    Validation passes for ModelValidation.
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️️✔️PoliCheck succeeded [Detail] [Expand]
    Validation passed for PoliCheck.
    ️️✔️PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    ️️✔️Lint(RPaaS) succeeded [Detail] [Expand]
    Validation passes for Lint(RPaaS).
    ️️✔️CadlValidation succeeded [Detail] [Expand]
    Validation passes for CadlValidation.
    ️️✔️PR Summary succeeded [Detail] [Expand]
    Validation passes for Summary.
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Dec 5, 2022

    Swagger Generation Artifacts

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

    Breaking Changes Tracking

    ️❌ azure-sdk-for-net-track2 failed [Detail]
    • Failed [Logs]Release - Generate from 7b47689. SDK Automation 14.0.0
      Only show 24 items here, please refer to log for details.
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m 672 | �[0m         �[36;1mGeneratePackage -projectFolder $projectFolder -sdkRootPath $s�[0m …
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mFailed to generate sdk. exit code: False
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGet-ChildItem: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/automation/GenerateAndBuildLib.ps1:760
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m 760 | �[0m … rtifacts += �[36;1mGet-ChildItem $artifactsPath -Filter *.nupkg -exclude *.s�[0m …
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mCannot find path
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m'/mnt/vss/_work/1/s/azure-sdk-for-net/artifacts/packages/Debug/' because
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1mit does not exist.
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGeneratePackage: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/automation/GenerateAndBuildLib.ps1:672
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m 672 | �[0m         �[36;1mGeneratePackage -projectFolder $projectFolder -sdkRootPath $s�[0m …
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mFailed to generate sdk artifact
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGeneratePackage: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/automation/GenerateAndBuildLib.ps1:672
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m 672 | �[0m         �[36;1mGeneratePackage -projectFolder $projectFolder -sdkRootPath $s�[0m …
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mFailed to build sdk. exit code: False
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
    • Azure.Analytics.Purview.Account [View full logs]  [Release SDK Changes]
      info	[Changelog]
    • Azure.Analytics.Purview.Administration [View full logs]  [Release SDK Changes]
      info	[Changelog]
    • Azure.Analytics.Purview.Catalog [View full logs]  [Release SDK Changes]
      info	[Changelog]
    • Azure.Analytics.Purview.Scanning [View full logs]  [Release SDK Changes]
      info	[Changelog]
    • Azure.Analytics.Purview.Share [View full logs]  [Release SDK Changes]
      info	[Changelog]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Dec 5, 2022

    Generated ApiView

    Language Package Name ApiView Link
    .Net Azure.Analytics.Purview.Share https://apiview.dev/Assemblies/Review/4d5ac73f2e884250a31ac00313549b97

    @openapi-workflow-bot
    Copy link

    Hi, @saranya-azuredev, For review efficiency consideration, when creating a new api version, it is required to place API specs of the base version in the first commit, and push new version updates into successive commits. You can use OpenAPIHub to initialize the PR for adding a new version. For more details refer to the wiki. Or you could onboard API spec pipeline

    @openapi-workflow-bot
    Copy link

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

    @saranya-azuredev
    Copy link
    Contributor Author

    @mikekistler kindly review the PR

    @mikekistler mikekistler self-requested a review December 21, 2022 19:31
    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.

    Style-wise this looks very nice! I noted a few minor points that should be easy to fix.

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

    Choose a reason for hiding this comment

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

    You should not call this property workflowRunId or describe it as the id of a workflow. This is the id of the selfServicePolicy so it should be called something like policyId. Your service might derive it from the workflowRunId but this is an internal detail that should not leak out into the API contract.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Have modified the field to policyId instead of workflowRunId.

    "type": "string",
    "description": "The requestor of the self-service policy"
    },
    "expiryDate": {
    Copy link
    Member

    Choose a reason for hiding this comment

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

    It is good practice to have a naming convention for date-time properties (we are working an update to the Azure REST API guidelines for this). This file has 3 date-time properties and the other two end with "At", so perhaps this property could be named "expiresAt".

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Modified expiryDate to expiresAt as suggested to be in sync with rest of the date fields.

    "SystemData": {
    "type": "object",
    "description": "The system data",
    "readOnly": true,
    Copy link
    Member

    Choose a reason for hiding this comment

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

    readOnly: true has no significance for schemas that are only used in responses, so you should remove this.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Removed the readonly:true from SystemData method

    "required": true,
    "type": "string",
    "x-ms-client-name": "ApiVersion",
    "x-ms-parameter-location": "method"
    Copy link
    Member

    Choose a reason for hiding this comment

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

    Why x-ms-parameter-location: method for api-version? This typically goes on the client.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Modified x-ms-parameter-location to client instead of method.

      1) Changed workflowRunId parameter to policyId
      2) Changed expiryDate to expiresAt
      3) ApiVerion changed from method to get from client.
    @mikekistler mikekistler linked an issue Jan 10, 2023 that may be closed by this pull request
    @mikekistler
    Copy link
    Member

    /azp run

    @azure-pipelines
    Copy link

    Azure Pipelines successfully started running 1 pipeline(s).

    1) Make "principal" and "principalGroup" an array rather than a single value to be consistent with Devops policies.
    2) Remove System.string from policyId to make it language agnostic.
    @saranya-azuredev saranya-azuredev requested a review from a team as a code owner January 20, 2023 04:08
    @saranya-azuredev saranya-azuredev requested review from MushMal and removed request for a team January 20, 2023 04:08
    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.

    This looks good for preview. 👍

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    APIStewardshipBoard-SignedOff The Azure API Stewardship team has reviewed and approved the changes. CI-MissingBaseCommit data-plane new-api-version Purview
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    [Purview Policy Store Self-service] API Review
    5 participants