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

fix: generator setting incorrect name/class for sample due to region tag (2nd attempt) #3293

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

jinseopkim0
Copy link
Contributor

Fixes #1272

Tested by following instructions https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/DEVELOPMENT.md#running-the-plugin-under-googleapis-with-local-gapic-generator-java

Ran

bazelisk build //google/cloud/tpu/v2:google-cloud-tpu-v2-java

Generated samples, included new google-cloud-tpu-v2-java/samples/snippets/generated/com/google/cloud/tpu/v2/tpu/create/SyncCreateUseHttpJsonTransport.java

/*
 * Copyright 2024 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
 *
 *      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,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.tpu.v2.samples;

// [START tpu_v2_generated_Tpu_Create_UseHttpJsonTransport_sync]
import com.google.cloud.tpu.v2.TpuClient;
import com.google.cloud.tpu.v2.TpuSettings;

public class SyncCreateUseHttpJsonTransport {

  public static void main(String[] args) throws Exception {
    syncCreateUseHttpJsonTransport();
  }

  public static void syncCreateUseHttpJsonTransport() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    TpuSettings tpuSettings = TpuSettings.newHttpJsonBuilder().build();
    TpuClient tpuClient = TpuClient.create(tpuSettings);
  }
}
// [END tpu_v2_generated_Tpu_Create_UseHttpJsonTransport_sync]

@product-auto-label product-auto-label bot added size: m Pull request size is medium. samples Issues that are directly related to samples. labels Oct 11, 2024
Copy link

sonarcloud bot commented Oct 11, 2024

Copy link

sonarcloud bot commented Oct 11, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@jinseopkim0 jinseopkim0 marked this pull request as ready for review October 11, 2024 23:43
Copy link

snippet-bot bot commented Oct 11, 2024

Here is the summary of changes.

You are about to add 5 region tags.
You are about to delete 5 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

Copy link
Collaborator

@blakeli0 blakeli0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jinseopkim0! LGTM.

@jinseopkim0 jinseopkim0 merged commit 771bd0e into main Oct 16, 2024
34 of 35 checks passed
@jinseopkim0 jinseopkim0 deleted the fix-wrong-region-tag-2 branch October 16, 2024 14:49
mpeddada1 pushed a commit that referenced this pull request Oct 22, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>2.48.0</summary>

##
[2.48.0](v2.47.0...v2.48.0)
(2024-10-22)


### Features

* **gax:** add protobuf version tracking to headers
([#3199](#3199))
([40c19b1](40c19b1))
* selectively generate libraries
([#3290](#3290))
([dfe1a50](dfe1a50))


### Bug Fixes

* generator setting incorrect name/class for sample due to region tag
(2nd attempt)
([#3293](#3293))
([771bd0e](771bd0e))


### Dependencies

* update dependency com.google.errorprone:error_prone_annotations to
v2.34.0
([#3303](#3303))
([5b01274](5b01274))
* update dependency com.google.errorprone:error_prone_annotations to
v2.34.0
([#3304](#3304))
([5bd6c9c](5bd6c9c))
* update google api dependencies
([#3282](#3282))
([a9eac85](a9eac85))
* update google auth library dependencies to v1.29.0
([#3302](#3302))
([e64eda2](e64eda2))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generator incorrectly sets the composeTransport sample's region tag
2 participants