refactor(samples): move into separate files, and update to the latest sample style standard#844
Conversation
…mples Work in progress for this issue: googleapis#733
… of subscriptions.js
…on samples runnable from subscriptions.js, and also individually
…d samples by way of common.js
…m back into the system tests
…ck it up as a sample
…amples outside the main sample text so it can persist across multiple calls (for system-test)
…common code for subscriptions/topics
Codecov Report
@@ Coverage Diff @@
## master #844 +/- ##
===========================================
- Coverage 98.69% 83.48% -15.22%
===========================================
Files 20 30 +10
Lines 9443 11177 +1734
Branches 326 327 +1
===========================================
+ Hits 9320 9331 +11
- Misses 122 1845 +1723
Partials 1 1
Continue to review full report at Codecov.
|
|
This is still marked as draft because I need to update the docs to include the sample that was missing doc tags, but it's otherwise pretty much done. |
|
It looks like the missing doc tags is a larger problem. e.g. the C# samples are also missing tags for that sample. https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/master/pubsub/api/PubsubSample/Program.cs So I'm just going to call this ready, but I'll leave the TODO in there if that's okay. I do think we will want to fix that not-quite-a-sample, but it's going to require work across multiple repos. |
… is going to be a bigger and not entirely related undertaking
bcoe
left a comment
There was a problem hiding this comment.
I'm not opposed to keeping yargs in the mix for the refactor (potentially with the goal of removing it eventually? and tracking issue).
I think you can avoid the need for the common.js helper with some of yargs' power features, I included an example in review (please feel free to reach out in chat though).
…synthtool can find them
|
This is looking great! |
Fixes #733
Refactor the topics and subscriptions samples so that they aren't single files, and so they have the new GCP sample style. I've worked to keep the same command line format for the original sample runners so we don't have to update docs immediately or confuse existing users. This involved a new test common piece to paper over the differences between running from the big sample runner vs as an individual sample.
There's still one TODO in here, which is that one of the samples was missing document tags. I think that needs to be added to the docs for full coverage. I think it goes here:
https://cloud.google.com/pubsub/docs/admin