Fix 500 error for Tags API when repository is missing
What does this MR do and why?
Problem
Requests to tags API when the repository is missing return "Internal server error".
Solution
Return 404 page if the repository is missing.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Create a project without repository
FactoryBot.create(:project, path: 'empty-repository-project', namespace: Namespace.first)
- Visit http://127.0.0.1:3000/api/v4/projects/root%2Fempty-repository-project/repository/tags
- You should see 404 error instead of 500 error
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin