Bug with expires_at date in 'Add a member to project' (API)
Summary
There is no way to give access to a project (POST /projects/:id/members) with the exact time. There is a mismatch in the documentation and real response from API: the documentation says that response will return a dictionary with expires_at
parameter in yyyy-MM-dd'T'HH:mm:ss'Z'
format, but it returns date in yyyy-MM-dd
format and set time of expires_at
to the end of given date.
Steps to reproduce
- Create a project.
- Use GitLab API to add a user to the project with
expires_at
parameter using POST request (https://example.gitlab.com/v4/projects/:project_id/members/?user_id=:user_id&access_level=40&expires_at=2019-04-20T11:14:00Z') It should give access as Maintainer for the user (:user_id) to project (:project_id) tillexpires_at
date and time. - Using GET request to see the project members (https://example.gitlab.com/v4/projects/:project_id/members) got a response with '2019-04-20' value of
expires_at
parameter. So, the access for the user will be close at the end of the given day but not in the given time
Example Project
https://gitlab.com/a.klymenok/example_for_issue
What is the current bug behavior?
expires_at
set access to a project only for the given date but not for the given time
What is the expected correct behavior?
expires_at
set access to a project for the given date and time
Relevant logs and/or screenshots
> curl -X POST --header "PRIVATE-TOKEN: Token" 'https://gitlab.com/api/v4/projects/11093638/members?user_id=2378463&access_level=40&expires_at=2019-03-02T20:19:20Z'
{
"id": 2378463,
"name": "Олег Жовнуватий (Phantomo)",
"username": "jovnuvaty",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/4fcf1fd370c5c0185a519f7885321add?s=80\u0026d=identicon",
"web_url": "https://gitlab.com/jovnuvaty",
"access_level": 40,
"expires_at": "2019-03-02"
}
Output of checks
This bug happens on GitLab.com