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

Update Google Ads Docker file paths #165

Merged
merged 4 commits into from
Jun 14, 2019

Conversation

blowmage
Copy link
Contributor

Update the Google Ads docker image to change the file paths of the files generated by the protobuf and grpc plugins.

blowmage added 4 commits June 14, 2019 09:46
So the file path and require changes will be made.
This allows files to be moved to directories that already exist.
@blowmage blowmage requested a review from a team June 14, 2019 18:18
@blowmage blowmage self-assigned this Jun 14, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 14, 2019
Copy link
Member

@quartzmo quartzmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance of some echo calls to print what's happening?

@blowmage
Copy link
Contributor Author

Any chance of some echo calls to print what's happening?

Make some suggestions in the code. I don't know what you are looking for.

@quartzmo
Copy link
Member

OK, just a sec, I'll open suggestions

@blowmage
Copy link
Contributor Author

The docker image calls protoc with all three plugins: 1) protobuf, 2) grpc, and 3) gapic. The gapic generator can't alter the output of the other two plugins, so this PR updates the docker image to alter the output for all three protoc plugins.

For example, the protobuf plugin will take the proto file google/ads/googleads/v1/services/campaign_service.proto and generate the ruby file google/ads/googleads/v1/services/campaign_service_pb.rb The docker image then renames it to google/ads/google_ads/v1/services/campaign_service_pb.rb.

Then, the grpc plugin takes the same proto file google/ads/googleads/v1/services/campaign_service.proto and generate the ruby file google/ads/googleads/v1/services/campaign_service_services_pb.rb, with a require for the generated protobuf file google/ads/googleads/v1/services/campaign_service_pb.rb. The docker image then renames the file to google/ads/google_ads/v1/services/campaign_service_services_pb.rb, and updates the require to match the previously renamed file.

The generated gapic files require both the generated protobuf and grpc files, and those requires are also updated.

Lastly, the files generated by the protobuf plugin also reference the original proto file. It has code similar to the following:

add_file("google/ads/googleads/v1/services/campaign_service.proto", :syntax => :proto3) do
  # add messages
end

The file path of original proto file referenced in the ruby code is not changed, even though the generated ruby files are.

@blowmage blowmage merged commit 43079fd into googleapis:master Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants