From 6ac2a6249f302e514a88e4019ced9c31c1ac4644 Mon Sep 17 00:00:00 2001 From: Aaron Steinfeld Date: Sat, 2 Aug 2025 09:27:16 -0400 Subject: [PATCH 1/3] chore: update protobuf --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 31da485..f84c6b5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -protoc = "3.25.5" +protoc = "3.25.8" grpc = "1.68.3" hypertrace-framework = "0.1.89" hypertrace-grpcutils = "0.13.14" From 997b8308d56411061fa1be43bda5c3cf0029a986 Mon Sep 17 00:00:00 2001 From: Aaron Steinfeld Date: Sat, 2 Aug 2025 10:44:24 -0400 Subject: [PATCH 2/3] chore: add other missing deps --- gradle/libs.versions.toml | 11 +++++++++++ hypertrace-bom/build.gradle.kts | 6 ++++++ test-consumer/build.gradle.kts | 10 ++++++++++ 3 files changed, 27 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f84c6b5..a32d529 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,11 +16,14 @@ junit = "5.10.0" mockito = "5.8.0" [libraries] +apache-httpcomponents-httpclient = { module = "org.apache.httpcomponents:httpclient", version = "4.5.13" } +awaitility = { module = "org.awaitility:awaitility", version = "4.0.3" } guava = { module = "com.google.guava:guava", version = "32.1.2-jre" } rholder-guava-retrying = { module = "com.github.rholder:guava-retrying", version = "2.0.0" } gson = { module = "com.google.code.gson:gson", version = "2.13.1" } guice = { module = "com.google.inject:guice", version = "6.0.0" } guice7 = { module = "com.google.inject:guice", version = "7.0.0" } +guice-servlet = { module = "com.google.inject.extensions:guice-servlet", version = "7.0.0" } google-re2j = { module = "com.google.re2j:re2j", version = "1.7" } typesafe-config = { module = "com.typesafe:config", version = "1.4.2" } lombok = { module = "org.projectlombok:lombok", version = "1.18.30" } @@ -32,11 +35,17 @@ grpc-api = { module = "io.grpc:grpc-api" } grpc-netty = { module = "io.grpc:grpc-netty" } grpc-context = { module = "io.grpc:grpc-context" } grpc-inprocess = { module = "io.grpc:grpc-inprocess" } +grpc-services = { module = "io.grpc:grpc-services" } jackson-bom = { module = "com.fasterxml.jackson:jackson-bom", version = "2.16.1" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind" } jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" } jackson-datatype-jdk8 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" } +jakarta-inject-api = { module = "jakarta.inject:jakarta.inject-api", version = "2.0.1" } +jakarta-servlet-api = { module = "jakarta.servlet:jakarta.servlet-api", version = "6.0.0" } jetty-bom = { module = "org.eclipse.jetty:jetty-bom", version.ref = "jetty" } +jetty-servlet = { module = "org.eclipse.jetty:jetty-servlet" } +jetty-server = { module = "org.eclipse.jetty:jetty-server" } +jetty-servlets = { module = "org.eclipse.jetty:jetty-servlets" } netty-bom = { module = "io.netty:netty-bom", version.ref = "netty" } protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "protoc" } protobuf-javautil = { module = "com.google.protobuf:protobuf-java-util", version.ref = "protoc" } @@ -54,6 +63,7 @@ kafka-clients = { module = "org.apache.kafka:kafka-clients" } hypertrace-grpcutils-context = { module = "org.hypertrace.core.grpcutils:grpc-context-utils", version.ref = "hypertrace-grpcutils" } hypertrace-grpcutils-client = { module = "org.hypertrace.core.grpcutils:grpc-client-utils", version.ref = "hypertrace-grpcutils" } +hypertrace-grpcutils-server = { module = "org.hypertrace.core.grpcutils:grpc-server-utils", version.ref = "hypertrace-grpcutils" } hypertrace-grpcutils-rx-client = { module = "org.hypertrace.core.grpcutils:grpc-client-rx-utils", version.ref = "hypertrace-grpcutils" } hypertrace-grpcutils-rx-server = { module = "org.hypertrace.core.grpcutils:grpc-server-rx-utils", version.ref = "hypertrace-grpcutils" } @@ -98,6 +108,7 @@ hypertrace-repository = { id = "org.hypertrace.repository-plugin", version = "0. hypertrace-ciutils = { id = "org.hypertrace.ci-utils-plugin", version = "0.4.0" } hypertrace-publish = { id = "org.hypertrace.publish-plugin", version = "1.1.1" } hypertrace-jacoco = { id = "org.hypertrace.jacoco-report-plugin", version = "0.3.0" } +hypertrace-java-convention = { id = "org.hypertrace.java-convention", version = "0.4.0" } hypertrace-integrationtest = { id = "org.hypertrace.integration-test-plugin", version = "0.3.0" } hypertrace-codestyle = { id = "org.hypertrace.code-style-plugin", version = "2.2.0" } hypertrace-docker-publish = { id = "org.hypertrace.docker-publish-plugin", version = "0.11.3" } diff --git a/hypertrace-bom/build.gradle.kts b/hypertrace-bom/build.gradle.kts index 4e7edf5..7b976a5 100644 --- a/hypertrace-bom/build.gradle.kts +++ b/hypertrace-bom/build.gradle.kts @@ -16,6 +16,7 @@ dependencies { constraints { api(libs.hypertrace.grpcutils.context) api(libs.hypertrace.grpcutils.client) + api(libs.hypertrace.grpcutils.server) api(libs.hypertrace.grpcutils.rx.client) api(libs.hypertrace.grpcutils.rx.server) api(libs.hypertrace.framework.grpc) @@ -53,5 +54,10 @@ dependencies { api(libs.commons.text) api(libs.graphql.java) api(libs.jsr305) + api(libs.apache.httpcomponents.httpclient) + api(libs.awaitility) + api(libs.guice.servlet) + api(libs.jakarta.inject.api) + api(libs.jakarta.servlet.api) } } diff --git a/test-consumer/build.gradle.kts b/test-consumer/build.gradle.kts index 6cdf0d8..65c24b7 100644 --- a/test-consumer/build.gradle.kts +++ b/test-consumer/build.gradle.kts @@ -6,6 +6,7 @@ dependencies { api(platform(projects.hypertraceBom)) api(libs.hypertrace.grpcutils.context) api(libs.hypertrace.grpcutils.client) + api(libs.hypertrace.grpcutils.server) api(libs.hypertrace.grpcutils.rx.client) api(libs.hypertrace.grpcutils.rx.server) api(libs.hypertrace.framework.grpc) @@ -30,6 +31,7 @@ dependencies { api(libs.gson) api(libs.google.re2j) api(libs.guice7) + api(libs.guice.servlet) api(libs.typesafe.config) api(libs.lombok) api(libs.protobuf.java) @@ -44,6 +46,7 @@ dependencies { api(libs.grpc.context) api(libs.grpc.inprocess) api(libs.grpc.netty) + api(libs.grpc.services) api(libs.slf4j2.api) api(libs.log4j.slf4j2.impl) api(libs.javax.annotation) @@ -59,6 +62,13 @@ dependencies { api(libs.hypertrace.framework.spi.jakarta) api(libs.hypertrace.integrationtest.framework.jakarta) api(libs.hypertrace.framework.documentstore.metrics.jakarta) + api(libs.apache.httpcomponents.httpclient) + api(libs.awaitility) + api(libs.jakarta.inject.api) + api(libs.jakarta.servlet.api) + api(libs.jetty.server) + api(libs.jetty.servlet) + api(libs.jetty.servlets) } tasks.register("verifyResolution") { From f21592d1ec73decacae8df7d98da318b3ccc7593 Mon Sep 17 00:00:00 2001 From: Aaron Steinfeld Date: Sat, 2 Aug 2025 11:06:58 -0400 Subject: [PATCH 3/3] ci: add upgrade hook support --- .github/workflows/upgrade-version.yml | 71 +++++++++++++++++++++++++++ scripts/requirements.txt | 1 + scripts/upgrade-version.py | 25 ++++++++++ 3 files changed, 97 insertions(+) create mode 100644 .github/workflows/upgrade-version.yml create mode 100644 scripts/requirements.txt create mode 100644 scripts/upgrade-version.py diff --git a/.github/workflows/upgrade-version.yml b/.github/workflows/upgrade-version.yml new file mode 100644 index 0000000..d64d061 --- /dev/null +++ b/.github/workflows/upgrade-version.yml @@ -0,0 +1,71 @@ +name: Upgrade Repository Version + +on: + repository_dispatch: + types: [upgrade-version] + +jobs: + upgrade-version: + runs-on: ubuntu-24.04 + + permissions: + pull-requests: write + contents: write + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - name: Install Python Dependencies + run: | + python -m pip install --upgrade pip + pip install -r scripts/requirements.txt + + - name: Set Variables + run: | + echo "REPOSITORY=${{ github.event.client_payload.repository }}" >> $GITHUB_ENV + echo "VERSION=${{ github.event.client_payload.version }}" >> $GITHUB_ENV + + - name: Upgrade Version in TOML + run: | + python scripts/upgrade-version.py ${{ env.REPOSITORY }} ${{ env.VERSION }} + + - name: Get Token from Github App + uses: tibdex/github-app-token@v2 + id: generate-token + with: + app_id: ${{ secrets.GH_CI_APP_ID }} + private_key: ${{ secrets.GH_CI_APP_PRIVATE_KEY }} + repositories: >- + ["hypertrace-bom"] + + - name: Create Pull Request + id: create_pr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ steps.generate-token.outputs.token }} + base: main + title: "chore(${{ env.REPOSITORY }}): Upgrade ${{ env.VERSION }}" + commit-message: "chore(${{ env.REPOSITORY }}): Upgrade ${{ env.VERSION }}" + body: "Upgrading (${{ env.REPOSITORY }}) to ${{ env.VERSION }}" + branch: update-version-${{ env.REPOSITORY }}-${{ env.VERSION }} + add-paths: | + gradle/libs.versions.toml + + - name: Enable Auto Merge Pull Request + uses: peter-evans/enable-pull-request-automerge@v3 + with: + token: ${{ steps.generate-token.outputs.token }} + pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }} + merge-method: squash + + - name: Auto Approve Pull Request + uses: hmarr/auto-approve-action@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }} \ No newline at end of file diff --git a/scripts/requirements.txt b/scripts/requirements.txt new file mode 100644 index 0000000..1e3db17 --- /dev/null +++ b/scripts/requirements.txt @@ -0,0 +1 @@ +tomlkit \ No newline at end of file diff --git a/scripts/upgrade-version.py b/scripts/upgrade-version.py new file mode 100644 index 0000000..aebdff4 --- /dev/null +++ b/scripts/upgrade-version.py @@ -0,0 +1,25 @@ +import sys +import tomlkit + +# key: github repository in the format org/repository +# value: version.ref for the corresponding repository in gradle/libs.versions.toml +REPOSITORY_TOML_KEYS = { + "hypertrace/java-grpc-utils": "hypertrace-grpcutils", + "hypertrace/service-framework": "hypertrace-framework", + "hypertrace/kafka-streams-framework": "hypertrace-kafka", + "hypertrace/config-service": "hypertrace-configservice", +} + +repository = sys.argv[1] +version = sys.argv[2] + +toml_file = 'gradle/libs.versions.toml' + +with open(toml_file, 'r') as f: + toml_data = tomlkit.load(f) + +toml_key = REPOSITORY_TOML_KEYS[repository] +toml_data['versions'][toml_key] = version + +with open(toml_file, 'w') as f: + tomlkit.dump(toml_data, f)