* Add Coderabbit PR Stats service and tests - Implemented a new service `CoderabbitStats` to fetch and display pull request statistics from the CodeRabbit API. - Created a corresponding tester file to validate the service's functionality, including tests for valid repositories, repository not found, and server errors. - The service returns a badge with the number of PRs and appropriate error messages based on the API response. This addition enhances the analysis capabilities of the application by integrating CodeRabbit statistics. * Refactor CoderabbitStats service to track reviews instead of PRs - Updated the service to fetch and display the number of reviews from the CodeRabbit API, changing the schema and badge labels accordingly. - Modified the tester file to reflect the new endpoint and expected responses, including regex for message validation. - Enhanced error handling in the service to return more descriptive error messages for invalid repositories and server errors. This change improves the accuracy of the statistics provided by the service, aligning it with the intended functionality of tracking reviews. * Enhance CodeRabbitStats service and tests - Updated the CodeRabbitStats service to include OpenAPI documentation and improved error handling for repository not found scenarios. - Changed badge label from 'CodeRabbit' to 'CodeRabbit Reviews' for clarity. - Modified the tester file to reflect the new badge format and error messages, ensuring consistency with the service updates. - Adjusted regex patterns for message validation in tests. These changes improve the usability and accuracy of the CodeRabbit statistics service. * Update services/coderabbit/coderabbit-stats.tester.js Co-authored-by: jNullj <15849761+jNullj@users.noreply.github.com> * Addressed codereview comments, changed tests. * Fix label casing in CodeRabbitStats service and tests * Update services/coderabbit/coderabbit-stats.service.js Co-authored-by: chris48s <chris48s@users.noreply.github.com> * Update CodeRabbitStats service and tests to improve error messaging - Changed example section in CodeRabbitStats service from 'github, gitlab, bitbucket' to 'github' as per review comment. - Updated error message for 404 response to 'provider or repo not found', to reflect the right code. * Added github, gitlab, bitbucket to provider. * Changing names to match the service name, removing unneeded test. --------- Co-authored-by: jNullj <15849761+jNullj@users.noreply.github.com> Co-authored-by: chris48s <chris48s@users.noreply.github.com>
This is home to Shields.io, a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services. Every month it serves over 1.6 billion images and is used by some of the world's most popular open-source projects, VS Code, Vue.js and Bootstrap to name a few.
This repo hosts:
- The Shields.io frontend and server code
- An NPM library for generating badges
- The badge design specification
Examples
- code coverage percentage:
- stable release version:
- package manager release:
- status of third-party dependencies:
- static code analysis grade:
- SemVer version observance:
- amount of Liberapay donations per week:
- Python package downloads:
- Chrome Web Store extension rating:
- Uptime Robot percentage:
Make your own badges!
(Quick example: https://img.shields.io/badge/left-right-f39f37)
Quickstart
Browse a complete list of badges and locate a particular badge by using the search bar or by browsing the categories. Click on the badge to fill in required data elements for that badge type (like your username or repo) and optionally customize (label, colors etc.). And it's ready for use!
Use the button at the bottom to copy your badge url or snippet, which can then be added to places like your GitHub readme files or other web pages.
Contributing
Shields is a community project. We invite your participation through issues and pull requests! You can peruse the contributing guidelines.
When adding or changing a service please add tests.
This project has quite a backlog of suggestions! If you're new to the project, maybe you'd like to open a pull request to address one of them.
You can read a tutorial on how to add a badge.
If you intend on reporting or contributing a fix related to security vulnerabilities, please first refer to our security policy.
Development
- Install Node 20 or later. You can use the package manager of your choice. Tests need to pass in Node 20 and 22.
- Clone this repository.
- Run
npm cito install the dependencies. - Run
npm startto start the badge server and the frontend dev server. - Open
http://localhost:3000/to view the frontend.
When server source files change, the badge server should automatically restart
itself (using nodemon). When the frontend files change, the frontend dev
server (docusaurus start) should also automatically reload. However the badge
definitions are built only before the server first starts. To regenerate those,
either run npm run prestart or manually restart the server.
To debug a badge from the command line, run npm run badge -- /npm/v/nock.
It also works with full URLs like
npm run badge -- https://img.shields.io/npm/v/nock.
Use npm run debug:server to start server in debug mode.
This recipe shows how to debug Node.js application in VS Code.
Shields has experimental support for Gitpod, a pre-configured development environment that runs in your browser. To use Gitpod, click the button below and sign in with GitHub. Gitpod also offers a browser add-on, though it is not required. Please report any Gitpod bugs, questions, or suggestions in issue #2772.
Snapshot tests ensure we don't inadvertently make changes that affect the
SVG or JSON output. When deliberately changing the output, run
SNAPSHOT_DRY=1 npm run test:package to preview changes to the saved
snapshots, and SNAPSHOT_UPDATE=1 npm run test:package to update them.
The server can be configured to use Sentry (configuration) and Prometheus (configuration).
Our full test suite as well as code coverage are run on a daily basis.
Hosting your own server
There is documentation about hosting your own server.
Related projects
Status badges are used widely across open-source and private software projects. Academics have studied the "signal" badges provide about software project quality. There are many existing libraries for rendering these badges, and alternatives to the hosted Shields badge service. awesome-badges is a curated collection of such resources. Contributions may be considered there. (The presence of a project in that collection should not be interpreted as an endorsement nor promotion from the Shields project)
History
b.adge.me was the original website for this service. Heroku back then had a thing which made it hard to use a toplevel domain with it, hence the odd domain. It used code developed in 2013 from a library called gh-badges, both developed by Thaddée Tyl. The project merged with shields.io by making it use the b.adge.me code and closed b.adge.me.
The original badge specification was developed in 2013 by Olivier Lacan. It was inspired by the Travis CI and similar badges (there were a lot fewer, back then). In 2014 Thaddée Tyl redesigned it with help from a Travis CI employee and convinced everyone to switch to it. The old design is what today is called the plastic style; the new one is the flat style.
You can read more about the project's inception, the motivation of the SVG badge specification, and the specification itself.
Project leaders
Maintainers:
Alumni:
License
All assets and code are under the CC0 LICENSE and in the public domain unless specified otherwise.
Community
Thanks to the people and companies who donate money, services or time to keep the project running. https://shields.io/community