Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit d6c3770

Browse files
MarkDuckworthwu-huicloud-java-bot
authored
fix: Fix sending of Pipeline options when running a Pipeline in a transaction (#2348)
* fix execute options for ServerSideTransaction.java * fix: Fix sending of Pipeline options when running a Pipeline in a transaction * test: Fix invalid foo option in ITPipelineTest * chore: generate libraries at Mon Apr 20 20:23:08 UTC 2026 --------- Co-authored-by: wu-hui <53845758+wu-hui@users.noreply.github.com> Co-authored-by: wu-hui <wu.hui.github@gmail.com> Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
1 parent be110ee commit d6c3770

3 files changed

Lines changed: 18 additions & 9 deletions

File tree

.github/scripts/update_generation_config.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ function update_config() {
4848
}
4949

5050
# Update an action to a new version in GitHub action.
51+
# the second argument must have the git tag (including "v").
5152
function update_action() {
5253
local key_word=$1
5354
local new_value=$2
5455
local file=$3
5556
echo "Update ${key_word} to ${new_value} in ${file}"
5657
# use a different delimiter because the key_word contains "/".
57-
sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}"
58+
sed -i -e "s|${key_word}@[^ ]*$|${key_word}@${new_value}|" "${file}"
5859
}
5960

6061
# The parameters of this script is:
@@ -143,12 +144,16 @@ rm -rf tmp-googleapis
143144
update_config "googleapis_commitish" "${latest_commit}" "${generation_config}"
144145

145146
# Update gapic-generator-java version to the latest
146-
latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
147-
update_config "gapic_generator_version" "${latest_version}" "${generation_config}"
148-
149-
# Update composite action version to latest gapic-generator-java version
150-
update_action "googleapis/sdk-platform-java/.github/scripts" \
151-
"${latest_version}" \
147+
latest_gapic_generator_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
148+
update_config "gapic_generator_version" "${latest_gapic_generator_version}" "${generation_config}"
149+
150+
# Update the GitHub Actions reference to the latest.
151+
# After the google-cloud-java monorepo migration of sdk-platform-java,
152+
# we cannot rely on the gapic-generator-java version tag. Let's use
153+
# the shared dependencies BOM version
154+
latest_shared_dependencies_bom_version=$(get_latest_released_version "com.google.cloud" "google-cloud-shared-dependencies")
155+
update_action "googleapis/google-cloud-java/sdk-platform-java/.github/scripts" \
156+
"google-cloud-shared-dependencies/v${latest_shared_dependencies_bom_version}" \
152157
"${workflow}"
153158

154159
# Update libraries-bom version to the latest

google-cloud-firestore/src/main/java/com/google/cloud/firestore/ServerSideTransaction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public ApiFuture<Pipeline.Snapshot> execute(
281281
@Nonnull Pipeline pipeline, @Nonnull PipelineExecuteOptions options) {
282282
Preconditions.checkState(isEmpty(), READ_BEFORE_WRITE_ERROR_MSG);
283283
try (TraceUtil.Scope ignored = transactionTraceContext.makeCurrent()) {
284-
return pipeline.execute(new PipelineExecuteOptions(), transactionId, null);
284+
return pipeline.execute(options, transactionId, null);
285285
}
286286
}
287287
}

google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3883,7 +3883,11 @@ public void testPipelineInTransactionsWithOptions() throws Exception {
38833883
firestore
38843884
.runTransaction(
38853885
transaction -> {
3886-
PipelineExecuteOptions options = new PipelineExecuteOptions().with("foo", "bar");
3886+
PipelineExecuteOptions options =
3887+
new PipelineExecuteOptions()
3888+
.withExplainOptions(
3889+
new ExplainOptions()
3890+
.withExecutionMode(ExplainOptions.ExecutionMode.ANALYZE));
38873891
List<PipelineResult> results =
38883892
transaction.execute(pipeline, options).get().getResults();
38893893
assertThat(results).hasSize(1);

0 commit comments

Comments
 (0)