Skip to content

Commit 071d7c8

Browse files
authored
Merge branch 'master' into renovate/bazel_skylib-1.x
2 parents f2b0f63 + 98b891f commit 071d7c8

357 files changed

Lines changed: 17373 additions & 4588 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/snippet-bot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
aggregateChecks: false
2+
alwaysCreateStatusCheck: false

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: bazel --batch test $(bazel query "//src/test/..." | grep "Test$") --noshow_progress --test_output=errors
5050

5151
- name: Integration Tests
52-
run: bazel --batch test //test/integration:asset //test/integration:credentials //test/integration:iam //test/integration:kms //test/integration:logging //test/integration:pubsub //test/integration:redis //test/integration:library --noshow_progress
52+
run: bazel --batch test //test/integration/...
5353

5454
- uses: actions/upload-artifact@v2
5555
if: ${{ failure() }}

BUILD.bazel

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ load(
88
package(default_visibility = ["//visibility:public"])
99

1010
JAVA_SRCS = [
11+
"//src/main/java/com/google/api/generator/debug:debug_files",
1112
"//src/main/java/com/google/api/generator:generator_files",
1213
"//src/main/java/com/google/api/generator/engine:engine_files",
1314
"//src/main/java/com/google/api/generator/gapic:gapic_files",
15+
"//src/main/java/com/google/api/generator/util:util_files",
1416
]
1517

1618
TEST_SRCS = [
1719
"//src/test/java/com/google/api/generator/engine:engine_files",
1820
"//src/test/java/com/google/api/generator/gapic:gapic_files",
21+
"//src/test/java/com/google/api/generator/testutils:testutils_files",
1922
"//src/test/java/com/google/api/generator/util:util_files",
2023
"//src/test/java/com/google/api/generator/test/framework:framework_files",
2124
]
@@ -45,6 +48,57 @@ java_binary(
4548
],
4649
)
4750

51+
# Request dumper binary, which dumps the CodeGeneratorRequest to a file on disk
52+
# which will be identical to the one passed to the protoc-gen-java_gapic during
53+
# normal execution. The dumped file then can be used to run this gapic-generator
54+
# directly (instead of relying on protoc to start the process), which would give
55+
# much greater flexibility in terms of debugging features, like attaching a
56+
# debugger, easier work with stdout and stderr etc.
57+
#
58+
# Usage example, via the rule in a corresponding BUILD.bazel file:
59+
#
60+
# load("@gapic_generator_java//rules_java_gapic:java_gapic.bzl", "java_generator_request_dump")
61+
# java_generator_request_dump(
62+
# name = "compute_small_request_dump",
63+
# srcs = [":compute_small_proto_with_info"],
64+
# transport = "rest",
65+
# )
66+
#
67+
java_binary(
68+
name = "protoc-gen-code_generator_request_dumper",
69+
main_class = "com.google.api.generator.debug.CodeGeneratorRequestDumper",
70+
runtime_deps = [
71+
"//src/main/java/com/google/api/generator",
72+
"//src/main/java/com/google/api/generator/debug",
73+
"//src/main/java/com/google/api/generator/gapic",
74+
"@com_google_googleapis//google/api:api_java_proto",
75+
"@com_google_googleapis//google/longrunning:longrunning_java_proto",
76+
"@com_google_guava_guava",
77+
"@com_google_protobuf//:protobuf_java",
78+
],
79+
)
80+
81+
# A binary similar to protoc-gen-java_gapic but reads the CodeGeneratorRequest
82+
# directly from a file instead of relying on protoc to pipe it in.
83+
#
84+
# Usage example:
85+
#
86+
# bazel run code_generator_request_file_to_gapic_main desc-dump.bin dump.jar
87+
#
88+
java_binary(
89+
name = "code_generator_request_file_to_gapic_main",
90+
main_class = "com.google.api.generator.debug.CodeGeneratorRequestFileToGapicMain",
91+
runtime_deps = [
92+
"//src/main/java/com/google/api/generator",
93+
"//src/main/java/com/google/api/generator/debug",
94+
"//src/main/java/com/google/api/generator/gapic",
95+
"@com_google_googleapis//google/api:api_java_proto",
96+
"@com_google_googleapis//google/longrunning:longrunning_java_proto",
97+
"@com_google_guava_guava",
98+
"@com_google_protobuf//:protobuf_java",
99+
],
100+
)
101+
48102
# google-java-format
49103
java_binary(
50104
name = "google_java_format_binary",

CHANGELOG.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,131 @@
11
# Changelog
22

3+
## [2.1.0](https://www.github.com/googleapis/gapic-generator-java/compare/v2.0.1...v2.1.0) (2021-08-17)
4+
5+
6+
### Features
7+
8+
* enable self signed jwt for gapic clients ([#794](https://www.github.com/googleapis/gapic-generator-java/issues/794)) ([1b7ee1e](https://www.github.com/googleapis/gapic-generator-java/commit/1b7ee1e3911e1c8ecab9a94d68d7a59b437d2449))
9+
10+
### [2.0.1](https://www.github.com/googleapis/gapic-generator-java/compare/v2.0.0...v2.0.1) (2021-08-06)
11+
12+
13+
### Bug Fixes
14+
15+
* bring back unused resnames for Ads ([#821](https://www.github.com/googleapis/gapic-generator-java/issues/821)) ([7fa135c](https://www.github.com/googleapis/gapic-generator-java/commit/7fa135c9aa60c9cb15880e098d36ea81b95ea488))
16+
* **resnames:** ensure deterministic resname order for samplegen ([#813](https://www.github.com/googleapis/gapic-generator-java/issues/813)) ([c4709df](https://www.github.com/googleapis/gapic-generator-java/commit/c4709df5d8ed9f0074f7e25df5db93e9d9b35749))
17+
18+
## [2.0.0](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.17...v2.0.0) (2021-08-03)
19+
20+
21+
### ⚠ BREAKING CHANGES
22+
23+
* remove Exception, unused resname classes for Java major version bump (#814)
24+
25+
### Features
26+
27+
* Lambda-ize single-method anon classes (Java 8+) ([#815](https://www.github.com/googleapis/gapic-generator-java/issues/815)) ([19b661c](https://www.github.com/googleapis/gapic-generator-java/commit/19b661cc78757e37ce93bae96eb81cb4ac32658b))
28+
* remove Exception, unused resname classes for Java major version bump ([#814](https://www.github.com/googleapis/gapic-generator-java/issues/814)) ([8abece2](https://www.github.com/googleapis/gapic-generator-java/commit/8abece20dd20e9ac8134df04301ce5b6e2ab76ad))
29+
30+
### [1.0.17](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.16...v1.0.17) (2021-08-02)
31+
32+
33+
### Features
34+
35+
* **ast:** Add support for multi-catch blocks [ggj] ([#811](https://www.github.com/googleapis/gapic-generator-java/issues/811)) ([55ef1a6](https://www.github.com/googleapis/gapic-generator-java/commit/55ef1a63427683538e48050333eedb0666635568))
36+
* **ast:** Add support for Throwable causes [ggj] ([#801](https://www.github.com/googleapis/gapic-generator-java/issues/801)) ([7fdeece](https://www.github.com/googleapis/gapic-generator-java/commit/7fdeeced7642fefdfdc5c6e898661c72fe9d78a8))
37+
* **ast:** support throwing all kinds of expressions ([#810](https://www.github.com/googleapis/gapic-generator-java/issues/810)) ([0817650](https://www.github.com/googleapis/gapic-generator-java/commit/0817650b35487f32d7987ba718ce71fc7551e3a0))
38+
39+
40+
### Bug Fixes
41+
42+
* (rest transport) Add `@BetaApi` to the generated `TransportServiceFactory` class and lro-specific method ([#787](https://www.github.com/googleapis/gapic-generator-java/issues/787)) ([ebe1aef](https://www.github.com/googleapis/gapic-generator-java/commit/ebe1aefbe860a41aabd8ced5268ccc6c7efdf791))
43+
* prevent hanging by call backgroundResources.close() on stub.close() [ggj] ([#804](https://www.github.com/googleapis/gapic-generator-java/issues/804)) ([428db97](https://www.github.com/googleapis/gapic-generator-java/commit/428db97c1534255a60530a8ed6137efc17ed56f4))
44+
* **resnames:** fallback to fully-qualified Object name upon proto typing conflicts [ggj] ([#803](https://www.github.com/googleapis/gapic-generator-java/issues/803)) ([e654bfb](https://www.github.com/googleapis/gapic-generator-java/commit/e654bfb936b571af2546f550c9a1589f8ad63d67))
45+
46+
47+
48+
### [1.0.16](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.15...v1.0.16) (2021-06-30)
49+
50+
51+
### Bug Fixes
52+
53+
* **bazel:** Eradicate monolith deps from Java µgen repo ([#778](https://www.github.com/googleapis/gapic-generator-java/issues/778)) ([86f2472](https://www.github.com/googleapis/gapic-generator-java/commit/86f2472963f020127ef6ff92be6241d12e2273af))
54+
* **build:** Update googleapis-discovery hash to fix compute integration test ([#782](https://www.github.com/googleapis/gapic-generator-java/issues/782)) ([46bb19a](https://www.github.com/googleapis/gapic-generator-java/commit/46bb19a7ee61da86b4be6d87a71f3cd210e753d2))
55+
* **protoc:** Mirror protoc's field name conflict resolution logic in client generation ([#781](https://www.github.com/googleapis/gapic-generator-java/issues/781)) ([9432979](https://www.github.com/googleapis/gapic-generator-java/commit/9432979bab59f48c8645fa47d752cdd470d4a682))
56+
57+
### [1.0.15](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.14...v1.0.15) (2021-06-22)
58+
59+
60+
### Features
61+
62+
* Implement field presence support for DIREGAPIC ([#774](https://www.github.com/googleapis/gapic-generator-java/issues/774)) ([c820361](https://www.github.com/googleapis/gapic-generator-java/commit/c82036105d299b0a1192cd0def5e68253e4f542c))
63+
64+
65+
### Bug Fixes
66+
67+
* **service.yaml:** Remove allowlist restriction ([#776](https://www.github.com/googleapis/gapic-generator-java/issues/776)) ([8f42efd](https://www.github.com/googleapis/gapic-generator-java/commit/8f42efdb92d606a768a524517fe949c4f9112025))
68+
69+
70+
### Miscellaneous Chores
71+
72+
* release 1.0.15 ([f752478](https://www.github.com/googleapis/gapic-generator-java/commit/f75247845344540a94c4efcd416f34f96ea0c2a3))
73+
74+
### [1.0.14](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.13...v1.0.14) (2021-06-17)
75+
76+
77+
### Features
78+
79+
* Add DIREGAPIC-specific pagination ([#767](https://www.github.com/googleapis/gapic-generator-java/issues/767)) ([1294c29](https://www.github.com/googleapis/gapic-generator-java/commit/1294c298f50cc4474ae562e6a07f37a5f94fe5b8))
80+
81+
82+
### Bug Fixes
83+
84+
* **bazel:** Remove monolith rule deps from the Java µgen Bazel rules ([#764](https://www.github.com/googleapis/gapic-generator-java/issues/764)) ([bff3efc](https://www.github.com/googleapis/gapic-generator-java/commit/bff3efc25e43692ea5b6e769c20d25d5b9a1e3d2))
85+
86+
87+
88+
### [1.0.13](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.12...v1.0.13) (2021-06-16)
89+
90+
91+
### Bug Fixes
92+
93+
* **resnames:** Fix resname builder name conflicts in ctor with this assignment ([#769](https://www.github.com/googleapis/gapic-generator-java/issues/769)) ([edac844](https://www.github.com/googleapis/gapic-generator-java/commit/edac8447d74c43ab0db963a37f66e1029ab19f0c))
94+
95+
### [1.0.12](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.11...v1.0.12) (2021-06-10)
96+
97+
98+
### Features
99+
100+
* add mtls support ([#672](https://www.github.com/googleapis/gapic-generator-java/issues/672)) ([1e24893](https://www.github.com/googleapis/gapic-generator-java/commit/1e24893a65daf8ef067e331364c591ac973b5e02))
101+
102+
103+
### Bug Fixes
104+
105+
* **mocks:** Use java.lang.Object if there are protos named 'Object' ([#760](https://www.github.com/googleapis/gapic-generator-java/issues/760)) ([2a7064b](https://www.github.com/googleapis/gapic-generator-java/commit/2a7064b88fe26586bd8aed43b7a7d28c7e974ec0))
106+
* **resnames:** Use anon resname classes when only wildcards are present ([#763](https://www.github.com/googleapis/gapic-generator-java/issues/763)) ([f0ecead](https://www.github.com/googleapis/gapic-generator-java/commit/f0ecead9f1cc645cdbb7f61cdfc820c7df95355d))
107+
108+
109+
### Miscellaneous Chores
110+
111+
* release 1.0.12 ([02eab0e](https://www.github.com/googleapis/gapic-generator-java/commit/02eab0ec61260048a2684119cfd4fa2172f3a637))
112+
113+
### [1.0.11](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.10...v1.0.11) (2021-06-07)
114+
115+
116+
### Features
117+
118+
* DIREGAPIC initial implementation ([#746](https://www.github.com/googleapis/gapic-generator-java/issues/746)) ([81f6737](https://www.github.com/googleapis/gapic-generator-java/commit/81f6737359ac6ce5ee2b42ab4f755fbb05a3cf28))
119+
120+
121+
### Bug Fixes
122+
123+
* **bazel:** ensure integration tests diff files recursively ([#745](https://www.github.com/googleapis/gapic-generator-java/issues/745)) ([ddc75f9](https://www.github.com/googleapis/gapic-generator-java/commit/ddc75f9f3b84d0ea50638a79a63d40cf551211e2))
124+
* **resnames:** filter out mixin services from resname pkg candidates ([#751](https://www.github.com/googleapis/gapic-generator-java/issues/751)) ([72fa76f](https://www.github.com/googleapis/gapic-generator-java/commit/72fa76f27379a74a143b1735f60ae3e00da4c1a6))
125+
* **tests:** Ensure deterministic field ordering in test classes ([#743](https://www.github.com/googleapis/gapic-generator-java/issues/743)) ([fdb705b](https://www.github.com/googleapis/gapic-generator-java/commit/fdb705b0a39443fb0b7679d879f27e0aa1c36b67))
126+
* **tests:** handle Java 11 set ordering differences for RPCs and fields in test/mock classes ([#750](https://www.github.com/googleapis/gapic-generator-java/issues/750)) ([eaf4592](https://www.github.com/googleapis/gapic-generator-java/commit/eaf4592e139fbc42810e7f60dc9967320195bf85))
127+
128+
3129
### [1.0.10](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.9...v1.0.10) (2021-05-26)
4130

5131

DEVELOPMENT.md

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,40 @@
1515
## Running the Plugin
1616

1717
1. Clone [googleapis](https://github.com/googleapis/googleapis) and
18-
[gapic-showcase](https://github.com/googleapis/gapic-showcase/) and install
19-
protoc.
18+
[gapic-showcase](https://github.com/googleapis/gapic-showcase/).
2019

2120
2. Copy the protos from Showcase into googleapis/google/showcase.
2221

2322
```sh
24-
cp gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta
23+
mkdir googleapis/google/showcase
24+
cp -r gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta1
2525
```
2626

27-
3. Add the new microgenerator rules to the protobuf directory's `BUILD.bazel`
28-
file as follows:
27+
3. Add the new microgenerator rules to
28+
`googleapis/google/showcase/v1beta1/BUILD.bazel` file as follows:
2929

3030
```python
3131
load(
3232
"@com_google_googleapis_imports//:imports.bzl",
3333
# Existing rules here.
3434
"java_gapic_assembly_gradle_pkg",
3535
"java_gapic_library",
36+
"java_proto_library",
37+
"proto_library_with_info",
38+
)
39+
40+
proto_library_with_info(
41+
name = "showcase_proto_with_info",
42+
deps = [
43+
":showcase_proto",
44+
],
45+
)
46+
47+
java_proto_library(
48+
name = "showcase_java_proto",
49+
deps = [
50+
"showcase_proto",
51+
],
3652
)
3753
3854
# This should either replace the existing monolith target or have a unique name
@@ -97,13 +113,6 @@
97113
bazel run //src/test/java/com/google/api/generator/engine:JavaCodeGeneratorTest
98114
```
99115

100-
- Update goldens files based on code generation in unit test, for example
101-
`JavaCodeGeneratorTest.java`
102-
103-
```sh
104-
bazel run //src/test/java/com/google/api/generator/engine:JavaCodeGeneratorTest_update
105-
```
106-
107116
- Run a single integration test for API like `Redis`, it generates Java source
108117
code using the Java microgenerator and compares them with the goldens files
109118
in `test/integration/goldens/redis`.
@@ -112,10 +121,20 @@
112121
bazel test //test/integration:redis
113122
```
114123

115-
- Update goldens files based on code generation in integration test, for
116-
example `Redis`. It generates Java source code using the Java microgenerator
117-
and overwrites the goldens files in `test/integration/goldens/redis` based
118-
on code generation.
124+
- Run all unit and integration tests.
125+
126+
```sh
127+
bazel test $(bazel query "src/test/..." | grep "Test$") //test/integration/...
128+
```
129+
130+
- Update unit test golden files, for example `JavaCodeGeneratorTest.java`:
131+
132+
```sh
133+
bazel run //src/test/java/com/google/api/generator/engine:JavaCodeGeneratorTest_update
134+
```
135+
136+
- Update integration test golden files, for example `Redis`. This clobbers all the
137+
files in `test/integration/goldens/redis`.
119138

120139
```sh
121140
bazel run //test/integration:redis_update

SECURITY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Security Policy
2+
3+
To report a security issue, please use [g.co/vulnz](https://g.co/vulnz).
4+
5+
The Google Security Team will respond within 5 working days of your report on g.co/vulnz.
6+
7+
We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue.

0 commit comments

Comments
 (0)