Skip to content

Improve namespaces and users api

Tomasz Maczukin requested to merge improve-namespaces-and-users-api into master

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:

  1. Present user_id with 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).

  2. Allows to list projects of selected namespace. Currently we can find namespace by id but there is no API that would list all projects of given namespace.

  3. Allows to use username as the replacement of ID when using users API. Currently we could do - for example - GET /api/v4/users/USERNAME_OR_ID/projects but we couldn't do GET /api/v4/users/USERNAME_OR_ID but 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?

What are the relevant issue numbers?

Closes #62547 (moved)

Edited by Tomasz Maczukin

Merge request reports