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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 17
- run: java -version
- run: .kokoro/build.sh
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- uses: googleapis/sdk-platform-java/.github/scripts@v2.55.1
- uses: googleapis/sdk-platform-java/.github/scripts@v
if: env.SHOULD_RUN == 'true'
with:
base_ref: ${{ github.base_ref }}
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-22.04
runs-on: ubuntu-24.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: '20'
node-version: '22'

- name: Install Renovate and Config Validator
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/update_generation_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
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 }}

24 changes: 12 additions & 12 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# Copyright 2019 Google LLC
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -42,21 +42,22 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS})
fi


RETURN_CODE=0
set +e

case ${JOB_TYPE} in
test)
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT}
mvn test -B -ntp -Dfmt.skip=true -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT}
RETURN_CODE=$?
;;
lint)
mvn com.coveo:fmt-maven-plugin:check -B -ntp
mvn com.spotify.fmt:fmt-maven-plugin:check -B -ntp
RETURN_CODE=$?
;;
javadoc)
mvn javadoc:javadoc javadoc:test-javadoc -B -ntp
mvn javadoc:javadoc javadoc:test-javadoc -B -ntp -Dfmt.skip=true
RETURN_CODE=$?
;;
integration)
Expand All @@ -66,18 +67,16 @@ integration)
-DtrimStackTrace=false \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dcheckstyle.skip=true \
-DskipUnitTests=true \
-Dfmt.skip=true \
-fae \
verify
RETURN_CODE=$?
;;
graalvm)
# Run Unit and Integration Tests with Native Image
mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test
RETURN_CODE=$?
;;
graalvm17)
# Run Unit and Integration Tests with Native Image
mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test
mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test -Dfmt.skip=true
RETURN_CODE=$?
;;
samples)
Expand All @@ -101,6 +100,7 @@ samples)
-DtrimStackTrace=false \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dfmt.skip=true \
-fae \
verify
RETURN_CODE=$?
Expand All @@ -110,7 +110,7 @@ samples)
fi
;;
clirr)
mvn -B -ntp -Denforcer.skip=true clirr:check
mvn -B -ntp -Dfmt.skip=true -Denforcer.skip=true clirr:check
RETURN_CODE=$?
;;
*)
Expand Down
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-native-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_a: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-native-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-native-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_c: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"
}
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
6 changes: 3 additions & 3 deletions generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gapic_generator_version: 2.55.1
googleapis_commitish: d0ba3ce0fafe1225ebda6b259a2e29dfe2934bb5
libraries_bom_version: 26.56.0
gapic_generator_version:
googleapis_commitish: 03baf05e13d9241ec8c19bdedb1d991b6ed7e115
libraries_bom_version:
libraries:
- api_shortname: pubsublite
name_pretty: Cloud Pub/Sub Lite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@AutoValue
public abstract class CloudZone implements Serializable {
private static final long serialVersionUID = 867184651465L;

/** A google cloud zone. */
public static CloudZone of(CloudRegion region, char zoneId) {
return new AutoValue_CloudZone(region, zoneId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public interface NackHandler {
default ApiFuture<Void> nack(PubsubMessage message) {
return ApiFutures.immediateFailedFuture(
new CheckedApiException(
"You may not nack messages by default when using a PubSub Lite client. See NackHandler for how to customize this.",
"You may not nack messages by default when using a PubSub Lite client. See"
+ " NackHandler for how to customize this.",
Code.UNIMPLEMENTED)
.underlying);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public interface AlarmFactory {
// Get around lack of interface support for private static members in java 8
final class Internal {
private static final GoogleLogger LOGGER = GoogleLogger.forEnclosingClass();
};
}
;

static AlarmFactory create(Duration duration) {
return runnable ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private Partition routeWithoutKey() throws ApiException {
private Partition routeWithKey(ByteString messageKey) throws ApiException {
HashCode code = Hashing.sha256().hashBytes(messageKey.asReadOnlyByteBuffer());
checkArgument(code.bits() == 256); // sanity check.
BigInteger bigEndianValue = new BigInteger(/*signum=*/ 1, code.asBytes());
BigInteger bigEndianValue = new BigInteger(/* signum= */ 1, code.asBytes());
return Partition.of(bigEndianValue.mod(BigInteger.valueOf(numPartitions)).longValueExact());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected final void addServices(ApiService... services) throws ApiException {

// Method to be called on service start after dependent services start.
protected void start() throws CheckedApiException {}

// Method to be called on service stop before dependent services stop.
protected void stop() throws CheckedApiException {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public interface RoutingPolicy {
interface Factory {
RoutingPolicy newPolicy(long numPartitions);
}

// Route a message to a partition.
Partition route(PubSubMessage messageKey) throws CheckedApiException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@AutoValue
public abstract class AssignerSettings {
private static final GoogleLogger logger = GoogleLogger.forEnclosingClass();

// Required parameters.
abstract SubscriptionPath subscriptionPath();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ private void pollTopicConfig() {
partitionCountReceiver.accept(partitionCount);
} catch (TimeoutException e) {
log.atWarning().withCause(e).log(
"Timed out polling for partition count- see https://github.com/googleapis/gax-java/issues/1577");
"Timed out polling for partition count- see"
+ " https://github.com/googleapis/gax-java/issues/1577");
throw toCanonical(e).underlying;
} catch (Throwable t) {
throw toCanonical(t).underlying;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ private void handleConfig(long partitionCount) {
}
if (partitionCount < currentSize) {
log.atWarning().log(
"Received an unexpected decrease in partition count. Previous partition count %s, new count %s",
"Received an unexpected decrease in partition count. Previous partition count %s, new"
+ " count %s",
currentSize, partitionCount);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ private SubscribeRequest getInitialRequest() {
try (CloseableMonitor.Hold h = monitor.enter()) {
return SubscribeRequest.newBuilder()
.setInitial(
baseInitialRequest
.toBuilder()
baseInitialRequest.toBuilder()
.setInitialLocation(
nextOffsetTracker.requestForRestart().orElse(initialLocation)))
.build();
Expand Down
Loading
Loading