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

Generate common resource path helpers via google/cloud/common_resources.proto #586

Closed
busunkim96 opened this issue Sep 3, 2020 · 1 comment · Fixed by #622
Closed

Generate common resource path helpers via google/cloud/common_resources.proto #586

busunkim96 opened this issue Sep 3, 2020 · 1 comment · Fixed by #622
Assignees
Labels
generator Bugs, features, and so forth pertaining to the generated client surface priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@busunkim96
Copy link
Contributor

https://github.com/googleapis/googleapis/blob/master/google/cloud/common_resources.proto

I was visiting the Node chat and learned of the existence of the above file. Can we use it somehow to get more resource helpers methods into all the libraries? (the two with projects would be most useful I think)

  • "projects/{project}"
  • "organizations/{organization}"
  • "folders/{folder}"
  • "billingAccounts/{billing_account}"
  • "projects/{project}/locations/{location}"
@busunkim96 busunkim96 added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Sep 3, 2020
@vam-google vam-google added priority: p2 Moderately-important priority. Fix may not be included in next release. generator Bugs, features, and so forth pertaining to the generated client surface labels Sep 8, 2020
@software-dov
Copy link
Contributor

This should be straightforward and easy. There are a couple of potential gotchas:

  1. The path definitions in common_resources.proto don't have messages associated. This will require a little bit of rework in the generator logic and template.
  2. The correct thing to do would be to have common_resources.proto imported and then to use the descriptors to generate paths. I don't think we can do that by the time the generator plugin runs, so we'll need to just hack it in.
  3. There's a potential for name conflicts. One way to deal with this is to ignore it until a problem arises; another is to have a common disambiguation string, e.g. def common_project_path and def parse_common_project_path. Neither option seems great, but I'm leaning towards the second.

What do other people think? @vam-google @busunkim96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Bugs, features, and so forth pertaining to the generated client surface priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants