Skip to content

Commit

Permalink
chore: fix clirr errors for the google-cloud-bigtable-stats module (#…
Browse files Browse the repository at this point in the history
…2131)

* Fix clirr errors.

* Change clirr exception to method removal instead of method return type change.

* Fix inner class ignore syntax for clirr.

* Fix missing field with clirr.

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
rkaregar and gcf-owl-bot[bot] committed Feb 22, 2024
1 parent 5ca622d commit 7871527
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.32.0')
implementation platform('com.google.cloud:libraries-bom:26.33.0')
implementation 'com.google.cloud:google-cloud-bigtable'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigtable:2.33.0'
implementation 'com.google.cloud:google-cloud-bigtable:2.34.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.33.0"
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.34.0"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -609,7 +609,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.33.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.34.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
13 changes: 13 additions & 0 deletions google-cloud-bigtable-stats/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,17 @@
<className>com/google/cloud/bigtable/stats/StatsRecorderWrapper</className>
<method>void putBatchRequestThrottled(long)</method>
</difference>
<!-- Internal API is updated -->
<difference>
<differenceType>7005</differenceType>
<className>com/google/cloud/bigtable/stats/StatsRecorderWrapperForConnection</className>
<method>*StatsRecorderWrapperForConnection*</method>
<to>*</to>
</difference>
<!-- Internal API is updated -->
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/bigtable/stats/ConsumerEnvironmentUtils$ResourceUtilsWrapper</className>
<method>*detectResource*</method>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public static void setResourceUtilsWrapper(ResourceUtilsWrapper newResourceUtils
}

public static boolean isEnvGce() {
Resource resource = resourceUtilsWrapper.detectResource();
Resource resource = resourceUtilsWrapper.detectOpenCensusResource();
return Objects.equals(resource.getType(), HostResource.TYPE)
&& Objects.equals(
resource.getLabels().get(CloudResource.PROVIDER_KEY), CloudResource.PROVIDER_GCP);
}

public static boolean isEnvGke() {
Resource resource = resourceUtilsWrapper.detectResource();
Resource resource = resourceUtilsWrapper.detectOpenCensusResource();
return Objects.equals(resource.getType(), ContainerResource.TYPE)
&& Objects.equals(
resource.getLabels().get(CloudResource.PROVIDER_KEY), CloudResource.PROVIDER_GCP);
Expand All @@ -50,7 +50,7 @@ public static boolean isEnvGke() {
// We wrap the static ResourceUtils.detectResource() method in a non-static method for mocking.
@VisibleForTesting
public static class ResourceUtilsWrapper {
public Resource detectResource() {
public Resource detectOpenCensusResource() {
return ResourceUtils.detectResource();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void testTimeSeriesForMetricWithGceResource() {
ConsumerEnvironmentUtils.ResourceUtilsWrapper resourceUtilsWrapperMock =
Mockito.mock(ConsumerEnvironmentUtils.ResourceUtilsWrapper.class);
ConsumerEnvironmentUtils.setResourceUtilsWrapper(resourceUtilsWrapperMock);
Mockito.when(resourceUtilsWrapperMock.detectResource())
Mockito.when(resourceUtilsWrapperMock.detectOpenCensusResource())
.thenReturn(
Resource.create(
HostResource.TYPE,
Expand Down Expand Up @@ -239,7 +239,7 @@ public void testTimeSeriesForMetricWithGkeResource() {
Mockito.mock(ConsumerEnvironmentUtils.ResourceUtilsWrapper.class);
ConsumerEnvironmentUtils.setResourceUtilsWrapper(resourceUtilsWrapperMock);

Mockito.when(resourceUtilsWrapperMock.detectResource())
Mockito.when(resourceUtilsWrapperMock.detectOpenCensusResource())
.thenReturn(
Resource.create(
ContainerResource.TYPE,
Expand Down

0 comments on commit 7871527

Please sign in to comment.