SplittyDev / spacebadgers

Fast and clean SVG badges
https://badgers.space
MIT License
252 stars 4 forks source link

Codeberg: Server 500 Errors #38

Closed maltfield closed 6 months ago

maltfield commented 6 months ago

There appears to be an error when trying to generate badges for codeberg repos.

For example, loading the following URLs give 500: Internal Server Error:

  1. https://badgers.space/codeberg/release/rimu/pyfedi
  2. https://badgers.space/codeberg/release/Kbin/kbin-core
  3. https://badgers.space/codeberg/release/noisytoot/matt
  4. https://badgers.space/codeberg/release/ac/punycode
  5. etc
SplittyDev commented 6 months ago

Thanks a lot for reporting this! I'm not super familiar with the Codeberg API, but for some reason, I'm getting a status code 403 Forbidden when sending the API requests..

Interestingly, this works fine:

I'm thinking that the Codeberg API returns 403 Forbidden when a repository doesn't have any releases, which indeed seems to be the case for the repos you mentioned. I'll try to make the error handling more resilient.

maltfield commented 6 months ago

Ah, that makes sense.

I was submitting a PR to to an "awesome table" that had a column for "number of stars" badges. Previously the table only had repos on GitHub, so I decided to try SpaceBadgers for a new item that's on Codeberg.

I only chose "/release" because "/stars" wasn't available, and it seemed better than nothing

I assume it's currently not possible to get a "number of stars" badge from codeberg with badgers.space?

SplittyDev commented 6 months ago

I fixed the release endpoint in #39, gonna merge it soon. Looking at the API docs, it should be totally possible to expose a star badge.. I'll get back to you in a few minutes

SplittyDev commented 6 months ago

Both the fix and a new stars endpoint are online as of now 🚀

https://badgers.space/codeberg/stars/forgejo/forgejo

https://badgers.space/codeberg/release/ac/punycode

SplittyDev commented 6 months ago

@all-contributors please add @maltfield for bugs and ideas

allcontributors[bot] commented 6 months ago

@SplittyDev

I've put up a pull request to add @maltfield! :tada: