Skip to content

Commit 1d6f1f1

Browse files
committed
bazel: Verify Maven deps in bzlmod and WORKSPACE match
The text between the GRPC_DEPS_{START,END} must be identical in formatting. Probably not a problem in general and not necessarily bad. But it is simplistic. Eric waking up this morning: > We need more sed.
1 parent 32d48ae commit 1d6f1f1

File tree

3 files changed

+48
-37
lines changed

3 files changed

+48
-37
lines changed

.github/workflows/testing.yml

+5
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ jobs:
8181
steps:
8282
- uses: actions/checkout@v3
8383

84+
- name: Check versions match in MODULE.bazel and repositories.bzl
85+
run: |
86+
diff -u <(sed -n '/GRPC_DEPS_START/,/GRPC_DEPS_END/ {/GRPC_DEPS_/! p}' MODULE.bazel) \
87+
<(sed -n '/GRPC_DEPS_START/,/GRPC_DEPS_END/ {/GRPC_DEPS_/! p}' repositories.bzl)
88+
8489
- name: Bazel cache
8590
uses: actions/cache@v3
8691
with:

MODULE.bazel

+41-37
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,46 @@ module(
55
version = "0",
66
)
77

8+
# GRPC_DEPS_START
9+
IO_GRPC_GRPC_JAVA_ARTIFACTS = [
10+
"com.google.android:annotations:4.1.1.4",
11+
"com.google.api.grpc:proto-google-common-protos:2.29.0",
12+
"com.google.auth:google-auth-library-credentials:1.22.0",
13+
"com.google.auth:google-auth-library-oauth2-http:1.22.0",
14+
"com.google.auto.value:auto-value-annotations:1.10.4",
15+
"com.google.auto.value:auto-value:1.10.4",
16+
"com.google.code.findbugs:jsr305:3.0.2",
17+
"com.google.code.gson:gson:2.10.1",
18+
"com.google.errorprone:error_prone_annotations:2.23.0",
19+
"com.google.guava:failureaccess:1.0.1",
20+
"com.google.guava:guava:32.1.3-android",
21+
"com.google.re2j:re2j:1.7",
22+
"com.google.truth:truth:1.1.5",
23+
"com.squareup.okhttp:okhttp:2.7.5",
24+
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
25+
"io.netty:netty-buffer:4.1.100.Final",
26+
"io.netty:netty-codec-http2:4.1.100.Final",
27+
"io.netty:netty-codec-http:4.1.100.Final",
28+
"io.netty:netty-codec-socks:4.1.100.Final",
29+
"io.netty:netty-codec:4.1.100.Final",
30+
"io.netty:netty-common:4.1.100.Final",
31+
"io.netty:netty-handler-proxy:4.1.100.Final",
32+
"io.netty:netty-handler:4.1.100.Final",
33+
"io.netty:netty-resolver:4.1.100.Final",
34+
"io.netty:netty-tcnative-boringssl-static:2.0.61.Final",
35+
"io.netty:netty-tcnative-classes:2.0.61.Final",
36+
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.100.Final",
37+
"io.netty:netty-transport-native-unix-common:4.1.100.Final",
38+
"io.netty:netty-transport:4.1.100.Final",
39+
"io.opencensus:opencensus-api:0.31.0",
40+
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
41+
"io.perfmark:perfmark-api:0.26.0",
42+
"junit:junit:4.13.2",
43+
"org.apache.tomcat:annotations-api:6.0.53",
44+
"org.codehaus.mojo:animal-sniffer-annotations:1.23",
45+
]
46+
# GRPC_DEPS_END
47+
848
bazel_dep(name = "googleapis", repo_name = "com_google_googleapis", version = "0.0.0-20240326-1c8d509c5")
949
bazel_dep(name = "grpc", repo_name = "com_github_grpc_grpc", version = "1.56.3.bcr.1")
1050
bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "23.1")
@@ -34,43 +74,7 @@ use_repo(
3474
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
3575

3676
maven.install(
37-
artifacts = [
38-
"com.google.android:annotations:4.1.1.4",
39-
"com.google.api.grpc:proto-google-common-protos:2.29.0",
40-
"com.google.auth:google-auth-library-credentials:1.22.0",
41-
"com.google.auth:google-auth-library-oauth2-http:1.22.0",
42-
"com.google.auto.value:auto-value-annotations:1.10.4",
43-
"com.google.auto.value:auto-value:1.10.4",
44-
"com.google.code.findbugs:jsr305:3.0.2",
45-
"com.google.code.gson:gson:2.10.1",
46-
"com.google.errorprone:error_prone_annotations:2.23.0",
47-
"com.google.guava:failureaccess:1.0.1",
48-
"com.google.guava:guava:32.1.3-android",
49-
"com.google.re2j:re2j:1.7",
50-
"com.google.truth:truth:1.1.5",
51-
"com.squareup.okhttp:okhttp:2.7.5",
52-
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
53-
"io.netty:netty-buffer:4.1.100.Final",
54-
"io.netty:netty-codec-http2:4.1.100.Final",
55-
"io.netty:netty-codec-http:4.1.100.Final",
56-
"io.netty:netty-codec-socks:4.1.100.Final",
57-
"io.netty:netty-codec:4.1.100.Final",
58-
"io.netty:netty-common:4.1.100.Final",
59-
"io.netty:netty-handler-proxy:4.1.100.Final",
60-
"io.netty:netty-handler:4.1.100.Final",
61-
"io.netty:netty-resolver:4.1.100.Final",
62-
"io.netty:netty-tcnative-boringssl-static:2.0.61.Final",
63-
"io.netty:netty-tcnative-classes:2.0.61.Final",
64-
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.100.Final",
65-
"io.netty:netty-transport-native-unix-common:4.1.100.Final",
66-
"io.netty:netty-transport:4.1.100.Final",
67-
"io.opencensus:opencensus-api:0.31.0",
68-
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
69-
"io.perfmark:perfmark-api:0.26.0",
70-
"junit:junit:4.13.2",
71-
"org.apache.tomcat:annotations-api:6.0.53",
72-
"org.codehaus.mojo:animal-sniffer-annotations:1.23",
73-
],
77+
artifacts = IO_GRPC_GRPC_JAVA_ARTIFACTS,
7478
repositories = [
7579
"https://repo.maven.apache.org/maven2/",
7680
],

repositories.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
99
# # Your own deps
1010
# ] + IO_GRPC_GRPC_JAVA_ARTIFACTS,
1111
# )
12+
# GRPC_DEPS_START
1213
IO_GRPC_GRPC_JAVA_ARTIFACTS = [
1314
"com.google.android:annotations:4.1.1.4",
1415
"com.google.api.grpc:proto-google-common-protos:2.29.0",
@@ -46,6 +47,7 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
4647
"org.apache.tomcat:annotations-api:6.0.53",
4748
"org.codehaus.mojo:animal-sniffer-annotations:1.23",
4849
]
50+
# GRPC_DEPS_END
4951

5052
# For use with maven_install's override_targets.
5153
# maven_install(

0 commit comments

Comments
 (0)