googleapis / googleapis/google-cloud-cpp

Audit `additional_proto_files`

未关闭
#14,518 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
cpp: generator type: cleanup
主要语言
C++
星标
659
派生
462
平均合并
1 天 2 小时
30 天内合并 PR
89

描述

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.

贡献指南

打开贡献指南

调研方向

阅读 generator/standalone_main.cc 第314-317行附近的内容,然后检查 notebooks、run 和 containeranalysis 的生成器配置。确定 additional_proto_files 是如何传递给 protoc 的,以及它们如何被用于额外的头文件。完成标准是保留预期生成的客户端,同时避免生成不需要的 grafeas 客户端。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
tooling
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。