Content Moderator new version changes#2317
Conversation
| ``` yaml $(tag) == 'release_1_1' | ||
| input-file: | ||
| - stable/v1.0/ContentModerator.json | ||
| - v1.1/ContentModerator.json |
fearthecowboy
left a comment
There was a problem hiding this comment.
Before I get anywhere with the review, a couple salient points:
-
Don't remove old revisions, create new ones and add new sections to the configurations. Never remove an existing revision. The configuration can be set to only generate a given version, but we need to preserve everything. If the examples haven't changed, don't move the files, reference them from the old location. If an example is new or changed, create it in the appropriate new folder location.
-
Follow the file-folder layout that is in the repository. We recently introduced a
stablefolder in the path, keep the files in the right places.
|
|
||
| ### Release 1.0 | ||
| These settings apply only when `--tag=release_1_0` is specified on the command line. | ||
| ### Release 1.1 |
There was a problem hiding this comment.
Do not remove old releases!
Create a new release section and change the default, but don't remove the old one.
fearthecowboy
left a comment
There was a problem hiding this comment.
Please make this change additive, not replacing or moving the existing revision, and then I can continue
|
Just to be clear, I approved "stable/preview" folder, nothing else. Just to be sure I won't lock the PR when @fearthecowboy is done. |
| "/contentmoderator/lists/v1.0/imagelists/{listId}/images?overload=stream": { | ||
| "post": { | ||
| "tags": [ | ||
| "ListManagemen |
There was a problem hiding this comment.
It appears that this is the only significant change in the API.
As far as APIs go, having this hardcoded to Category1/2/3 seems ... inefficient and a bit clumsy. Is it possible to use an array of Scores instead?
There was a problem hiding this comment.
@fearthecowboy For API , naming properties Category1/2/3 was due to our CELA lawyers. For more information on this you can reach out to Greg Clark (gregc@microsoft.com) .
There was a problem hiding this comment.
Regarding returning an array instead rather than class, we chose to return class instead array so that we can add more fields in future and traverse the fields easily.
There was a problem hiding this comment.
It's just a rather rigid way to express something that looks like it could potentially have more than the arbitrary 3 that you've got there. What happens if in the future, you want four?
With an array instead, you can send an arbitrary number back, and the SDK won't change when you do that.
You could just have a Categories property that is an array of Score instead of separate individual properties.
Our goal here is to make sure that generated SDKs are convenient and flexible for our customers, so we can minimize the impact of API changes later on.
There was a problem hiding this comment.
@swiftarrow11 can provide you more information on why it is implemented as class than an array.
fearthecowboy
left a comment
There was a problem hiding this comment.
I'm curious if the API can be refactored to just return an array rather than a class that has fixed fields for category1/2/3
|
@v-sodsou -- the other thing that @lmazuel brought to my attention, is that you've called this 1.1 but the paths all still point to 1.0 The path /contentmoderator/moderate/v1.0/ProcessText/Screen/ in the existing spec returns a different structure. If you change the implementation of the existing endpoint, you will break existing SDK/clients. You should be either changing the path for that API in the 1.1 version to /contentmoderator/moderate/v1.1/ProcessText/Screen/ (or more likely do the whole set). What exactly are you plans for rolling out this API version into production? Are you supporting multiple API versions concurrently? |
|
@fearthecowboy we have rolled out this "/contentmoderator/moderate/v1.0/ProcessText/Screen/" API version as v1.0 into production. So I have retained the same in specification file. Earlier this classify feature was in preview mode and only few customers were using it. Now that it is public , customers who are using it , are already notified about this change. Perhaps, I shouldn't have added this feature in earlier version since it was in preview. Apologies for the confusion caused. |
|
@v-sodsou If I understand correctly what you are saying, you should not create a virtual 1.1 that doesn't exists, but update the current v1.0 with the truth. There is no point for anyone to keep trace of a v1.0 folder that does not represent anything in the real world. At worst, we can get the Swagger as it was using Git (that the point of a versionning system). |
|
@lmazuel @fearthecowboy 1.Should I not change the version of specification file? Could you tell me the right way to proceed. |
|
We wanted you to create a new version, because you changed the version number in the configuration, which made us think that you were introducing a new API version. Given that this is not a new version at all, you're just overwriting an existing API definition in an existing API version, we now suggest that you keep everything at |
|
@fearthecowboy Sure. I'll keep everything at 1.0 then. Thanks. |
|
I think we should be clear for the future; you should at all cost avoid changing an API definition for an existing API -- once a client is shipped, it's really dangerous for us to alter the API. If that's absolutely necessary, then I would recommend that you do change the API version and support multiple concurrent API versions so that customers are not broken. If an API is not considered "stable" (and you will be updating it in production), then we should move the spec to the |
|
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: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
|
@fearthecowboy Thank you for the information and assistance. I have conveyed this to my team as well. We shall keep this in mind when we have future changes in API. |
|
@fearthecowboy Build job for Mode=Semantic PR_Only is errored. Can you help me resolve this error. |
|
This commit was treated and no generation was made for Azure/azure-sdk-for-go |
|
Did a commit to Azure/azure-sdk-for-python: |
|
@v-sodsou I've restarted the CI task. Looks like it went crazy. Looks ok to me now. If we're OK with this I can merge it. |
|
This commit was treated and no generation was made for Azure/azure-sdk-for-go |
|
Did a commit to Azure/azure-sdk-for-python: |
|
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: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
|
This commit was treated and no generation was made for Azure/azure-sdk-for-go |
Swagger to SDK encountered an unknown error: (Azure/azure-sdk-for-go)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/github_tools.py", line 29, in exception_to_github
yield context
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 180, in rest_handle_action
return rest_pull_close(body, github_con, restapi_repo, sdk_pr_target_repo, sdkbase)
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 311, in rest_pull_close
rest_pr.create_issue_comment("Was unable to create SDK %s PR for this closed PR.", sdkid)
TypeError: create_issue_comment() takes 2 positional arguments but 3 were given |
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