Handle `NoRepository` exceptions more broadly
Problem to solve
We have found that NoRepository
exceptions are a recurring problem. We have been adding rescue
conditions on a case-by-case basis as we encounter this exception in different contexts, but it would be desirable to handle NoRepository
exceptions more gracefully across the application more broadly.
Note: This problem discussion originated in #349414 (comment 814126648)
Proposal
Maybe every Git/Gitaly call has to have some explicit handling for
NoRepository
(https://gitlab.com/gitlab-org/gitlab/blob/d926e54cc88ad2cba71a3579e033e10954066430/lib/gitlab/git/wraps_gitaly_errors.rb). Right now this error is not handled inwraps_gitaly_error
. We could systematically create a list of the most commonly-requested RPCs, run a test to see what happens, and require a specific handler (e.g.ignore
,raise error
, etc.).