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

PubSub: Make synth operations on PubSub types idempotent #8447

Closed
wants to merge 1 commit into from

Conversation

plamut
Copy link
Contributor

@plamut plamut commented Jun 20, 2019

This commit assures that the code block for injecting FlowControl docs is not added on every synth tool run - it is only added if one does not exist yet.

Contrary to my initial assumption in #8293, it appears that synthtool can be run multiple times on types.py and other files after generating them, thus adjustment is necessary.

How to test

Steps to perform:

  • Install the synthtool and run it from inside the pubsub/ directory,
  • Run the synthtool a few more times.

Actual result (before the fix):
A new code block for injecting FlowControl docstrings is added after every synthtool run, growing the file indefinitely.

Expected result (after the fix):
Only a single instance of the docstring-injecting code remains in the file even after multiple runs. Nothing else is changed.

This commit assures that the code block for injecting FlowControl docs
is not added on every synth tool run - it is only added if one does not
exist yet.
@plamut plamut added the api: pubsub Issues related to the Pub/Sub API. label Jun 20, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 20, 2019
@plamut
Copy link
Contributor Author

plamut commented Jun 20, 2019

Closing in favor of #8448 that also includes the changes from here.

@plamut plamut closed this Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants