Skip to content

Commit 4b44e38

Browse files
Merge branch 'master' into policy-bot-af9e6af6-8c09-4ffc-b3ff-b83860414a08
2 parents 8fa9b57 + a705654 commit 4b44e38

188 files changed

Lines changed: 10846 additions & 819 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: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,86 @@
11
# Changelog
22

3+
### [1.0.16](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.15...v1.0.16) (2021-06-30)
4+
5+
6+
### Bug Fixes
7+
8+
* **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))
9+
* **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))
10+
* **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))
11+
12+
### [1.0.15](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.14...v1.0.15) (2021-06-22)
13+
14+
15+
### Features
16+
17+
* 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))
18+
19+
20+
### Bug Fixes
21+
22+
* **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))
23+
24+
25+
### Miscellaneous Chores
26+
27+
* release 1.0.15 ([f752478](https://www.github.com/googleapis/gapic-generator-java/commit/f75247845344540a94c4efcd416f34f96ea0c2a3))
28+
29+
### [1.0.14](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.13...v1.0.14) (2021-06-17)
30+
31+
32+
### Features
33+
34+
* 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))
35+
36+
37+
### Bug Fixes
38+
39+
* **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))
40+
41+
42+
43+
### [1.0.13](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.12...v1.0.13) (2021-06-16)
44+
45+
46+
### Bug Fixes
47+
48+
* **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))
49+
50+
### [1.0.12](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.11...v1.0.12) (2021-06-10)
51+
52+
53+
### Features
54+
55+
* 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))
56+
57+
58+
### Bug Fixes
59+
60+
* **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))
61+
* **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))
62+
63+
64+
### Miscellaneous Chores
65+
66+
* release 1.0.12 ([02eab0e](https://www.github.com/googleapis/gapic-generator-java/commit/02eab0ec61260048a2684119cfd4fa2172f3a637))
67+
68+
### [1.0.11](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.10...v1.0.11) (2021-06-07)
69+
70+
71+
### Features
72+
73+
* 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))
74+
75+
76+
### Bug Fixes
77+
78+
* **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))
79+
* **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))
80+
* **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))
81+
* **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))
82+
83+
384
### [1.0.10](https://www.github.com/googleapis/gapic-generator-java/compare/v1.0.9...v1.0.10) (2021-05-26)
485

586

WORKSPACE

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
workspace(name = "gapic_generator_java")
22

33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4+
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
45

56
# DO NOT REMOVE.
67
# This is needed to clobber any transitively-pulled in versions of bazel_skylib so that packages
@@ -14,6 +15,42 @@ http_archive(
1415
],
1516
)
1617

18+
jvm_maven_import_external(
19+
name = "google_java_format_all_deps",
20+
artifact = "com.google.googlejavaformat:google-java-format:jar:all-deps:1.7",
21+
licenses = [
22+
"notice",
23+
"reciprocal",
24+
],
25+
server_urls = [
26+
"https://repo.maven.apache.org/maven2/",
27+
"http://repo1.maven.org/maven2/",
28+
],
29+
)
30+
31+
# gax-java and its transitive dependencies must be imported before
32+
# gapic-generator-java dependencies to match the order in googleapis repository,
33+
# which in its turn, prioritizes actual generated clients runtime dependencies
34+
# over the generator dependencies.
35+
_gax_java_version = "1.65.1"
36+
37+
http_archive(
38+
name = "com_google_api_gax_java",
39+
strip_prefix = "gax-java-%s" % _gax_java_version,
40+
urls = ["https://github.com/googleapis/gax-java/archive/v%s.zip" % _gax_java_version],
41+
)
42+
43+
load("@com_google_api_gax_java//:repository_rules.bzl", "com_google_api_gax_java_properties")
44+
45+
com_google_api_gax_java_properties(
46+
name = "com_google_api_gax_java_properties",
47+
file = "@com_google_api_gax_java//:dependencies.properties",
48+
)
49+
50+
load("@com_google_api_gax_java//:repositories.bzl", "com_google_api_gax_java_repositories")
51+
52+
com_google_api_gax_java_repositories()
53+
1754
load("//:repository_rules.bzl", "gapic_generator_java_properties")
1855

1956
gapic_generator_java_properties(
@@ -31,14 +68,16 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
3168

3269
protobuf_deps()
3370

34-
# Java dependencies.
35-
# Import the monolith so we can transitively use its gapic rules for googleapis.
71+
# Bazel rules.
72+
_rules_gapic_version = "0.5.5"
73+
3674
http_archive(
37-
name = "com_google_api_codegen",
38-
strip_prefix = "gapic-generator-2.4.6",
39-
urls = ["https://github.com/googleapis/gapic-generator/archive/v2.4.6.zip"],
75+
name = "rules_gapic",
76+
strip_prefix = "rules_gapic-%s" % _rules_gapic_version,
77+
urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version],
4078
)
4179

80+
# Java dependencies.
4281
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
4382

4483
switched_rules_by_language(
@@ -48,25 +87,12 @@ switched_rules_by_language(
4887
java = True,
4988
)
5089

51-
_gax_java_version = PROPERTIES["version.com_google_gax_java"]
52-
53-
http_archive(
54-
name = "com_google_api_gax_java",
55-
strip_prefix = "gax-java-%s" % _gax_java_version,
56-
urls = ["https://github.com/googleapis/gax-java/archive/v%s.zip" % _gax_java_version],
57-
)
58-
59-
load("@com_google_api_gax_java//:repository_rules.bzl", "com_google_api_gax_java_properties")
60-
61-
com_google_api_gax_java_properties(
62-
name = "com_google_api_gax_java_properties",
63-
file = "@com_google_api_gax_java//:dependencies.properties",
64-
)
65-
66-
load("@com_google_api_gax_java//:repositories.bzl", "com_google_api_gax_java_repositories")
67-
68-
com_google_api_gax_java_repositories()
69-
7090
load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
7191

7292
grpc_java_repositories()
93+
94+
http_archive(
95+
name = "com_google_disco_to_proto3_converter",
96+
strip_prefix = "disco-to-proto3-converter-4b0956884b1aa9b367cf41488b622dc12eb16652",
97+
urls = ["https://github.com/googleapis/disco-to-proto3-converter/archive/4b0956884b1aa9b367cf41488b622dc12eb16652.zip"],
98+
)

dependencies.properties

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
# The properties format is the following:
55
# <dependency_type>[.<artifact_name>]=<value>
66

7-
# Target workspace name: com_google_api_codegen
7+
# Target workspace name: gapic_generator_java
88

99
# Versions only, for dependencies which actual artifacts differ between Bazel and Gradle
10-
version.com_google_protobuf=3.13.0
10+
version.com_google_protobuf=3.15.8
1111
# Version of google-java-format is downgraded from 1.8 to 1.7, because 1.8 supports java 11 minimum, while our JRE is java 8.
1212
version.google_java_format=1.7
1313
version.com_google_api_common_java=1.9.3
14-
version.com_google_gax_java=1.62.0
1514
version.io_grpc_java=1.30.2
1615

1716
# Common deps.
@@ -20,7 +19,7 @@ maven.com_google_code_findbugs_jsr305=com.google.code.findbugs:jsr305:3.0.0
2019
maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.7.2
2120
maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.7.2
2221
maven.com_google_code_gson=com.google.code.gson:gson:2.8.6
23-
maven.com_google_protobuf_protobuf_java=com.google.protobuf:protobuf-java:3.12.2
22+
maven.com_google_protobuf_protobuf_java=com.google.protobuf:protobuf-java:3.15.8
2423
maven.io_github_java_diff_utils=io.github.java-diff-utils:java-diff-utils:4.0
2524
maven.javax_annotation_javax_annotation_api=javax.annotation:javax.annotation-api:1.3.2
2625
maven.javax_validation_javax_validation_api=javax.validation:validation-api:2.0.1.Final
@@ -33,7 +32,7 @@ maven.org_threeten_threetenbp=org.threeten:threetenbp:1.3.3
3332

3433
# Testing.
3534
maven.junit_junit=junit:junit:4.13.1
36-
# This hamcrest-core dependency is for running JUnit test manually, before JUnit 4.11 it's wrapped along with JUnit package.
35+
# This hamcrest-core dependency is for running JUnit test manually, before JUnit 4.11 it's wrapped along with JUnit package.
3736
# But now it has to be explicitly added.
3837
maven.org_hamcrest_hamcrest_core=org.hamcrest:hamcrest-core:1.3
3938
maven.org_mockito_mockito_core=org.mockito:mockito-core:2.21.0

repositories.bzl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,18 @@ def gapic_generator_java_repositories():
5959
_maybe(
6060
http_archive,
6161
name = "com_google_googleapis",
62-
strip_prefix = "googleapis-2bea43cdc7a4443876380732980d83cd8d560582",
62+
strip_prefix = "googleapis-2c1d1b27646cba6f14b760b635f29fafc5a74ca6",
6363
urls = [
64-
"https://github.com/googleapis/googleapis/archive/2bea43cdc7a4443876380732980d83cd8d560582.zip",
64+
"https://github.com/googleapis/googleapis/archive/2c1d1b27646cba6f14b760b635f29fafc5a74ca6.zip",
65+
],
66+
)
67+
68+
_maybe(
69+
http_archive,
70+
name = "com_google_googleapis_discovery",
71+
strip_prefix = "googleapis-discovery-abf4cec1ce9e02e4d7d650bf66137c347cdd0d44",
72+
urls = [
73+
"https://github.com/googleapis/googleapis-discovery/archive/abf4cec1ce9e02e4d7d650bf66137c347cdd0d44.zip",
6574
],
6675
)
6776

0 commit comments

Comments
 (0)