Commit 9e09c13
fix(spiffe-proto): generate proto bindings without embedding package definition (#4324)
Our workload.proto package has a package definition in it. We rely on
that package definition for naming our generated protobuf file. We
however do not want the package details being part of the
service/method names of the generated client code.
For that purpose we have used the `disable_package_emission` method
successfully in the past in order to generate code that does not have the
package details in the service/method names.
When we moved to tonic_prost_build however in [this PR](bdf10e47#diff-4a9729833e19e5f140e358c372e53f7ccf5e23de7c23062e4282127512dd621f), we have lost this functionality as the `emit_package` method does not seem to be honored.
In order to fix that and revert back to generating code with the correct service definitions
while still preserving the name of the generated rust file, this PR:
* removes the package definition from the protobuf file
* adds a post processing step that renames the generated `_.rs` file to what it is supposed to be
---
* fix(spiffe-proto): generate proto bindings without embedding package definition
Signed-off-by: Zahari Dichev <[email protected]>
* fmt
Signed-off-by: Zahari Dichev <[email protected]>
* set default package name instead of renaming file
---------
Signed-off-by: Zahari Dichev <[email protected]>
Co-authored-by: Alejandro Pedraza <[email protected]>1 parent 63438a0 commit 9e09c13
File tree
3 files changed
+6
-10
lines changed- spiffe-proto
- spiffe/proto
- src/gen
- tests
3 files changed
+6
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 150 | + | |
156 | 151 | | |
157 | 152 | | |
158 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
0 commit comments