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.
This commit is contained in:
Eric Anderson 2024-04-04 11:33:03 -07:00
parent 32d48ae89a
commit 1d6f1f1b42
3 changed files with 48 additions and 37 deletions

View File

@ -81,6 +81,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Check versions match in MODULE.bazel and repositories.bzl
run: |
diff -u <(sed -n '/GRPC_DEPS_START/,/GRPC_DEPS_END/ {/GRPC_DEPS_/! p}' MODULE.bazel) \
<(sed -n '/GRPC_DEPS_START/,/GRPC_DEPS_END/ {/GRPC_DEPS_/! p}' repositories.bzl)
- name: Bazel cache - name: Bazel cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:

View File

@ -5,36 +5,8 @@ module(
version = "0", version = "0",
) )
bazel_dep(name = "googleapis", repo_name = "com_google_googleapis", version = "0.0.0-20240326-1c8d509c5") # GRPC_DEPS_START
bazel_dep(name = "grpc", repo_name = "com_github_grpc_grpc", version = "1.56.3.bcr.1") IO_GRPC_GRPC_JAVA_ARTIFACTS = [
bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "23.1")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_go", repo_name = "io_bazel_rules_go", version = "0.46.0")
bazel_dep(name = "rules_jvm_external", version = "6.0")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
non_module_deps = use_extension("//:repositories.bzl", "grpc_java_repositories_extension")
use_repo(
non_module_deps,
"com_github_cncf_xds",
"envoy_api",
"io_grpc_grpc_proto",
)
grpc_repo_deps_ext = use_extension("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_repo_deps_ext")
use_repo(
grpc_repo_deps_ext,
"com_envoyproxy_protoc_gen_validate",
"com_github_cncf_udpa",
"opencensus_proto",
)
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
"com.google.android:annotations:4.1.1.4", "com.google.android:annotations:4.1.1.4",
"com.google.api.grpc:proto-google-common-protos:2.29.0", "com.google.api.grpc:proto-google-common-protos:2.29.0",
"com.google.auth:google-auth-library-credentials:1.22.0", "com.google.auth:google-auth-library-credentials:1.22.0",
@ -70,7 +42,39 @@ maven.install(
"junit:junit:4.13.2", "junit:junit:4.13.2",
"org.apache.tomcat:annotations-api:6.0.53", "org.apache.tomcat:annotations-api:6.0.53",
"org.codehaus.mojo:animal-sniffer-annotations:1.23", "org.codehaus.mojo:animal-sniffer-annotations:1.23",
], ]
# GRPC_DEPS_END
bazel_dep(name = "googleapis", repo_name = "com_google_googleapis", version = "0.0.0-20240326-1c8d509c5")
bazel_dep(name = "grpc", repo_name = "com_github_grpc_grpc", version = "1.56.3.bcr.1")
bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "23.1")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_go", repo_name = "io_bazel_rules_go", version = "0.46.0")
bazel_dep(name = "rules_jvm_external", version = "6.0")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
non_module_deps = use_extension("//:repositories.bzl", "grpc_java_repositories_extension")
use_repo(
non_module_deps,
"com_github_cncf_xds",
"envoy_api",
"io_grpc_grpc_proto",
)
grpc_repo_deps_ext = use_extension("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_repo_deps_ext")
use_repo(
grpc_repo_deps_ext,
"com_envoyproxy_protoc_gen_validate",
"com_github_cncf_udpa",
"opencensus_proto",
)
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = IO_GRPC_GRPC_JAVA_ARTIFACTS,
repositories = [ repositories = [
"https://repo.maven.apache.org/maven2/", "https://repo.maven.apache.org/maven2/",
], ],

View File

@ -9,6 +9,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# # Your own deps # # Your own deps
# ] + IO_GRPC_GRPC_JAVA_ARTIFACTS, # ] + IO_GRPC_GRPC_JAVA_ARTIFACTS,
# ) # )
# GRPC_DEPS_START
IO_GRPC_GRPC_JAVA_ARTIFACTS = [ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
"com.google.android:annotations:4.1.1.4", "com.google.android:annotations:4.1.1.4",
"com.google.api.grpc:proto-google-common-protos:2.29.0", "com.google.api.grpc:proto-google-common-protos:2.29.0",
@ -46,6 +47,7 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
"org.apache.tomcat:annotations-api:6.0.53", "org.apache.tomcat:annotations-api:6.0.53",
"org.codehaus.mojo:animal-sniffer-annotations:1.23", "org.codehaus.mojo:animal-sniffer-annotations:1.23",
] ]
# GRPC_DEPS_END
# For use with maven_install's override_targets. # For use with maven_install's override_targets.
# maven_install( # maven_install(