Commit 105f644
This PR introduces the ability to include repository and artifact name
metadata in generated GAPIC libraries.
## Changes
### GAX (Google API Extensions)
- **`LibraryMetadata`**: Introduced a new internal class to hold
`repository` and `artifactName`.
- **`StubSettings` & `ClientContext`**: Added `LibraryMetadata` to these
classes to carry the metadata through the client lifecycle.
- **Observability/Tracing**: Updated `ApiTracerContext` and
`ObservabilityAttributes` to support these new attributes, enabling them
to be included in exported traces.
### GAPIC Generator
- Support for `repo` and `artifact` flags, passed down to generate a
method in `[Service]StubSettings` that builds an instance of
`LibraryMetadata`.
### Hermetic Build
- Support for `repo` and `artifact` to be passed down to
`generate_library.sh`. The flags reuse the existing logic that
determines the values.
## Verification Results
<img width="1412" height="877" alt="image"
src="https://github.com/user-attachments/assets/1b746361-db2b-4661-bbe6-38f7f63155aa"
/>
## Note on java-bigtable downstream check
Since
[SkipTrailersTest](https://github.com/googleapis/java-bigtable/blob/49fe7692c55747714ada4296ff0f856b1109eba5/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SkipTrailersTest.java#L97)
mocks the tracer factory, the `EndpointContext` call to
`apiTracerFactory.withContext()` returns a null factory, causing a null
pointer exception when building the client context.
We expect the test to be adjusted with this change with the next
release.
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
1 parent d9b39ed commit 105f644
File tree
60 files changed
+693
-30
lines changed- .cloudbuild/library_generation
- gapic-generator-java/src
- main/java/com/google/api/generator/gapic
- composer/common
- model
- protoparser
- test/java/com/google/api/generator
- gapic
- composer
- grpcrest/goldens
- grpc/goldens
- rest/goldens
- protoparser
- test/protoloader
- gax-java/gax/src
- main/java/com/google/api/gax
- rpc
- tracing
- test/java/com/google/api/gax/tracing
- hermetic_build/library_generation
- tests
- utils
- java-showcase/gapic-showcase/src
- main/java/com/google/showcase/v1beta1/stub
- test/java/com/google/showcase/v1beta1/it
- test/integration/goldens
- apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub
- asset/src/com/google/cloud/asset/v1/stub
- bigtable/src/com/google/cloud/bigtable/data/v2/stub
- compute/src/com/google/cloud/compute/v1small/stub
- credentials/src/com/google/cloud/iam/credentials/v1/stub
- iam/src/com/google/iam/v1/stub
- kms/src/com/google/cloud/kms/v1/stub
- library/src/com/google/cloud/example/library/v1/stub
- logging/src/com/google/cloud/logging/v2/stub
- pubsub/src/com/google/cloud/pubsub/v1/stub
- redis/src/com/google/cloud/redis/v1beta1/stub
- storage/src/com/google/storage/v2/stub
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
60 files changed
+693
-30
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| 213 | + | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
| |||
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
502 | | - | |
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
| |||
538 | 539 | | |
539 | 540 | | |
540 | 541 | | |
| 542 | + | |
541 | 543 | | |
542 | 544 | | |
543 | 545 | | |
| |||
1033 | 1035 | | |
1034 | 1036 | | |
1035 | 1037 | | |
| 1038 | + | |
1036 | 1039 | | |
1037 | 1040 | | |
1038 | 1041 | | |
| |||
1053 | 1056 | | |
1054 | 1057 | | |
1055 | 1058 | | |
| 1059 | + | |
1056 | 1060 | | |
1057 | 1061 | | |
1058 | 1062 | | |
| |||
2096 | 2100 | | |
2097 | 2101 | | |
2098 | 2102 | | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
2099 | 2145 | | |
2100 | 2146 | | |
2101 | 2147 | | |
| |||
2121 | 2167 | | |
2122 | 2168 | | |
2123 | 2169 | | |
| 2170 | + | |
2124 | 2171 | | |
2125 | 2172 | | |
2126 | 2173 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
133 | 143 | | |
134 | 144 | | |
135 | 145 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| |||
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
| 258 | + | |
| 259 | + | |
256 | 260 | | |
257 | 261 | | |
258 | 262 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
56 | 66 | | |
57 | 67 | | |
58 | 68 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
169 | 175 | | |
170 | 176 | | |
171 | 177 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
223 | 229 | | |
224 | 230 | | |
225 | 231 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
406 | 407 | | |
407 | 408 | | |
408 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
409 | 418 | | |
410 | 419 | | |
411 | 420 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
| |||
0 commit comments