Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/generated-files-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ externalManifests:
file: '.github/readme/synth.metadata/synth.metadata'
jsonpath: '$.generatedFiles[*]'
ignoreAuthors:
- 'cloud-java-bot'
- 'renovate-bot'
- 'yoshi-automation'
- 'release-please[bot]'
Expand Down
11 changes: 9 additions & 2 deletions .github/scripts/update_generation_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ set -e
function get_latest_released_version() {
local group_id=$1
local artifact_id=$2
latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1)
echo "${latest}"
json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
if [[ -z "${latest}" ]]; then
echo "The latest version of ${group_id}:${artifact_id} is empty."
echo "The returned json from maven.org is invalid: ${json_content}"
exit 1
else
echo "${latest}"
fi
}

# Update a key to a new value in the generation config.
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [8, 11, 17, 21]
java: [11, 17, 21]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -36,7 +36,28 @@ jobs:
- run: .kokoro/build.sh
env:
JOB_TYPE: test
JAVA_VERSION: ${{matrix.java}}
units-java8:
# Building using Java 17 and run the tests with Java 8 runtime
name: "units (8)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: temurin
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- run: .kokoro/build.sh
env:
JOB_TYPE: test
windows:
runs-on: windows-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/renovate_config_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
renovate_bot_config_validation:
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04

steps:
- name: Checkout code
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '20'

- name: Install Renovate and Config Validator
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/samples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 8
- name: Run checkstyle
run: mvn -P lint --quiet --batch-mode checkstyle:check
working-directory: samples/snippets
6 changes: 4 additions & 2 deletions .github/workflows/update_generation_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ on:

jobs:
update-generation-config:
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
env:
# the branch into which the pull request is merged
base_branch: main
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- name: Update params in generation config to latest
shell: bash
Expand All @@ -36,7 +37,8 @@ jobs:
[ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com"
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
bash .github/scripts/update_generation_config.sh \
--base_branch "${base_branch}"\
--base_branch "${base_branch}" \
--repo ${{ github.repository }}
env:
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}

5 changes: 0 additions & 5 deletions .kokoro/nightly/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,3 @@ env_vars: {
key: "JOB_TYPE"
value: "test"
}

env_vars: {
key: "GITHUB_ENV_VAR_KOKORO_JOB_TYPE"
value: "nightly"
}
5 changes: 0 additions & 5 deletions .kokoro/presubmit/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ env_vars: {
value: "test"
}

env_vars: {
key: "GITHUB_ENV_VAR_KOKORO_JOB_TYPE"
value: "presubmit"
}

before_action {
fetch_keystore {
keystore_resource {
Expand Down
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-a.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "it-service-account@gcloud-devel.iam.gserviceaccount.com"
}
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-b.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "it-service-account@gcloud-devel.iam.gserviceaccount.com"
}
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-c.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "it-service-account@gcloud-devel.iam.gserviceaccount.com"
}
Empty file modified .kokoro/trampoline.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Code in this repo is formatted with
[google-java-format](https://github.com/google/google-java-format).
To run formatting on your project, you can run:
```
mvn com.coveo:fmt-maven-plugin:format
mvn com.spotify.fmt:fmt-maven-plugin:format
```

[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account
Expand Down
2 changes: 1 addition & 1 deletion generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gapic_generator_version: 2.55.1
gapic_generator_version: 2.55.2-SNAPSHOT
googleapis_commitish: 53ca65d540dd1a7cb4746687daa87208dc9ea437
libraries_bom_version: 26.57.0
libraries:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ public void createBackupSchedule(
responseObserver.onError(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CreateBackupSchedule, expected %s or %s",
"Unrecognized response type %s for method CreateBackupSchedule, expected %s or"
+ " %s",
response == null ? "null" : response.getClass().getName(),
BackupSchedule.class.getName(),
Exception.class.getName())));
Expand Down Expand Up @@ -563,7 +564,8 @@ public void updateBackupSchedule(
responseObserver.onError(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method UpdateBackupSchedule, expected %s or %s",
"Unrecognized response type %s for method UpdateBackupSchedule, expected %s or"
+ " %s",
response == null ? "null" : response.getClass().getName(),
BackupSchedule.class.getName(),
Exception.class.getName())));
Expand All @@ -584,7 +586,8 @@ public void deleteBackupSchedule(
responseObserver.onError(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeleteBackupSchedule, expected %s or %s",
"Unrecognized response type %s for method DeleteBackupSchedule, expected %s or"
+ " %s",
response == null ? "null" : response.getClass().getName(),
Empty.class.getName(),
Exception.class.getName())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,37 @@ public BulkWriterException(
this.failedAttempts = failedAttempts;
}

/** @return The status code of the error. */
/**
* @return The status code of the error.
*/
public Status getStatus() {
return status;
}

/** @return The error message of the error. */
/**
* @return The error message of the error.
*/
public String getMessage() {
return message;
}

/** @return The DocumentReference the operation was performed on. */
/**
* @return The DocumentReference the operation was performed on.
*/
public DocumentReference getDocumentReference() {
return documentReference;
}

/** @return The type of operation performed. */
/**
* @return The type of operation performed.
*/
public OperationType getOperationType() {
return operationType;
}

/** @return How many times this operation has been attempted unsuccessfully. */
/**
* @return How many times this operation has been attempted unsuccessfully.
*/
public int getFailedAttempts() {
return failedAttempts;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ public BulkWriterOptions build() {

if (!options.getThrottlingEnabled() && (maxRate != null || initialRate != null)) {
throw FirestoreException.forInvalidArgument(
"Cannot set 'initialOpsPerSecond' or 'maxOpsPerSecond' when 'throttlingEnabled' is set to false.");
"Cannot set 'initialOpsPerSecond' or 'maxOpsPerSecond' when 'throttlingEnabled' is set"
+ " to false.");
}
return options;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ private Builder add(DocumentSnapshot documentSnapshot, Optional<String> queryNam
documents
.get(documentName)
.setMetadata(
documents
.get(documentName)
.getMetadata()
.toBuilder()
documents.get(documentName).getMetadata().toBuilder()
.clearQueries()
.addAllQueries(queries)
.build());
Expand Down
Loading
Loading