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

Depfu for Gitlab repos #7474

Closed
kris7t opened this issue Jan 10, 2022 · 3 comments · Fixed by #7475
Closed

Depfu for Gitlab repos #7474

kris7t opened this issue Jan 10, 2022 · 3 comments · Fixed by #7475
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs

Comments

@kris7t
Copy link
Contributor

kris7t commented Jan 10, 2022

📋 Description

The Depfu service is using the /github/shields endpoint of Depfu, which means it can only query the status of Github repos. It would be nice to be able to query Gitlab repos.

🔗 Data

Depfu also has a https://depfu.com/gitlab/shields/${userRepo} endpoint, which acts the same as the /github/shields endpoint, but for Gitlab repos.

🎤 Motivation

While Depfu provides built-in badges, their style cannot be customized (e.g., ?style=flat-square), so it would be still useful to have this as a shields.io badge.

@kris7t kris7t added the service-badge Accepted and actionable changes, features, and bugs label Jan 10, 2022
@chris48s chris48s added the good first issue New contributors, join in! label Jan 10, 2022
@chris48s
Copy link
Member

I think the way to do this will be to make new routes

  • /depfu/github/:userRepo+
  • /depfu/gitlab/:userRepo+

and then redirect /depfu/anything/else to /depfu/github/anything/else for backwards compatibility

@kris7t
Copy link
Contributor Author

kris7t commented Jan 10, 2022

Btw, I managed to find a workaround by using the underlying JSON endpoint directly, such as

https://img.shields.io/badge/dynamic/json?color=colorscheme&label=dependencies&query=text&url=https%3A%2F%2Fdepfu.com%2Fgitlab%2Fshields%2F{user}%2F{repo}&style=flat-square

But adding the routes would certainly be much nicer. I could try adding it myself, if I can manage to understand how redirectors and routes are set up. 🙂

@chris48s
Copy link
Member

If you are interested in looking at it https://github.com/badges/shields/blob/c73072deed8eb6a5b9f51a06377f5f396ef21842/services/circleci/circleci.service.js is probably a good example to crib from

kris7t added a commit to kris7t/shields that referenced this issue Jan 11, 2022
kris7t added a commit to kris7t/shields that referenced this issue Jan 11, 2022
kris7t added a commit to kris7t/shields that referenced this issue Jan 25, 2022
repo-ranger bot added a commit that referenced this issue Jan 29, 2022
* [Depfu] Add support for Gitlab

Fixes #7474

* [Depfu] Add tests for Gitlab

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants