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

docs: add samples for using timeouts #8255

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

olavloite
Copy link
Contributor

Adds samples for running queries and updates with timeouts. This is one of the most frequently asked questions for the Spring Data Spanner project.

Adds samples for running queries and updates with timeouts. This is one
of the most frequently asked questions for the Spring Data Spanner
project.
@olavloite olavloite requested review from a team and yoshi-approver as code owners June 13, 2023 12:10
@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: spanner Issues related to the Spanner API. labels Jun 13, 2023
@@ -41,5 +45,22 @@ public void runRepositoryExample() {
int deletedLastNameCount = this.singerRepository.deleteByLastName("a last name");
}

public void runRepositoryTimeoutExample() {
Copy link
Contributor

Choose a reason for hiding this comment

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

based on the style guide https://googlecloudplatform.github.io/samples-style-guide/, we typically have samples in individual files with separate region tags. Can you update?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've split them into separate sample files.

@averikitsch
Copy link
Contributor

We also expect tests for each sample

@snippet-bot
Copy link

snippet-bot bot commented Jun 14, 2023

Here is the summary of changes.

You are about to add 2 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

@olavloite
Copy link
Contributor Author

We also expect tests for each sample

There are no tests or test infrastructure at all set up for this project, which makes adding tests for these samples difficult.

@averikitsch
Copy link
Contributor

We also expect tests for each sample

There are no tests or test infrastructure at all set up for this project, which makes adding tests for these samples difficult.

It is a part of our policy for samples to have tests: https://googlecloudplatform.github.io/samples-style-guide/#testing. Without tests samples are not maintainable. The api-spanner-java team owns the spanner samples, therefore without explicit consent from this owner we may not be able to accept these samples.

@olavloite
Copy link
Contributor Author

api-spanner-java

Specifically the Spring Data Spanner project is maintained by a different team.

@meltsufin Could you chime in here, please? Do you know whether there's a specific reason that there are no tests set up for these samples? Or are there any plans for doing so?

@meltsufin
Copy link
Member

api-spanner-java

Specifically the Spring Data Spanner project is maintained by a different team.

@meltsufin Could you chime in here, please? Do you know whether there's a specific reason that there are no tests set up for these samples? Or are there any plans for doing so?

We have tests for Spring Data Spanner samples the we maintain in spring-cloud-gcp. We do not maintain java-docs-samples repo, however.

@averikitsch averikitsch removed their assignment Oct 6, 2023
@olavloite
Copy link
Contributor Author

@anguillanneuf Would you mind merging this PR? I don't think I have permission to merge anything in this repo.

Copy link
Contributor

@minherz minherz left a comment

Choose a reason for hiding this comment

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

I am not familiar with the demand. There is no issue external or internal referenced here.
I would suggest to avoid adding region tags before you register it and to follow region tag guidelines. I cannot add internal go-link here. Please, search for "region tag" for internal doc.


package com.example.spanner;

// [START spanner_spring_data_repository_timeout_sample]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, do not create new region tag without registering it with http://devrel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants