badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
22.95k stars 5.47k forks source link

OSS Lifecycle GitLab #10244

Open JoeIzzard opened 3 weeks ago

JoeIzzard commented 3 weeks ago

📋 Description

There are already OSS Lifecycle and OSS Lifecycle Branch badges for GitHub, however it would be great to have a version that is compatible with GitLab. This would look and work like the existing OSS Lifecycle badge: Static Badge

🔗 Data

The data for this would be pulled from the Raw GitLab content for that repo. On GitLab this takes the form: https://gitlab.com/{USER}/{REPO}/-/raw/{BRANCH}/{FILE}?ref_type=heads

🎤 Motivation

I largely use GitLab and would like to be able to use the badge.

JoeIzzard commented 3 weeks ago

I'd propose that the current OSS Lifecycle badges are renamed to indicate that they are for GitHub, with the endpoint kept the same, and a new badge pulling from GitLab with the options common for GitLab badges such as the instance URL are created.

Happy to do the work to implement and get a PR ready once a direction is confirmed.

chris48s commented 2 weeks ago

We have a number of badges that are not using any API. They just look at a file which could be anywhere but are hard-coded to assume that file is on GitHub. I would really like to gradually move these to being agnostic about where the file is hosted. So they will work for projects on GitHub, GitLab, BitBucket, Forgejo, your self-hosted instance of Gitea.. all the places. OSSLifeCycle is one of these.

I think my suggestion here would be that we migrate this so that instead of

https://img.shields.io/osslifecycle/Netflix/osstracker

the URL becomes

https://img.shields.io/osslifecycle?file=https%3A//github.com/Netflix/osstracker/blob/master/OSSMETADATA

but file can live anywhere. To maintain backwards compatibility for existing users, we can use a redirect to redirect calls to osslifecycle/{user}/{repo}/{branch} to https://img.shields.io/osslifecycle?file=https%3A//github.com/{user}/{repo}/blob/{branch}/OSSMETADATA.