Add missing issue sorting option relative_position_desc (or improve documentation)
Summary
Right now if API user tries to list issues sorted by relative_position, in descending order (that's reverse order to the one in Boards, so the Board-bottom issues should be listed first), Gitlab will silently ignore the sorting.
See Issue.simple_sorts, where that sorting option is missing.
I'm not sure whether it's a bug or a design decision, but there's nothing in the documentation that states this behavior should be expected, and it confused me a lot (as the descending order is the default one).
Steps to reproduce
- Make a project.
- Add some issues.
- Go to Boards, change ordering.
- Try GETting
http://127.0.0.1/api/v4/projects/1/issues?order_by=relative_position&sort=asc, it will give you issues in the same order as they appear in Boards. - Try GETting
http://127.0.0.1/api/v4/projects/1/issues?order_by=relative_position&sort=descorhttp://127.0.0.1:3000/api/v4/projects/1/issues?order_by=relative_position, it will give you issues sorted by their ID.
What is the expected correct behavior?
sort=desc should give a reverse of whatever sort=asc gives.
Gitlab version
# fragment of docker-compose.yml
gitlab:
image: gitlab/gitlab-ce:13.2.6-ce.0
volumes:
- ~/daryush-dev-gitlab/config:/etc/gitlab
- ~/daryush-dev-gitlab/logs:/var/log/gitlab
- ~/daryush-dev-gitlab/data:/var/opt/gitlab
ports:
- 80:80
This bug is still present on master (code linked above). Documentation I was reading: https://docs.gitlab.com/ee/api/issues.html
Edited by Pawel Zmarzly