-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add [Terraform] registry providers and modules downloads #10793
base: master
Are you sure you want to change the base?
Add [Terraform] registry providers and modules downloads #10793
Conversation
|
🚀 Updated review app: https://pr-10793-badges-shields.fly.dev |
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.
A few things, but this is solid stuff 👍
static category = 'downloads' | ||
|
||
static route = { | ||
base: 'terraform/module/downloads', |
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.
If you have a look over all the other downloads badges, we just use serviceName/:interval(dw|dm|dy)...
or whatever. We can remove the /downloads
part from the route base here.
static category = 'downloads' | ||
|
||
static route = { | ||
base: 'terraform/provider/downloads', |
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.
..and here
id: Joi.string().required(), | ||
type: Joi.string().required(), |
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.
Looks like we don't actually use the id
or type
values.
If so, we can remove these two from the schema. We don't need to validate values we don't use: We should only fail if values we actually rely on to render the badge are missing from the response or don't match the expected format.
One of the things it says on https://developer.hashicorp.com/terraform/registry/api-docs#http-status-codes is
but I can't find the actual rate limits (as in how many request per minute/hour/whatever we are allowed to make) explicitly stated. Do you have any idea what kind of rate limit we're trying to stay under? For a rate limited service where we just show a number of downloads (in this case, up to date/precise number is not super important), how about we set the badge images to be cached downstream for an hour with |
Hi!
This PR adds Terraform Registry downloads summary support for:
It uses public API endpoints as documented here