googleapis / googleapis/google-cloud-cpp

Audit `additional_proto_files`

Open
#14,518 0 comments 0 reactions 0 assignees View on GitHub
cpp: generator type: cleanup
Dominant language
C++
Stars
659
Forks
462
Avg merge
1d 2h
Merged PRs (30d)
89

Description

LROs have an annotation for their returned metadata type. Proto syntax does not require `import`s for the proto files that define these metadata types. In C++ we have to include these files.

Our intention for `additional_proto_files` was to add includes for these extra `*.pb.h` headers.

Turns out that when we feed them into `protoc` we treat them the same as any other service's proto file.

https://github.com/googleapis/google-cloud-cpp/blob/a86e887fe2756935a51d4d93b42e45a0fdde7812/generator/standalone_main.cc#L314-L317

This leads to some weirdness in the generator config. In `notebooks` and `run`, we rely on this behavior to generate some clients (and avoid #7997). In `containeranalysis`, we accidentally generate a client for `grafeas` which we did not intend to. Oops.

We should sort this out.

Contributor guide

Open the contributing guide

Research direction

Read generator/standalone_main.cc around lines 314-317, then inspect the generator configuration for notebooks, run, and containeranalysis. Determine how additional_proto_files are passed to protoc versus used for extra headers. Done means preserving the intended generated clients while avoiding the unintended grafeas client.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.