Skip to content

PubSub: Make synth operations on PubSub types idempotent#8447

Closed
plamut wants to merge 1 commit into
googleapis:masterfrom
plamut:fix-pubsub-synth
Closed

PubSub: Make synth operations on PubSub types idempotent#8447
plamut wants to merge 1 commit into
googleapis:masterfrom
plamut:fix-pubsub-synth

Conversation

@plamut

@plamut plamut commented Jun 20, 2019

Copy link
Copy Markdown
Contributor

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

plamut commented Jun 20, 2019

Copy link
Copy Markdown
Contributor Author

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