pizza
pizza copied to clipboard
Bug: ignore empty repos
Describe the bug
The pizza service should ignore repos that have empty git repos. For example, for repos like: https://github.com/tamagui/sponsors (which indeed is empty from a public perspective)
This repo throws the following:
{"level":"error","ts":1700591125.6592977,"caller":"server/server.go:103","msg":"Error validating repo URL https://github.com/tamagui/sponsors: could not list remote repository: remote repository is empty","stacktrace":"github.com/open-sauced/pizza/oven/pkg/server.PizzaOvenServer.handleRequest\n\t/app/pkg/server/server.go:103\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2136\nnet/http.(*ServeMux).ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2514\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2938\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:2009"}
This gets surfaced in the API as a 400 error
/Users/jpmcb/workspace/opensauced/api.opensauced.pizza/node_modules/axios/lib/core/settle.js:19
reject(new AxiosError(
^
AxiosError: Request failed with status code 400
at settle (/Users/jpmcb/workspace/opensauced/api.opensauced.pizza/node_modules/axios/lib/core/settle.js:19:12)
at IncomingMessage.handleStreamEnd (/Users/jpmcb/workspace/opensauced/api.opensauced.pizza/node_modules/axios/lib/adapters/http.js:572:11)
at IncomingMessage.emit (node:events:526:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
Steps to reproduce
- Run api / app / pizza service locally
- Attempt to add tamagui/sponsors as a repo in an insights page
- Notice insights page fail to load
Browsers
No response
Additional context (Is this in dev or production?)
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Contributing Docs
- [X] I agree to follow this project's Contribution Docs