Improve namespaces and users api
What does this MR do?
Improves API for namespaces and users management.
Are there points in the code the reviewer needs to double check?
Should be merged together with gitlab-ee!4628.
Why was this MR needed?
This MR adds three changes:
user_idwith namespace's details, when namespace is of kind
user. While using API I found that the first thing I do after checking information about namespace is to find the user ID related to this namespace (by running another request to users API).
Allows to list projects of selected namespace. Currently we can find namespace by
idbut there is no API that would list all projects of given namespace.
Allows to use
usernameas the replacement of
IDwhen using users API. Currently we could do - for example -
GET /api/v4/users/USERNAME_OR_ID/projectsbut we couldn't do
GET /api/v4/users/USERNAME_OR_IDbut only
GET /api/v4/users/ID. This makes API inconsistent.
The MR adds also some improvements and fixes for problems in tests for users API, that I found during work on the three additions described above.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Documentation created/updated
- API support added
- Tests added for this feature/bug
- Has been reviewed by UX
- Has been reviewed by Frontend
- Has been reviewed by Backend
- Has been reviewed by Database
- Conform by the merge request performance guides
- Conform by the style guides
- Squashed related commits together
- Internationalization required/considered