Combine Gitlab::Namespace::GetService and Gitlab::Admin::GetNamespaceService
The following discussion from !1589 should be addressed:
-
@cwiesner started a discussion: (+1 comment) note: You mentioned a follow-up in the description that queries GitLab for a single Namespace by id. We already have
GitLab::Admin::GetNamespaceService
which does this. It is sent with a admin token and not with a customer's token. We should use that code with a bit of a refactor (moving the class out of the admin namespace, passing the token). Does that sound like something you already had in mind for this?
Purpose
There may be a good opportunity to combine the two services, Gitlab::Namespace::GetService
and Gitlab::Admin::GetNamespaceService
, into one services. There is some shared logic between the two but also some differences. It may not be worth it if the differences make it too complex, but worth consideration.
Another consideration for this issue removing the namespace data which is supplemented to the result by using the order. This doesn't seem like it fits with the responsibility of the Gitlab::Namespace::GetService
or Gitlab::Namespace::ListService
. More information on this can be found in this discussion thread.