-
Notifications
You must be signed in to change notification settings - Fork 84
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
feat: porting README generation from nodejs-repo-tools #206
Conversation
@@ -0,0 +1,117 @@ | |||
[//]: # "This README.md file is auto-generated, all changes to this file will be lost." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is almost a direct port from:
https://github.com/GoogleCloudPlatform/nodejs-repo-tools/blob/master/templates/lib_readme.tpl
So here's my 2 cents. We should integrate and ship this ASAP, because it will help us drop an unmaintained dependency in nodejs-repo-tools. Moving forward, I'm assuming you're both working towards a common metadata format :) |
synthtool/sources/templates.py
Outdated
# @returns {string} The markdown badge. | ||
def release_quality_badge(input): | ||
if input: | ||
return "hello world" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a place holder? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've replaced this with the real thing now.
@@ -20,6 +20,9 @@ | |||
from synthtool import _tracked_paths | |||
from synthtool import metadata | |||
|
|||
import json | |||
import os | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these two imports be put above from pathlib import Path
?
badge = "general%20availability%20%28GA%29-brightgreen" | ||
elif release_quality == "BETA": | ||
badge = "beta-yellow" | ||
elif release_quality == "ALPHA": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@busunkim96 went ahead and ported the logic from JavaScript; still have some work to do to load samples from disk.
@busunkim96 @JustinBeckwith (CC: @jmdobry for some context from today's conversation). I've finished implementing the README generation logic and added tests. Here's an example of the rendering: https://gist.github.com/bcoe/9014b958aaec4553d2302e0e55f3d17e |
## Using the client library | ||
|
||
1. [Select or create a Cloud Platform project][projects]. | ||
1. [Enable billing for your project][billing]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we used to be able to hide this step for libraries that don't require billing; do we still need this @JustinBeckwith, how common is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some sleuthing about, and Firestore is the only one I see using it:
https://github.com/googleapis/nodejs-firestore/blob/master/.cloud-repo-tools.json#L6
That having been said - there are plenty of our products that have a free tier:
https://cloud.google.com/free/
My 2 cents: I would like to see us keep this field, and actually set it correctly, because I think requiring billing is a huge leap for a lot of developers that just want to play on the platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(also sorry for creating work)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quickstarts on cloud.google.com seem to always have the billing step (even products listed at cloud.google.com/free. Maybe our READMEs should also always have this step, for consistency?
As an aside, it kind of makes sense that the billing step was suppressed for firestore, since their Get Started doesn't explicitly mention it. 🤔
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png | ||
[projects]: https://console.cloud.google.com/project | ||
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing | ||
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid={{ metadata['repo']['api_id'] }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my goodness, I can't believe I spent 20 minutes today reading this as app_id
; sorry for inflicting my 🧠 💤 on you @jmdobry / @busunkim96.
I'm midway through porting over the logic from
nodejs-repo-tools
for generatingsamples/README.md
, and./README.md
.This process was made easier by the fact that @busunkim96 has been working to define a better meta-information file for our repos, which looks like this:
☝️ prior to this effort, there was a standard way to fetch a lot of this information.