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

Update contract for anomaly detector #12487

Merged
merged 13 commits into from
Feb 9, 2021

Conversation

guinao
Copy link
Contributor

@guinao guinao commented Jan 19, 2021

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

Changes Made.

Add 'none' and 'microsecond' enum value into the 'granularity' field. Change 'timestamp' filed in 'series' from required to optional.

Validation.

According to the meeting with @JeffreyRichter , @johanste ,
Tests against all the following sdks, none of them break.

language sdk result
C# Azure.AI.Anomaly v3.0.0-preview.2 passed
Python azure-ai-anomalydetector 3.0.0b2 passed
Node JS @azure/ai-anomaly-detector 3.0.0-beta.2 passed
Java azure-ai-anomalydetector 3.0.0-beta.1 passed

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.

@guinao guinao requested a review from yangyuan as a code owner January 19, 2021 08:05
@openapi-workflow-bot
Copy link

Hi, @guinao 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 Jan 19, 2021

    Swagger Validation Report

    ️️✔️BreakingChange succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️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.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️⚠️[Staging] SDK Track2 Validation: 2 Warnings warning [Detail]

    Rule Message
    ⚠️ PreCheck/CheckDuplicateSchemas "readme":"cognitiveservices/data-plane/AnomalyDetector/readme.md",
    "tag":"release_1_0",
    "details":"Checking for duplicate schemas,
    this could take a (long) while. Run with --verbose for more detail."
    ⚠️ Modeler/MissingType "readme":"cognitiveservices/data-plane/AnomalyDetector/readme.md",
    "tag":"release_1_0",
    "details":"The enum schema 'AnomalyDetectorErrorCodes' with an undefined type and enum values is ambigious. This has been auto-corrected to 'type:string'"
    ️️✔️[Staging] PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️[Staging] SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jan 19, 2021

    Swagger Generation Artifacts

    ️🔄 $(sdkName) inProgress [Detail]
    ️🔄[Staging] ApiDocPreview inProgress [Detail]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-workflow-bot openapi-workflow-bot bot added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jan 19, 2021
    @openapi-workflow-bot
    Copy link

    Hi, @guinao your PR are labelled with WaitForARMFeedback. A notification email will be sent out shortly afterwards to notify ARM review board(armapireview@microsoft.com). cc @jhendrixMSFT

    @openapi-workflow-bot
    Copy link

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

    @jorgecotillo jorgecotillo self-assigned this Jan 19, 2021
    @@ -359,6 +417,15 @@
    "type": "boolean",
    "x-nullable": false
    }
    },
    "severity": {
    "type": "array",
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    If this is a value returned by your service, consider marking it as readOnly: true

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Should other fileds also be marked as readOnly as well?


    In reply to: 560688590 [](ancestors = 560688590)

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Yes, if they are set by your service, see here

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    According to the following rule, I changed the property of our output model object to readOnly and removed the 'required' property.

    R2056 RequiredReadOnlyProperties
    Category : SDK Error

    Applies to : ARM and Data plane OpenAPI(swagger) specs

    Output Message: Property '{0}' is a required property. It should not be marked as 'readonly'.

    Description: A model property cannot be both readOnly and required. A readOnly property is something that the server sets when returning the model object while required is a property to be set when sending it as a part of the request body.

    Why the rule is important: SDK generation fails when this rule is violated.

    How to fix the violation: Ensure that the given property is either marked as readonly: true or required but not both.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Correct, if a customer sets the value, then it cannot be readonly (you can enforce setting the value by specifying required but nothing else), readonly: true is set on properties that your service sets an example is ProvisioningState, this value is set by your service (Running, Provisioning, Succeeded | Failed, etc.) so just add readonly: true to those properties that your service sets.

    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 just updated the PR.

    @@ -411,6 +478,11 @@
    "isPositiveAnomaly": {
    "type": "boolean",
    "description": "Anomaly status in positive direction of the latest point. True means the latest point is an anomaly and its real value is larger than the expected one."
    },
    "severity": {
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Your service is in preview, but consider marking properties as readOnly where needed, follow this doc.

    Copy link
    Contributor Author

    @guinao guinao Jan 22, 2021

    Choose a reason for hiding this comment

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

    Actually our service is going to GA. We just have another PR to change 'preview' to 'stable' #12472.

    @openapi-workflow-bot
    Copy link

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

    @jhendrixMSFT
    Copy link
    Member

    Can you please fix the prettier check CI failure?

    @guinao
    Copy link
    Contributor Author

    guinao commented Jan 26, 2021

    Can you please fix the prettier check CI failure?

    Fixed.

    @jhendrixMSFT
    Copy link
    Member

    @guinao looks good from SDK perspective. Does anybody from your team need to review/approve?

    @guinao
    Copy link
    Contributor Author

    guinao commented Jan 28, 2021

    @guinao looks good from SDK perspective. Does anybody from your team need to review/approve?

    We are requesting the review board to review this change. This PR could be merged once we get sign off from them.

    @jhendrixMSFT jhendrixMSFT added the DoNotMerge <valid label in PR review process> use to hold merge after approval label Jan 28, 2021
    @jorgecotillo jorgecotillo added the ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review label Feb 3, 2021
    @jorgecotillo jorgecotillo removed their assignment Feb 4, 2021
    Copy link
    Contributor Author

    @guinao guinao left a comment

    Choose a reason for hiding this comment

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

    @jhendrixMSFT we have completed the review of the PR with review board, it is ok to merge :)

    yuyi@microsoft.com added 2 commits February 9, 2021 10:29
    @jhendrixMSFT jhendrixMSFT removed the DoNotMerge <valid label in PR review process> use to hold merge after approval label Feb 9, 2021
    @jhendrixMSFT jhendrixMSFT merged commit f24219e into Azure:master Feb 9, 2021
    iscai-msft added a commit to iscai-msft/azure-rest-api-specs that referenced this pull request Feb 10, 2021
    …into fix_resource_multiapi_submodule
    
    * 'master' of https://github.com/Azure/azure-rest-api-specs: (452 commits)
      Dev cost management microsoft.cost management 2020 12 01 preview new (Azure#12259)
      Edit securityContact swagger for 2020-01-01 (Azure#12265)
      [Hub Generated] Review request for Microsoft.Insights to add version stable/2020-10-01 (Azure#11579)
      [Hub Generated] Review request for Microsoft.Media to add version stable/2020-05-01 (Azure#12681)
      Fix TimeSeriesInsights swagger issues (Azure#12204)
      Fixing error in lastModifiedAt description (Azure#12854)
      Update comment.yml (Azure#12910)
      Fixing RI s360 Flagged corrections in 2019-10-01 version (Azure#12777)
      [Hub Generated] Review request for Microsoft.Web to add version stable/2020-10-01 (Azure#11636)
      [Ready For Review] New version 20210101 (Azure#12111)
      Update scheduledQueryRule_API.json (Azure#12895)
      Remove UserAssigned MSI (Azure#12900)
      Update library.json (Azure#12922)
      KeyVault: Feature/update security domain spec (Azure#12863)
      Fixes ExampleId type and incorrect ArmTokenParameter name (Azure#12896)
      Update contract for anomaly detector (Azure#12487)
      [NetAppFiles] Urgent bug fix, backup response, remove systemData(not in response yet) (Azure#12852)
      [AML] Add PipelineEndpoint with version and DataPathAssignments fields in AzureMLExecutePipeline (Azure#12744)
      remove duplicated schema (Azure#12779)
      [Web] Add Swagger for Service Principal (Azure#12780)
      ...
    mkarmark pushed a commit to mkarmark/azure-rest-api-specs that referenced this pull request Jul 21, 2021
    * update contract for anomaly detector
    
    * make severity optional
    
    * contract update
    
    * update according to PR
    
    * update values
    
    * update
    
    * prettier fix
    
    * split the PR into two parts, this pr adds two enum values into the granularity and make timestamp optional
    
    * change preview to stable
    
    * update to stable version
    
    * fix build failure
    
    * update
    
    * update
    
    Co-authored-by: yuyi@microsoft.com <Yuanxiang.Ying@microsoft.com>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review CI-BreakingChange-Go CI-BreakingChange-Python
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants