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

[Datafactory] Add configure repo api swagger #2866

Merged
merged 10 commits into from
May 22, 2018
Merged

Conversation

frankycrm14
Copy link
Contributor

@frankycrm14 frankycrm14 commented Apr 12, 2018

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

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@msftclas
Copy link

msftclas commented Apr 12, 2018

CLA assistant check
All CLA requirements met.

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-libraries-for-java

A 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:
AutorestCI/azure-libraries-for-java#18

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2293

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-go

A 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:
Azure/azure-sdk-for-go#1885

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#2770

@@ -105,6 +105,54 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/locations/{locationId}/configureFactoryRepo": {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Member

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. :)

Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

@marstr marstr added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Apr 13, 2018
Copy link
Member

@marstr marstr left a 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": {
Copy link
Member

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",
Copy link
Contributor

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": {
Copy link
Contributor

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"
Copy link
Contributor

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

Copy link
Contributor

@hvermis hvermis left a 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.",
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

@azuresdkciprbot
Copy link

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: specification/datafactory/resource-manager/readme.md
Before the PR: Warning(s): 14 Error(s): 1
After the PR: Warning(s): 14 Error(s): 1

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.",
Copy link
Contributor

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",
Copy link
Contributor

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.

Copy link
Contributor

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.

@azuresdkciprbot
Copy link

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: specification/datafactory/resource-manager/readme.md
Before the PR: Warning(s): 14 Error(s): 1
After the PR: Warning(s): 14 Error(s): 1

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@ravbhatnagar
Copy link
Contributor

Signing off as the feedback given over email has been addressed.

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Apr 19, 2018
@marstr
Copy link
Member

marstr commented Apr 19, 2018

Are these changes deployed to the public? Are you ready for me to merge?

@frankycrm14
Copy link
Contributor Author

Not yet Martin, just doing validation, I'll let you know once this is ready.
thanks!

@hvermis hvermis changed the title add configure repo api swagger [Do not merge][Datafactory] Add configure repo api swagger Apr 19, 2018
@marstr
Copy link
Member

marstr commented Apr 19, 2018

Got it, @frankycrm14. What's the timeline? Should we be closing this PR for a while until you're ready?

@frankycrm14
Copy link
Contributor Author

I'm testing the api to verify that the approach we took actually works.

@marstr marstr added the DoNotMerge <valid label in PR review process> use to hold merge after approval label Apr 23, 2018
@azuresdkciprbot
Copy link

AutoRest linter results for SDK Related Validation Errors/Warnings

These 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

⚠️0 new Warnings.(5 total)
0 new Errors.(0 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for ARM Related Validation Errors/Warnings

These 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

⚠️0 new Warnings.(9 total)
0 new Errors.(1 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@marstr
Copy link
Member

marstr commented May 7, 2018

Still working on this PR, @frankycrm14? What's its status?

@frankycrm14
Copy link
Contributor Author

frankycrm14 commented May 8, 2018 via email

"description": "The factory resource id.",
"type": "string"
},
"resourceGroupName": {
Copy link
Member

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

Copy link
Member

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.

Copy link
Member

@marstr marstr left a 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.

@marstr marstr removed the DoNotMerge <valid label in PR review process> use to hold merge after approval label May 22, 2018
@marstr marstr changed the title [Do not merge][Datafactory] Add configure repo api swagger [Datafactory] Add configure repo api swagger May 22, 2018
@marstr marstr merged commit 7a6afb0 into Azure:master May 22, 2018
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants