Google-cloud-node: Replacing nodejs-repo-tools with synthtool

Created on 28 Sep 2018  路  9Comments  路  Source: googleapis/google-cloud-node

While most of the automated workflows for Node.js client libraries have mostly moved to synthtool, we still use the legacy @google-cloud/repo-tools package for dynamically generating README.md and samples/README.md based on what we have in the samples/ directory.

See nodejs-vision's samples/README.md

p1 cleanup

All 9 comments

Seems like this is something we would want for other languages too, no? Should we consider adding this to synthtool? @theacodes @busunkim96

Yes, but let's start with Node.js.

Context for others - repo-tools does a lot of things, and we've been slowly moving away towards single purpose tools. Maintaining it has been hard, and at this stage the only thing yoshi is using it for is generating READMEs that embed samples. It's causing hella trouble.

So here's what I think we should do. I want to do this slow like, and responsibly:

  • Let's create a vnext branch in GoogleCloudPlatform/nodejs-repo-tools
  • Essentially delete all the code in that branch and start from scratch
  • Just have a very simple CLI that only does the README.md and samples/README.md manipulation
  • Release this under a different npm dist-tag, so we don't hurt other sample repos still possibly using repo-tools
  • If we decide we like this approach, we split this code out into a new repo, googleapis/readme-generator
  • We try to make the readme generator work across all languages. No one off tools for just nodejs if it can at all be avoided

Looking for input on the approach here @broady @bcoe @crwilcox @busunkim96 @fhinkel 鉂わ笍

nodejs-docs-samples and nodejs-getting-started is still using many of the test commands and things like repo-tools.getRequest() in the test code.

Got it. For our purposes - this is the last mile of dropping the dependency on repo-tools in the client libraries. We're not going to like delete the repo or anything :)

@fhinkel would definitely be curious to learn about how you're using the repo; wonder if it makes sense in synthtool too, or if we could trim down the features in node-repo-tools.

We very much need to sunset that thing.

https://github.com/googleapis/synthtool/pull/214 and https://github.com/googleapis/synthtool/pull/207 have pulled README generation into synthtool, which feels way more consistent (and also means our Node.js libraries won't drift way from a baseline over time; we need to fix the general case).

It would be really cool to try this approach with some other languages now that we have a strategy in place!

@fhinkel let's discuss outside of this issue your other use-cases of repo-tools, and decide whether the library can be deprecated entirely or not.

@bcoe I'm still discovering new ways of how repo-tools is used 馃ぃ

We use it in tests to make request. getRequest() adds some logic based on environment variables. https://github.com/GoogleCloudPlatform/nodejs-getting-started/blob/master/2-structured-data/test/_api-tests.js#L16

And we're using it to run the tests
https://github.com/GoogleCloudPlatform/nodejs-getting-started/blob/master/5-logging/package.json#L27

And I don't even know what that is
https://github.com/GoogleCloudPlatform/nodejs-getting-started/blob/master/5-logging/package.json#L13

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dsimmons picture dsimmons  路  4Comments

charly37 picture charly37  路  3Comments

mik115 picture mik115  路  5Comments

pputhran picture pputhran  路  4Comments

jackzampolin picture jackzampolin  路  3Comments