Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into bake-protoc-hermetic-…
Browse files Browse the repository at this point in the history
…build
  • Loading branch information
diegomarquezp committed May 22, 2024
2 parents 868a1bf + 38b90e2 commit 5d9beb5
Show file tree
Hide file tree
Showing 405 changed files with 5,781 additions and 5,851 deletions.
2 changes: 1 addition & 1 deletion .cloudbuild/graalvm/cloudbuild-test-a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_SHARED_DEPENDENCIES_VERSION: '3.30.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.7'
options:
machineType: 'E2_HIGHCPU_8'
Expand Down
2 changes: 1 addition & 1 deletion .cloudbuild/graalvm/cloudbuild-test-b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_SHARED_DEPENDENCIES_VERSION: '3.30.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.7'
options:
machineType: 'E2_HIGHCPU_8'
Expand Down
2 changes: 1 addition & 1 deletion .cloudbuild/graalvm/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_SHARED_DEPENDENCIES_VERSION: '3.30.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.7'
steps:
# GraalVM A build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

timeout: 7200s # 2 hours
substitutions:
_GAPIC_GENERATOR_JAVA_VERSION: '2.40.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current}
_GAPIC_GENERATOR_JAVA_VERSION: '2.40.2-SNAPSHOT' # {x-version-update:gapic-generator-java:current}
_IMAGE_ID: "gcr.io/cloud-devrel-public-resources/java-library-generation:${_GAPIC_GENERATOR_JAVA_VERSION}"
steps:
# Library generation build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM gcr.io/cloud-devrel-public-resources/python

SHELL [ "/bin/bash", "-c" ]

ARG SYNTHTOOL_COMMITTISH=63cc541da2c45fcfca2136c43e638da1fbae174d
ARG SYNTHTOOL_COMMITTISH=a2c9b4a5da2d7f583c8a1869fd2843c206145834
ARG OWLBOT_CLI_COMMITTISH=ac84fa5c423a0069bbce3d2d869c9730c8fdf550
ARG PROTOC_VERSION=25.3
ENV HOME=/home
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ jobs:
run: |
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
- name: Validate gapic-generator-java-bom
uses: googleapis/java-cloud-bom/tests/validate-bom@f3c611a09b556e81029d5588afe22ca6a15b0cef
uses: googleapis/java-cloud-bom/tests/validate-bom@db4265ffa7e23c64ae37d9804394569e4577b3e2
with:
bom-path: gapic-generator-java-bom/pom.xml

Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.40.0"
".": "2.40.1"
}
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## [2.40.1](https://github.com/googleapis/sdk-platform-java/compare/v2.40.0...v2.40.1) (2024-05-15)


### Bug Fixes

* [common-protos] An existing method `UpdateVehicleLocation` is ([7f96074](https://github.com/googleapis/sdk-platform-java/commit/7f96074859cd22289fe3ba464e8878d8b228e51c))
* [common-protos] An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([#2751](https://github.com/googleapis/sdk-platform-java/issues/2751)) ([7f96074](https://github.com/googleapis/sdk-platform-java/commit/7f96074859cd22289fe3ba464e8878d8b228e51c))
* [iam] An existing method `UpdateVehicleLocation` is removed from ([4a1ae7b](https://github.com/googleapis/sdk-platform-java/commit/4a1ae7b0b87a3dcc10834d7d2a1f0cd1975f0736))
* [iam] An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([#2752](https://github.com/googleapis/sdk-platform-java/issues/2752)) ([4a1ae7b](https://github.com/googleapis/sdk-platform-java/commit/4a1ae7b0b87a3dcc10834d7d2a1f0cd1975f0736))
* do not populate repo level change while removing library ([#2740](https://github.com/googleapis/sdk-platform-java/issues/2740)) ([43e62b9](https://github.com/googleapis/sdk-platform-java/commit/43e62b998958abd4ca96b83800380c9696ff693f))
* only append `.api.grpc` suffix to group id if the artifact id starts with `proto-` or `grpc-` ([#2731](https://github.com/googleapis/sdk-platform-java/issues/2731)) ([8e87b2e](https://github.com/googleapis/sdk-platform-java/commit/8e87b2e9a28a1797efb2eea531d25094b4438e0d))
* opentelemetry-bom to be in third-party-dependencies BOM ([#2736](https://github.com/googleapis/sdk-platform-java/issues/2736)) ([4ecc89b](https://github.com/googleapis/sdk-platform-java/commit/4ecc89bfff1a83e501b2fdc5a04bba47d83a7c00))
* prepare to generate grafeas ([#2761](https://github.com/googleapis/sdk-platform-java/issues/2761)) ([1114f18](https://github.com/googleapis/sdk-platform-java/commit/1114f1863bf5ae15ee56631fd824a2269e91746d))
* Replace deprecated protobuf methods. ([#2764](https://github.com/googleapis/sdk-platform-java/issues/2764)) ([986c090](https://github.com/googleapis/sdk-platform-java/commit/986c090a043f06ef98c9787cedf3c89cf7365017))


### Dependencies

* update dependency black to v24.4.2 ([#2660](https://github.com/googleapis/sdk-platform-java/issues/2660)) ([1cbb681](https://github.com/googleapis/sdk-platform-java/commit/1cbb681f3f395afee4be63cd6b96fefda7083d97))
* update dependency com.fasterxml.jackson:jackson-bom to v2.17.1 ([#2732](https://github.com/googleapis/sdk-platform-java/issues/2732)) ([891b01d](https://github.com/googleapis/sdk-platform-java/commit/891b01d0d35384df3269cdd8b37102b2587c9188))
* update dependency com.google.cloud:grpc-gcp to v1.6.0 ([#2767](https://github.com/googleapis/sdk-platform-java/issues/2767)) ([a39aa07](https://github.com/googleapis/sdk-platform-java/commit/a39aa07d013c9c097ad93fd68cf97da1c7d9ff03))
* update dependency com.google.errorprone:error_prone_annotations to v2.27.1 ([#2708](https://github.com/googleapis/sdk-platform-java/issues/2708)) ([4d7d246](https://github.com/googleapis/sdk-platform-java/commit/4d7d246e821797155792c5f1ad0c1704ec2766d4))
* update dependency com.google.errorprone:error_prone_annotations to v2.27.1 ([#2709](https://github.com/googleapis/sdk-platform-java/issues/2709)) ([4e31d7d](https://github.com/googleapis/sdk-platform-java/commit/4e31d7dd917c76229c3cfe18b0f98d561c9f7d3b))
* update dependency com.google.oauth-client:google-oauth-client-bom to v1.36.0 ([#2768](https://github.com/googleapis/sdk-platform-java/issues/2768)) ([22b7398](https://github.com/googleapis/sdk-platform-java/commit/22b7398f07a77935c0c002c78e8e30dca5979652))
* update dependency commons-codec:commons-codec to v1.17.0 ([#2710](https://github.com/googleapis/sdk-platform-java/issues/2710)) ([b87356c](https://github.com/googleapis/sdk-platform-java/commit/b87356c1d80559fd5ca85ee0edfa3e5f24db6b17))
* update dependency jinja2 to v3.1.4 [security] ([#2742](https://github.com/googleapis/sdk-platform-java/issues/2742)) ([d67eaf8](https://github.com/googleapis/sdk-platform-java/commit/d67eaf85c409dc7cf653dfb6d753d39a77292135))
* update dependency lxml to v5.2.2 ([#2766](https://github.com/googleapis/sdk-platform-java/issues/2766)) ([df7e211](https://github.com/googleapis/sdk-platform-java/commit/df7e211e534516f9596e230598b70fdbfdea1ac3))
* update dependency markupsafe to v2.1.5 ([#2657](https://github.com/googleapis/sdk-platform-java/issues/2657)) ([805baf8](https://github.com/googleapis/sdk-platform-java/commit/805baf87cfd70bb74b345cff93a6a6e02ade3dd7))
* update dependency net.bytebuddy:byte-buddy to v1.14.15 ([#2753](https://github.com/googleapis/sdk-platform-java/issues/2753)) ([a472620](https://github.com/googleapis/sdk-platform-java/commit/a4726206146a503822f685caa1e4d04273b738dc))
* update dependency platformdirs to v4.2.1 ([#2662](https://github.com/googleapis/sdk-platform-java/issues/2662)) ([dbdcc91](https://github.com/googleapis/sdk-platform-java/commit/dbdcc91e91ca19eca7c098b6131e3faa90f3386e))
* update googleapis/java-cloud-bom digest to db4265f ([#2755](https://github.com/googleapis/sdk-platform-java/issues/2755)) ([908db6f](https://github.com/googleapis/sdk-platform-java/commit/908db6f453b1915e2fd4097d5cf639f054829c39))
* update googleapis/java-cloud-bom digest to f3c611a ([#2700](https://github.com/googleapis/sdk-platform-java/issues/2700)) ([d254e9b](https://github.com/googleapis/sdk-platform-java/commit/d254e9bd67ec12802158d48f3c06dc618e0df903))
* update opentelemetry-java monorepo to v1.38.0 ([#2769](https://github.com/googleapis/sdk-platform-java/issues/2769)) ([0a5c7c4](https://github.com/googleapis/sdk-platform-java/commit/0a5c7c4075ee986028535c424e4a62458a25f8d2))

## [2.40.0](https://github.com/googleapis/sdk-platform-java/compare/v2.39.0...v2.40.0) (2024-05-02)


Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ maven_install(
repositories = ["https://repo.maven.apache.org/maven2/"],
)

_gapic_generator_java_version = "2.40.1-SNAPSHOT" # {x-version-update:gapic-generator-java:current}
_gapic_generator_java_version = "2.40.2-SNAPSHOT" # {x-version-update:gapic-generator-java:current}

maven_install(
artifacts = [
Expand Down
22 changes: 17 additions & 5 deletions api-common-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<groupId>com.google.api</groupId>
<artifactId>api-common</artifactId>
<packaging>jar</packaging>
<version>2.31.1-SNAPSHOT</version><!-- {x-version-update:api-common:current} -->
<version>2.31.2-SNAPSHOT</version><!-- {x-version-update:api-common:current} -->
<name>API Common</name>
<description>Common utilities for Google APIs in Java</description>

<parent>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-pom-parent</artifactId>
<version>2.40.1-SNAPSHOT</version><!-- {x-version-update:gapic-generator-java:current} -->
<version>2.40.2-SNAPSHOT</version><!-- {x-version-update:gapic-generator-java:current} -->
<relativePath>../gapic-generator-java-pom-parent</relativePath>
</parent>

Expand Down Expand Up @@ -69,9 +69,21 @@

<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class ApiFuturesTest {
class ApiFuturesTest {

@Test
public void testAddCallback() throws Exception {
void testAddCallback() {
final AtomicInteger flag = new AtomicInteger();
SettableApiFuture<Integer> future = SettableApiFuture.<Integer>create();
ApiFutures.addCallback(
Expand All @@ -65,7 +65,7 @@ public void onFailure(Throwable t) {
}

@Test
public void testCatch() throws Exception {
void testCatch() throws Exception {
SettableApiFuture<Integer> future = SettableApiFuture.<Integer>create();
ApiFuture<Integer> fallback =
ApiFutures.catching(
Expand All @@ -83,7 +83,7 @@ public Integer apply(Exception ex) {
}

@Test
public void testCatchAsync() throws Exception {
void testCatchAsync() throws Exception {
SettableApiFuture<Integer> future = SettableApiFuture.<Integer>create();
ApiFuture<Integer> fallback =
ApiFutures.catchingAsync(
Expand All @@ -101,7 +101,7 @@ public ApiFuture<Integer> apply(Exception ex) {
}

@Test
public void testTransform() throws Exception {
void testTransform() throws Exception {
SettableApiFuture<Integer> inputFuture = SettableApiFuture.<Integer>create();
ApiFuture<String> transformedFuture =
ApiFutures.transform(
Expand All @@ -118,7 +118,7 @@ public String apply(Integer input) {
}

@Test
public void testTransformWithExecutor() throws Exception {
void testTransformWithExecutor() throws Exception {
SettableApiFuture<Integer> inputFuture = SettableApiFuture.<Integer>create();
final AtomicInteger counter = new AtomicInteger(0);
ApiFuture<String> transformedFuture =
Expand All @@ -143,7 +143,7 @@ public void execute(Runnable command) {
}

@Test
public void testAllAsList() throws Exception {
void testAllAsList() throws Exception {
SettableApiFuture<Integer> inputFuture1 = SettableApiFuture.<Integer>create();
SettableApiFuture<Integer> inputFuture2 = SettableApiFuture.<Integer>create();
ApiFuture<List<Integer>> listFuture =
Expand All @@ -154,7 +154,7 @@ public void testAllAsList() throws Exception {
}

@Test
public void successfulAllAsList() throws Exception {
void successfulAllAsList() throws Exception {
SettableApiFuture<Integer> inputFuture1 = SettableApiFuture.<Integer>create();
SettableApiFuture<Integer> inputFuture2 = SettableApiFuture.<Integer>create();
ApiFuture<List<Integer>> listFuture =
Expand All @@ -165,7 +165,7 @@ public void successfulAllAsList() throws Exception {
}

@Test
public void testTransformAsync() throws Exception {
void testTransformAsync() throws Exception {
ApiFuture<Integer> inputFuture = ApiFutures.immediateFuture(0);
ApiFuture<Integer> outputFuture =
ApiFutures.transformAsync(
Expand All @@ -181,31 +181,24 @@ public ApiFuture<Integer> apply(Integer input) {
}

@Test
public void testTransformAsyncWithExecutor() throws Exception {
void testTransformAsyncWithExecutor() throws Exception {
ApiFuture<Integer> inputFuture = ApiFutures.immediateFuture(0);
final AtomicInteger counter = new AtomicInteger(0);
ApiFuture<Integer> outputFuture =
ApiFutures.transformAsync(
inputFuture,
new ApiAsyncFunction<Integer, Integer>() {
@Override
public ApiFuture<Integer> apply(Integer input) {
return ApiFutures.immediateFuture(input + 1);
}
},
new Executor() {
@Override
public void execute(Runnable command) {
counter.incrementAndGet();
command.run();
}
});
(ApiAsyncFunction<Integer, Integer>) input -> ApiFutures.immediateFuture(input + 1),
(Executor)
command -> {
counter.incrementAndGet();
command.run();
});
assertThat(outputFuture.get()).isEqualTo(1);
assertThat(counter.get()).isEqualTo(1);
}

@Test
public void testImmediateFailedFuture() throws InterruptedException {
void testImmediateFailedFuture() throws InterruptedException {
ApiFuture<String> future =
ApiFutures.immediateFailedFuture(new IllegalArgumentException("The message"));
IllegalArgumentException exception = null;
Expand All @@ -219,7 +212,7 @@ public void testImmediateFailedFuture() throws InterruptedException {
}

@Test
public void testImmediateCancelledFuture() throws InterruptedException, ExecutionException {
void testImmediateCancelledFuture() throws InterruptedException, ExecutionException {
ApiFuture<String> future = ApiFutures.immediateCancelledFuture();
CancellationException exception = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

import com.google.common.util.concurrent.MoreExecutors;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class ApiServiceTest {
class ApiServiceTest {
@Test
public void testNoopService() {
void testNoopService() {
ApiService service =
new AbstractApiService() {
@Override
Expand All @@ -50,12 +50,12 @@ protected void doStart() {
}
};
service.startAsync().awaitRunning();
Assert.assertTrue(service.isRunning());
Assertions.assertTrue(service.isRunning());
service.stopAsync().awaitTerminated();
}

@Test
public void testFailingService() {
void testFailingService() {
final AtomicReference<Throwable> savedFailure = new AtomicReference<>();
ApiService service =
new AbstractApiService() {
Expand Down Expand Up @@ -86,8 +86,8 @@ public void failed(ApiService.State from, Throwable failure) {
// Expected
}

Assert.assertEquals(service.state(), ApiService.State.FAILED);
Assert.assertEquals(savedFailure.get().getMessage(), "this service always fails");
Assert.assertEquals(service.failureCause().getMessage(), "this service always fails");
Assertions.assertEquals(service.state(), ApiService.State.FAILED);
Assertions.assertEquals(savedFailure.get().getMessage(), "this service always fails");
Assertions.assertEquals(service.failureCause().getMessage(), "this service always fails");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

import com.google.common.truth.Truth;
import com.google.common.util.concurrent.SettableFuture;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class ListenableFutureToApiFutureTest {
class ListenableFutureToApiFutureTest {

@Test
public void testGet() throws Exception {
void testGet() throws Exception {
SettableFuture<Integer> future = SettableFuture.create();
ListenableFutureToApiFuture<Integer> apiFuture = new ListenableFutureToApiFuture<>(future);
future.set(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class SettableApiFutureTest {
class SettableApiFutureTest {
@Test
public void testSet() throws Exception {
void testSet() throws Exception {
SettableApiFuture<Integer> future = SettableApiFuture.<Integer>create();
Truth.assertThat(future.isDone()).isFalse();
future.set(42);
Expand All @@ -48,7 +49,7 @@ public void testSet() throws Exception {
}

@Test
public void testCancel() throws Exception {
void testCancel() {
SettableApiFuture<Integer> future = SettableApiFuture.<Integer>create();
Truth.assertThat(future.isDone()).isFalse();
Truth.assertThat(future.isCancelled()).isFalse();
Expand All @@ -57,15 +58,19 @@ public void testCancel() throws Exception {
Truth.assertThat(future.isCancelled()).isTrue();
}

@Test(expected = ExecutionException.class)
public void testException() throws Exception {
SettableApiFuture<Integer> future = SettableApiFuture.<Integer>create();
future.setException(new Exception());
future.get();
@Test
void testException() {
Assertions.assertThrows(
ExecutionException.class,
() -> {
SettableApiFuture<Integer> future = SettableApiFuture.<Integer>create();
future.setException(new Exception());
future.get();
});
}

@Test
public void testListener() throws Exception {
void testListener() {
final AtomicInteger flag = new AtomicInteger();
SettableApiFuture<Integer> future = SettableApiFuture.<Integer>create();
future.addListener(
Expand Down
Loading

0 comments on commit 5d9beb5

Please sign in to comment.