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

GitHub Contributors badges are not documented on website #10323

Closed
chris48s opened this issue Jul 4, 2024 · 0 comments · Fixed by #10337
Closed

GitHub Contributors badges are not documented on website #10323

chris48s opened this issue Jul 4, 2024 · 0 comments · Fixed by #10337
Labels
bug Bugs in badges and the frontend documentation Developer and end-user documentation

Comments

@chris48s
Copy link
Member

chris48s commented Jul 4, 2024

📋 Description

For historic reasons, we have a handful of badges that use the same 'path' in the Open API specs:

https://github.com/search?q=repo%3Abadges%2Fshields+path%3A%2F%5Eservices%5C%2Fgithub%5C%2F%2F+github%2F%7Bvariant%7D%2F%7Buser%7D%2F%7Brepo%7D&type=code

This is mostly fine, except we use path as the key in an object here:

function services2openapi(services, sort) {
const paths = {}
for (const service of services) {
for (const [key, value] of Object.entries(
addGlobalProperties(service.openApi),
)) {
if (key in paths && key !== '/github/{variant}/{user}/{repo}') {
throw new Error(`Conflicting route: ${key}`)
}
paths[key] = value
}
}
return sort ? sortPaths(paths) : paths
}

This means if we have 2 services in the same category where the path is /github/{variant}/{user}/{repo} one overwrites the other and only one shows up in the docs.

Because both
https://github.com/badges/shields/blob/master/services/github/github-contributors.service.js
and
https://github.com/badges/shields/blob/master/services/github/github-release-date.service.js
are in the activity category, only one of them shows up in the docs.

I need to find a way round this. Probably make it an array instead of object.

While we are sorting this out, we should also document the difference between the contributors and contributors-anon variants.

@chris48s chris48s added bug Bugs in badges and the frontend documentation Developer and end-user documentation labels Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend documentation Developer and end-user documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant