Fix tag delete response body
While working on the test suite I realized that we have two problems with the tag delete route when the target repository does not exist:
-
When filesystem mirroring is disabled (we only query the DB), we're returning a
500 Internal Server Error
response code, although the body error isNAME_UNKNOWN
. The response code should be404 Not Found
. -
When using the filesystem, we're returning a
404 Not Found
but the response body error isMANIFEST_UNKNOWN
. This is like so since we introduced the tag delete route, and I believe it was the case because there was no function to build a repository root path. Now we haverepositoryRootPathSpec
, which we introduced for the migration proxy feature, so we can fix the response body code by doing a stat against this path before attempting to delete the tag. Although we're changing an existing response body, the status code remains the same (and that's the only thing GitLab Rails cares about on these responses). I think this can be considered a fix and not a breaking change because of this and the fact that the body error code is incorrect.
This MR adds a test for tag deletes with unknown repositories and makes the response of both filesystem and database consistent by using a NAME_UNKNOWN
error.