Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit fbdb52a

Browse files
chore: add temp code replacement hack due to gapic code-gen template bug (#201)
* chore: add file exclusion due to gapic code-gen template bug * update based on comments * update based on comments
1 parent 440d85b commit fbdb52a

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

synth.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import synthtool as s
1818
import synthtool.gcp as gcp
1919
import synthtool.languages.java as java
20+
import os
2021

2122
AUTOSYNTH_MULTIPLE_COMMITS = True
2223

@@ -35,3 +36,26 @@
3536
)
3637

3738
java.common_templates()
39+
40+
# TODO: Remove all below s.replace() logic when upstream correction is made in gapic https://github.com/googleapis/gapic-generator/issues/3181
41+
# Remove line added by gapic generator
42+
s.replace("google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java",
43+
"final Object response = responses.remove();",
44+
"")
45+
46+
# Add back lines removed by gapic generator
47+
s.replace("google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java",
48+
"""
49+
public void onNext(AppendRowsRequest value) {
50+
if (response instanceof AppendRowsResponse) {
51+
""",
52+
"""
53+
public void onNext(AppendRowsRequest value) {
54+
requests.add(value);
55+
final Object response = responses.remove();
56+
if (response instanceof AppendRowsResponse) {
57+
"""
58+
)
59+
60+
# Re-run java code formatter after making hacky code change
61+
os.system("mvn com.coveo:fmt-maven-plugin:format")

0 commit comments

Comments
 (0)