ReVanced / revanced-releases-api

🚀 JSON API for ReVanced Releases
https://releases.revanced.app
GNU Affero General Public License v3.0
78 stars 17 forks source link

bug: #37 breaks /tools for repositories without releases #40

Closed alexandreteles closed 1 year ago

alexandreteles commented 1 year ago

Describe the bug If a repository without releases is included in the settings, the checks in place will not check for it and break execution for the endpoint.

To Reproduce Steps to reproduce the behavior:

  1. Introduce a repository without releases on config.toml
  2. Hit the /tools endpoint
  3. Endpoint will return HTTP Error 500

Expected behavior The endpoint returns a JSON including responses from repositories with releases

Additional context Relevant stack trace:

2022-11-26 22:29:13.984 | INFO     | app.utils.Logger:log_response:25 - [HTTPX] Response: GET https://api.github.com/repos/revanced/revanced-releases-api/releases/latest - Status: 404 Not Found
/home/alexs/.cache/pypoetry/virtualenvs/revanced-releases-api-JwCHMzzS-py3.10/lib/python3.10/site-packages/fastapi/encoders.py:152: RuntimeWarning: coroutine 'Releases.__get_release.<locals>.get_asset_data' was never awaited
  data = dict(obj)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2022-11-26 22:29:13.988 | INFO     | sentry_sdk.integrations.logging:sentry_patched_callhandlers:96 - 127.0.0.1:48588 - "GET /tools HTTP/1.1" 500
2022-11-26 22:29:14.011 | ERROR    | sentry_sdk.integrations.logging:sentry_patched_callhandlers:96 - Exception in ASGI application

Traceback (most recent call last):

  File "/home/alexs/projetos/revanced-releases-api/run.py", line 150, in <module>
    StandaloneApplication(app, options).run()
    │                     │    └ {'bind': '0.0.0.0:8000', 'workers': 9, 'accesslog': '-', 'errorlog': '-', 'worker_class': 'uvicorn.workers.UvicornWorker', 'l...
    │                     └ <fastapi.applications.FastAPI object at 0x7ffa885e65c0>
    └ <class '__main__.StandaloneApplication'>
alexandreteles commented 1 year ago

Fixed on c816138.