Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync with main #941

Merged
merged 14 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
digest: sha256:e76136cc48f90aa19ba29cdfbd4002111467e44a1c9d905867d98dafafbd03bb
digest: sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c
17 changes: 17 additions & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ branchProtectionRules:
- OwlBot Post Processor
- 'Kokoro - Test: Java GraalVM Native Image'
- 'Kokoro - Test: Java 17 GraalVM Native Image'
- pattern: multi-db
isAdminEnforced: true
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- lint
- clirr
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- cla/google
- OwlBot Post Processor
- 'Kokoro - Test: Java GraalVM Native Image'
- 'Kokoro - Test: Java 17 GraalVM Native Image'
permissionRules:
- team: yoshi-admins
permission: admin
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native-17.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17"
value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.0"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/graalvm"
value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.0"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pycparser==2.21
pyperclip==1.8.2
python-dateutil==2.8.2
requests==2.27.1
certifi==2022.9.24
certifi==2022.12.7
importlib-metadata==4.8.3
zipp==3.6.0
google_api_core==2.8.2
Expand Down
6 changes: 3 additions & 3 deletions .kokoro/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ cachetools==4.2.4 \
# via
# -r requirements.in
# google-auth
certifi==2022.9.24 \
--hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \
--hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382
certifi==2022.12.7 \
--hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \
--hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18
# via
# -r requirements.in
# requests
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [2.13.0](https://github.com/googleapis/java-datastore/compare/v2.12.5...v2.13.0) (2022-12-06)


### Features

* Next release from main branch is 2.13.0 ([#917](https://github.com/googleapis/java-datastore/issues/917)) ([1f12435](https://github.com/googleapis/java-datastore/commit/1f1243577cbdc206b6a0bfcde818411eb1b806ad))


### Bug Fixes

* [#355](https://github.com/googleapis/java-datastore/issues/355) Explicitly passing --project argument when starting emulator ([#923](https://github.com/googleapis/java-datastore/issues/923)) ([ef4065d](https://github.com/googleapis/java-datastore/commit/ef4065d233b968f58a34673aa53d39f60a013e2d))


### Dependencies

* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#932](https://github.com/googleapis/java-datastore/issues/932)) ([1dbcea7](https://github.com/googleapis/java-datastore/commit/1dbcea73827961148800c1ec8e87065dbceb6c88))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 ([#924](https://github.com/googleapis/java-datastore/issues/924)) ([625e896](https://github.com/googleapis/java-datastore/commit/625e89685172ae546a813f5f7184223d01fbb0ac))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#930](https://github.com/googleapis/java-datastore/issues/930)) ([77285be](https://github.com/googleapis/java-datastore/commit/77285be97fbd6bca1ada35202842238e306dd8dc))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#925](https://github.com/googleapis/java-datastore/issues/925)) ([0c7539d](https://github.com/googleapis/java-datastore/commit/0c7539d736ec993d7bb0531d7cd4dab1b08487a0))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#931](https://github.com/googleapis/java-datastore/issues/931)) ([40b4011](https://github.com/googleapis/java-datastore/commit/40b4011e3a826a91e33541efdecb05f0e129f87c))

## [2.12.5](https://github.com/googleapis/java-datastore/compare/v2.12.4...v2.12.5) (2022-11-08)


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.1.5</version>
<version>26.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore</artifactId>
<version>2.12.5</version>
<version>2.13.0</version>
</dependency>

```
Expand Down
4 changes: 2 additions & 2 deletions datastore-v1-proto-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud.datastore</groupId>
<artifactId>datastore-v1-proto-client</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:datastore-v1-proto-client:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:datastore-v1-proto-client:current} -->

<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore-parent</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
</parent>

<packaging>jar</packaging>
Expand Down
12 changes: 6 additions & 6 deletions google-cloud-datastore-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore-bom</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore-bom:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore-bom:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-config</artifactId>
<version>1.5.4</version>
<version>1.5.5</version>
</parent>

<name>Google Cloud datastore BOM</name>
Expand Down Expand Up @@ -52,22 +52,22 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-datastore-admin-v1</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-datastore-v1</artifactId>
<version>0.103.6-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
<version>0.104.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-datastore-admin-v1</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>google-cloud-datastore</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
<packaging>jar</packaging>
<name>Google Cloud Datastore</name>
<url>https://github.com/googleapis/java-datastore</url>
Expand All @@ -12,7 +12,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore-parent</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-datastore</site.installationModule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ public class HttpJsonDatastoreAdminStub extends DatastoreAdminStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<ExportEntitiesRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearProjectId().build(), false))
.toBody("*", request.toBuilder().clearProjectId().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<Operation>newBuilder()
Expand Down Expand Up @@ -136,12 +137,13 @@ public class HttpJsonDatastoreAdminStub extends DatastoreAdminStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<ImportEntitiesRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearProjectId().build(), false))
.toBody("*", request.toBuilder().clearProjectId().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<Operation>newBuilder()
Expand Down Expand Up @@ -175,12 +177,13 @@ public class HttpJsonDatastoreAdminStub extends DatastoreAdminStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<CreateIndexRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("index", request.getIndex(), false))
.toBody("index", request.getIndex(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<Operation>newBuilder()
Expand Down Expand Up @@ -215,6 +218,7 @@ public class HttpJsonDatastoreAdminStub extends DatastoreAdminStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<DeleteIndexRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -251,6 +255,7 @@ public class HttpJsonDatastoreAdminStub extends DatastoreAdminStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<GetIndexRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -287,6 +292,7 @@ public class HttpJsonDatastoreAdminStub extends DatastoreAdminStub {
serializer.putQueryParam(fields, "filter", request.getFilter());
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.google.cloud.datastore.testing;

import static com.google.common.base.MoreObjects.firstNonNull;

import com.google.api.core.InternalApi;
import com.google.cloud.NoCredentials;
import com.google.cloud.ServiceOptions;
Expand Down Expand Up @@ -69,7 +71,9 @@ public class LocalDatastoreHelper extends BaseEmulatorHelper<DatastoreOptions> {

// Common settings
private static final String CONSISTENCY_FLAG = "--consistency=";
private static final String PROJECT_FLAG = "--project=";
private static final double DEFAULT_CONSISTENCY = 0.9;
private static final String DEFAULT_PROJECT_ID = PROJECT_ID_PREFIX + UUID.randomUUID();

private static final Logger LOGGER = Logger.getLogger(LocalDatastoreHelper.class.getName());

Expand Down Expand Up @@ -98,6 +102,7 @@ public static class Builder {
private int port;
private Path dataDir;
private boolean storeOnDisk = true;
private String projectId;

private Builder() {}

Expand All @@ -117,6 +122,11 @@ public Builder setPort(int port) {
return this;
}

public Builder setProjectId(String projectId) {
this.projectId = projectId;
return this;
}

public Builder setDataDir(Path dataDir) {
this.dataDir = dataDir;
return this;
Expand All @@ -137,7 +147,8 @@ private LocalDatastoreHelper(Builder builder) {
super(
"datastore",
builder.port > 0 ? builder.port : BaseEmulatorHelper.findAvailablePort(DEFAULT_PORT),
PROJECT_ID_PREFIX + UUID.randomUUID().toString());
firstNonNull(builder.projectId, DEFAULT_PROJECT_ID));
String projectId = firstNonNull(builder.projectId, DEFAULT_PROJECT_ID);
this.consistency = builder.consistency > 0 ? builder.consistency : DEFAULT_CONSISTENCY;
this.gcdPath = builder.dataDir;
this.storeOnDisk = builder.storeOnDisk;
Expand All @@ -148,6 +159,7 @@ private LocalDatastoreHelper(Builder builder) {
List<String> gcloudCommand = new ArrayList<>(Arrays.asList(GCLOUD_CMD_TEXT.split(" ")));
gcloudCommand.add(GCLOUD_CMD_PORT_FLAG + "localhost:" + getPort());
gcloudCommand.add(CONSISTENCY_FLAG + builder.consistency);
gcloudCommand.add(PROJECT_FLAG + projectId);
if (!builder.storeOnDisk) {
gcloudCommand.add("--no-store-on-disk");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ public void testCreateWithBuilder() {
assertTrue(incompleteHelper.getProjectId().startsWith(PROJECT_ID_PREFIX));
}

@Test
public void testCreateWithCustomProjectId() {
String customProjectId = "custom-project-id";
LocalDatastoreHelper helper =
LocalDatastoreHelper.newBuilder().setProjectId(customProjectId).build();
assertEquals(customProjectId, helper.getProjectId());
}

@Test
public void testCreateWithToBuilder() throws IOException {
LocalDatastoreHelper helper =
Expand Down
4 changes: 2 additions & 2 deletions grpc-google-cloud-datastore-admin-v1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-datastore-admin-v1</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
<name>grpc-google-cloud-datastore-admin-v1</name>
<description>GRPC library for google-cloud-datastore</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore-parent</artifactId>
<version>2.12.6-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
<version>2.13.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
Loading