Skip to content

Add retry sample to STS#5760

Merged
gcf-merge-on-green[bot] merged 5 commits into
masterfrom
addcreatests
May 21, 2021
Merged

Add retry sample to STS#5760
gcf-merge-on-green[bot] merged 5 commits into
masterfrom
addcreatests

Conversation

@JesseLovelace
Copy link
Copy Markdown
Member

The example retry code on the STS docs page is both incorrect and in-line, this adds a proper sample that simply executes a request using retries to replace it

@JesseLovelace JesseLovelace requested a review from frankyn April 28, 2021 17:23
@JesseLovelace JesseLovelace requested review from a team as code owners April 28, 2021 17:23
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 28, 2021
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Apr 28, 2021
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented Apr 28, 2021

Here is the summary of changes.

You are about to add 1 region tag.

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
Copy Markdown
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

Nice catch Jesse! This LGTM

Copy link
Copy Markdown
Collaborator

@leahecole leahecole left a comment

Choose a reason for hiding this comment

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

Just some silly little nits and an update to the retry just to make sure it doesn't pass on another hypothetical random 3

print(
"Fetched transfer job: "
+ transferJob.get("name")
+ " using {} retries".format(retries)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit - can you switch this to f-strings?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I believe f strings aren't compatible with python 2.7 which we do have kokoro tests for, am I mistaken?

Comment thread storage/transfer_service/sts_snippets_test.py Outdated
@leahecole leahecole added the automerge Merge the pull request once unit tests and other checks pass. label May 21, 2021
@gcf-merge-on-green gcf-merge-on-green Bot merged commit 5397fa4 into master May 21, 2021
@gcf-merge-on-green gcf-merge-on-green Bot deleted the addcreatests branch May 21, 2021 18:24
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants