-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[Datafactory] Add configure repo api swagger #2866
Conversation
Automation for azure-libraries-for-javaA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
Automation for azure-sdk-for-pythonThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-goA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
Automation for azure-sdk-for-nodeThe initial PR has been merged into your service PR: |
@@ -105,6 +105,54 @@ | |||
} | |||
} | |||
}, | |||
"/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/locations/{locationId}/configureFactoryRepo": { |
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 path doesn't look valid.
should be like this:
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/configureFactoryRepo. And if you need locationId passed from client, pass it as a parameter in query string or in body.
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.
As we talked offline about this, I'll explore other options, and ask feedback on this from the ARM tema.
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 doubt I need to tell you, @ravbhatnagar, but make sure to take a look at this comment thread. :)
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 replied on email, IMO this should be modeled as an action on /factories/{factoryName} as mentioned by @hvermis
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.
Also, this returns a factory resource, Is it fine where someone who just has permission to this POST action can read the resource even though he may not have /read or /write permission. I am sure this API is not creating a factory resource. Is it changing the shape of the factory resource?
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 changes some properties of the factory, to call this api you will need to have permissions for this post call and also write permissions to the factory
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've verified that non of the CI failures regarding the files in this PR are introduced by these changes. Other than the already noted path concerns, this PR looks good from a code-generation perspective.
@@ -105,6 +105,54 @@ | |||
} | |||
} | |||
}, | |||
"/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/locations/{locationId}/configureFactoryRepo": { |
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 doubt I need to tell you, @ravbhatnagar, but make sure to take a look at this comment thread. :)
], | ||
"operationId": "Factories_ListByResourceGroup", | ||
"operationId": "ConfigureRepo_Update", |
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 should be Factories_ConfigureRepo
"x-ms-examples": { | ||
"Factories_ListByResourceGroup": { | ||
"$ref": "./examples/Factories_ListByResourceGroup.json" | ||
"Factories_CreateOrUpdate": { |
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 also should be Factories_ConfigureRepo
"Factories_ListByResourceGroup": { | ||
"$ref": "./examples/Factories_ListByResourceGroup.json" | ||
"Factories_CreateOrUpdate": { | ||
"$ref": "./examples/Factories_UpdateRepo.json" |
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.
The name of the example file usually matches the operation ID, should be Factories_ConfigureRepo.json
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.
Make sure to address the comments on your last commit too.
"description": "Factory's VSTS repo information.", | ||
"properties": { | ||
"factoryId": { | ||
"description": "The factory id.", |
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 the full ARM resource ID for the factory right? Since your API is under factory resource now, you shouldn't need this, since all information will be in your path.
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 need this property for the linkedActionCheck
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.
You can construct it since you have the factory name, rg name, sub id in your headers when the API gets called. We shouldn't require the client to send this extra field if we already have all the information.
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. |
"description": "Factory's VSTS repo information.", | ||
"properties": { | ||
"factoryId": { | ||
"description": "The factory id.", |
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.
You can construct it since you have the factory name, rg name, sub id in your headers when the API gets called. We shouldn't require the client to send this extra field if we already have all the information.
"tenantId": "12f988bf-86d1-41af-91ab-2d7cd011db49" | ||
} | ||
}, | ||
"id": "/subscriptions/12345678-1234-1234-12345678abc/resourceGroups/exampleresourcegroup/providers/Microsoft.DataFactory/factories/examplefactoryname", |
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.
See, this Id gets returned. So in the code you might even have this as one of the parameters passed to your API.
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.
Talked offline, the resource ID is for the cases when the call goes through the desired action "Microsoft.DataFactory/factories/configureRepo/action" and ARM needs it to validate the permissions. Recalling my comment.
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. |
Signing off as the feedback given over email has been addressed. |
Are these changes deployed to the public? Are you ready for me to merge? |
Not yet Martin, just doing validation, I'll let you know once this is ready. |
Got it, @frankycrm14. What's the timeline? Should we be closing this PR for a while until you're ready? |
I'm testing the api to verify that the approach we took actually works. |
AutoRest linter results for SDK Related Validation Errors/WarningsThese errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns. File: specification/datafactory/resource-manager/readme.md
|
AutoRest linter results for ARM Related Validation Errors/WarningsThese errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns. File: specification/datafactory/resource-manager/readme.md
|
Still working on this PR, @frankycrm14? What's its status? |
"description": "The factory resource id.", | ||
"type": "string" | ||
}, | ||
"resourceGroupName": { |
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'd ref this definition instead, in order to get client-side validation:
https://github.com/Azure/azure-rest-api-specs/pull/2866/files#diff-bf6d272fbfeeed92d1fc24a2bb8706a8R3781
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.
Chatted offline with @frankycrm14 about this, it looks like the defintion I mentioned is in the parameters section. For that reason, the real fix would be to refactor most of this into the definitions section, and reference that from the parameter and anywhere else it's used. However, that would only buy us a little client-side validation, and wouldn't be a breaking change to fix in the future. For those reasons, I'm not going to block this PR on this kinda comment.
All that remains before I merge is ensuring that none of the linter errors being reported were introduced by this PR.
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.
To the best of my knowledge, I believe the CI errors here predate this PR.
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-version
in the path should match theapi-version
in the spec).Quality of Swagger