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: improve embedded version handling #715

Merged
merged 9 commits into from Apr 13, 2021
4 changes: 3 additions & 1 deletion .github/release-please.yml
@@ -1,2 +1,4 @@
releaseType: java-yoshi
bumpMinorPreMajor: true
bumpMinorPreMajor: true
extraFiles:
- google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/ClientVersion.java
10 changes: 0 additions & 10 deletions google-cloud-bigtable/pom.xml
Expand Up @@ -427,16 +427,6 @@
</profiles>

<build>
<resources>
<resource>
<directory>src/main/templates</directory>
<includes>
<include>**/*.java</include>
</includes>
<filtering>true</filtering>
<targetPath>${project.build.directory}/generated-sources/java</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Google LLC
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

@InternalApi("For internal use only")
public final class Version {
// The released version, populated by maven.
public static String VERSION = "${java-bigtable.version}";
// {x-version-update-start:google-cloud-bigtable:current}
public static String VERSION = "1.22.1-SNAPSHOT";
// {x-version-update-end}
}
Expand Up @@ -21,7 +21,6 @@
import com.google.api.gax.batching.BatcherImpl;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcRawCallableFactory;
Expand Down Expand Up @@ -54,6 +53,7 @@
import com.google.bigtable.v2.ReadRowsResponse;
import com.google.bigtable.v2.SampleRowKeysRequest;
import com.google.bigtable.v2.SampleRowKeysResponse;
import com.google.cloud.bigtable.Version;
import com.google.cloud.bigtable.data.v2.internal.RequestContext;
import com.google.cloud.bigtable.data.v2.models.BulkMutation;
import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
Expand Down Expand Up @@ -194,9 +194,7 @@ public static EnhancedBigtableStubSettings finalizeSettings(
// Also annotate traces with library versions
.put("gax", GaxGrpcProperties.getGaxGrpcVersion())
.put("grpc", GaxGrpcProperties.getGrpcVersion())
.put(
"gapic",
GaxProperties.getLibraryVersion(EnhancedBigtableStubSettings.class))
.put("gapic", Version.VERSION)
.build()),
// Add OpenCensus Metrics
MetricsTracerFactory.create(tagger, stats, attributes),
Expand Down
2 changes: 2 additions & 0 deletions synth.py
Expand Up @@ -41,6 +41,8 @@ def main():
# todo remove once template is updated
'.github/ISSUE_TEMPLATE/bug_report.md',
'CONTRIBUTING.md',
# needed for extraFiles
'.github/release-please.yml',
])

def generate_data_api(gapic):
Expand Down