Skip to content
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 Crates.io recent downloads badge (fixes #4186), run [Crates] #4187

Merged
merged 4 commits into from
Oct 17, 2019
Merged

Add Crates.io recent downloads badge (fixes #4186), run [Crates] #4187

merged 4 commits into from
Oct 17, 2019

Conversation

17cupsofcoffee
Copy link
Contributor

Summary of the changes:

  • Added a 'recent downloads' badge for Crates.io.
    • I exposed it at /crates/dr/:crate (r for recent), as this seemed consistent with the existing routes in that namespace.
    • The data for recent downloads is only available for the crate as a whole, not individual versions, so I made the service bail out early with an error if you try to do that, to avoid unneccecary calls to Crates.io.
  • Cleaned up some of the existing code.
  • Updated the examples.
    • I left /d/:crate/:version out of the examples, because it does the same thing as /dt/:crate/:version and the latter makes more sense to me. The URL still works, though.
    • The URLs in the examples now include the relevant variants instead of :variant - this seems to play nicer with the modal editor.

Hopefully this is okay, first time contributing :)

image

@shields-ci
Copy link

shields-ci commented Oct 17, 2019

Messages
📖 ✨ Thanks for your contribution to Shields, @17cupsofcoffee!

Generated by 🚫 dangerJS against c8d5012

@calebcartwright calebcartwright changed the title Add Crates.io recent downloads badge (fixes #4186) Add Crates.io recent downloads badge (fixes #4186), run [CratesDownloads] Oct 17, 2019
@calebcartwright calebcartwright added the service-badge New or updated service badge label Oct 17, 2019
@calebcartwright calebcartwright changed the title Add Crates.io recent downloads badge (fixes #4186), run [CratesDownloads] Add Crates.io recent downloads badge (fixes #4186), run [Crates] Oct 17, 2019
@shields-cd shields-cd temporarily deployed to shields-staging-pr-4187 October 17, 2019 19:15 Inactive
@shields-cd shields-cd temporarily deployed to shields-staging-pr-4187 October 17, 2019 19:30 Inactive
Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much!

@17cupsofcoffee
Copy link
Contributor Author

No problem, thank you for the helpful review comments 😄

@calebcartwright calebcartwright merged commit 62bee16 into badges:master Oct 17, 2019
@shields-deployment
Copy link

This pull request was merged to master branch. This change is now waiting for deployment, which will usually happen within a few days. Stay tuned by joining our #ops channel on Discord!

After deployment, changes are copied to gh-pages branch:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants