-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[Azure Customer Insight] Updated the 2017-01-01 version with the latest interaction API. Added 2017-04-26 version #1343
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
Conversation
|
@oucfei, |
veronicagg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review model validation errors at https://travis-ci.org/Azure/azure-rest-api-specs/jobs/246332416#L1358
Operations API is missing from customer-insights spec: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/246332414#L1364
Should 'location' be removed from parameters of PATCH operation https://travis-ci.org/Azure/azure-rest-api-specs/jobs/246332414#L1416 ? Please note that this may cause a breaking change in the SDKs, and therefore a change may not want to be done in the existing api-version but in the new one.
Please review same errors in 2017-04-26 of the spec: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/246332414#L1812
Please review warnings from linter validation as well https://travis-ci.org/Azure/azure-rest-api-specs/jobs/246332414#L1428 for both specs.
For the new api-version, it'd be great if you could have an initial commit of the old version and a newer commit with the changes (see https://github.com/Azure/azure-rest-api-specs/blob/master/.github/CONTRIBUTING.md#filenames-and-folder-structure)
| "type": "string", | ||
| "description": "The primary participant property name for an interaction ,This is used to logically represent the agent of the interaction, Specify the participant name here from ParticipantName." | ||
| }, | ||
| "dataSources": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing/renaming a property is a breaking change (has the service made a breaking change?) and may result in SDK breaking changes, is this intentional for this api-version?
similar comment applies to other changes made to this api-version, please provide additional context on the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this is intentional and it's OK because the 2017-01-01 version never get released before. Last time when we update this swagger, this part was a work-in-progress. Now that it's done and it should look like this (when you call this API with 2017-01-01 version, this is what the returned schema looks like)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the current spec does not match the wire, meaning that it was initially incorrect, then it may be ok corrected (though for anyone who shipped it avoiding a breaking change is best). Regarding your statement about "201-01-01 version never get released before", what do you mean by this?
Having the swagger spec in master of this repo, means anyone could generate an SDK, I see there's an SDK for Go at https://github.com/Azure/azure-sdk-for-go/tree/master/arm/customer-insights.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi sorry looks like it's released before. However this part was incomplete so I'm sure no one was using it. Anyway the version 2017-01-01 should look like this swagger now
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "modelAsString: false" intentional? This will make the type an enum, see https://github.com/Azure/autorest/blob/master/docs/extensions/readme.md#x-ms-enum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, sorry it's unclear which line you're referring to. the "modelAsString: false" appear many times in the swagger. But regardless, those are copied from the old api-version, and no changes in the new api version. So it's already there before this PR. Same for the other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm referring to targetEntityType, sourceEntityType which are new properties in this spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentional. They're indeed enum type
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar question as previous is "modelAsString: false" intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this description be different from the one below and more descriptive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry which line is this? It doesn't show correctly above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
descriptions of sourceEntityType and targetEntityType are the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it
|
@ravbhatnagar there's a new api-version being added with some small changes, will you be looking into this review from ARM side? |
|
@veronicagg - yes I would like to. Since its a new file it has to be reviewed using notepad++ or something similar. Any recommendations? Can a PR be sent which compares it against the older api version so that only what changed can be reviewed. |
|
@veronicagg thanks for review the PR.
Question:
|
|
@ravbhatnagar I've been using VS Code, and comparing with the old version, see http://dailydotnettips.com/2015/06/04/how-to-compare-files-in-visual-studio-code/ |
|
@oucfei I've replied to your questions in the inline comments, please review.
RE: Questions:
|
|
@veronicagg thanks for your reply
I also looked at the warnings from linter validation and they don't make sense to me, so I will not fix those. |
|
@oucfei thanks. Regarding 1. ok, the tool will compare the examples with the spec, so if the wire format matches the example, then the spec should more accurately represent the wire format. @ravbhatnagar please review and provide your comments/approval, on behalf of ARM team. |
ravbhatnagar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the comments I have added. Majority of those are around existing APIs.
I see in a lot of resource types you have "name" top level property and also a name property inside the properties bag. It is redundant information.
| "$ref": "#/definitions/ProfileResourceFormat" | ||
| } | ||
| }, | ||
| "202": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason why you use the 202 + location header async pattern here but for PUT /hubs you use the 201 + provisioningState. 201 pattern is recommended by ARM for PUT/PATCH as it enables clients provide richer experience when tracking long running operation and provide a reliable way to retrieve and show error messages when it fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, I don't know any specific reason except that this is how the API was designed and implemented. At this point we're not planning to make change to this API.
| "$ref": "#/definitions/InteractionResourceFormat" | ||
| } | ||
| }, | ||
| "202": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about long running operation as above for LRO (201?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above.
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing API - but add the allowed values for this as you have done for other resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which line is this?
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure - secrets like keys should not be returned in the response of PUT or GET. It could be confusing to users of SDK if they see/expect these in response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which line is this?
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/authorizationPolicies/{authorizationPolicyName}/regeneratePrimaryKey": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing API - but do you really need two separate APIs for regenerating primary and secondary keys? I think one API would have sufficed with the request body indicating which key to regenerate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it should be sufficed with just one API, but again this is how the API was designed and implemented, and I don't know why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. consider changing this in the next API-version revision to make the API cleaner.
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you could have leveraged the "provisioningState" property for this. Is it because of the "expiring" state that you added the state property instead of using the provisioningState. All other states seems to be related to provisioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which line is this?
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing API - but why do you need tenantId? Can the hub be in a different tenant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in our API the "tenantId" is actually the "hubId"... we have a bad name and it is confusing...
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing API but still wanted to note that resource types should be pluralized - kpi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure which line you're referring to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why it doesnt show up there. But likely you wont be able to change it now. I am referring to the resource type "kpi"
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This resource type name conflicts with the Microsoft.Authorization/roleAssignments which is a commonly known RBAC model. This should not have been named this since we dont want to confuse users with the Azure wide concepts like RBAC role assignments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which line is this? But anyway I don't think we can change this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why the line numbers got messed up for some comments. But likely you wont be able to change it now. I am referring to the resource type "roleAssignments"
| { | ||
| "name": "kpiName", | ||
| "in": "path", | ||
| "requir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Segments not correct for this API. It would be working for you since ARM may be routing based on the parent. The correct segments should be /images/{imageName}/getEntityTypeImageUploadUrl. If imageName is not applicable then do you really need the "images" type? Can you invoke this action on a hubs/{hubName}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why it doesn't have {imageName}, but it is what our API looks like and it seems working fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this API do? Is the URL same for all images in a hubs/{hubName}. I am wondering if its working as you expect then why do you even need a /images segment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this api is to get the images' upload URL. As you can see in the swagger it depends on the entityType, entityTypeName, relativePath, so the URL is not the same for all images in a hub, but it has nothing to do with the imageName. This API is in the ImagesController, I think that's why the person who developed this add a /images segment
|
For #3 - Location should be required for Tracked resources. All this means is that your create parameters look different from your update parameters. You just have to add another model which becomes the request body of your PATCH. That way customers know what is required and what is not and also what can or cannot be updated. |
|
@oucfei Please review @ravbhatnagar comments, and if you confirm the resources mentioned in "3" are tracked resources, please make the corresponding updates to the spec. Thanks! |
|
@ravbhatnagar thanks for your review.
|
|
Yes, you are right. Feel free to ignore the feedback around existing APIs. We will follow up with you separately on that. Tracked resource means that the "routingType" is set to "default" in the ARM manifest. Hubs is a tracked resource. Anyway location of a resource cant be changed. And so if someone tries to PATCH (change the location) which they can since the same model is being used, the operation will/should fail. |
|
@veronicagg @ravbhatnagar I've resolved all the comments, and we've agreed not to fix the issues around existing API at this time. So could you please sign off this PR? Please let me know if you still have questions. |
|
@oucfei - Only one open question - Tracked resource means that the "routingType" is set to "default" in the ARM manifest. Hubs is a tracked resource. Anyway location of a resource cant be changed. And so if someone tries to PATCH (change the location) which they can since the same model is being used, the operation will/should fail. @veronicagg - This probably is not ideal SDK experience. Please confirm. |
|
@ravbhatnagar got it. Made "location" required in the PATCH operation. |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: File: Know more about AutoRest Linter Guidelines. Send feedback and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
|
@oucfei - Location of a resource cannot be updated after the resource has been created. So it cant be made required in the PATCH. Ideally, it should not be present in the request body of the PATCH. |
This reverts commit bf37472.
|
@ravbhatnagar OK... sorry for my misunderstanding. But currently in the API, location is part of the patch request body, and we're explicitly checking if it's changed. So I'm not going to make change to the swagger at this time... |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: File: Know more about AutoRest Linter Guidelines. Send feedback and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
|
@ravbhatnagar do you agree with my above comment? can you sign off now? |
|
Ok, but please consider updating this at some point since it will improve the client experience. |
|
ok, thanks @ravbhatnagar . |
|
@veronicagg thanks! I will create items for the issues mentioned above. |
|
No modification for AutorestCI/azure-sdk-for-ruby |
|
No modification for AutorestCI/azure-sdk-for-python |
|
No modification for AutorestCI/azure-sdk-for-node |
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-versionin the path should match theapi-versionin the spec).Quality of Swagger