Tags API ignores sort parameters
Summary
On our corporate gitlab-ee we experience an issue with the API. The order of the tags doesn't change, no matter how the query is parametrized.
Steps to reproduce
Examine the output using the following commands:
curl -s 'https://$HOST/api/v4/projects/1756/registry/repositories/675/tags?private_token=$TOKEN&per_page=3&order_by=updated&sort=desc' | jq -r '.[].name'
curl -s 'https://$HOST/api/v4/projects/1756/registry/repositories/675/tags?private_token=$TOKEN&per_page=3&order_by=updated' | jq -r '.[].name'
What is the current bug behavior?
The queries return tags in ascending order.
What is the expected correct behavior?
If the query is parametrized with sort=desc
or if this parameter is missing (the default applies), the tags should be sorted in descending order.
Relevant logs and/or screenshots
➜ ~ curl -s https://$HOST/api/v4/version -Hprivate-token:$TOKEN | jq
{
"version": "12.0.3-ee",
"revision": "1b1872f9d93"
}
Possibly a regression issue, related: https://gitlab.com/gitlab-org/gitlab-ce/issues/41697, https://gitlab.com/gitlab-org/gitlab-ee/issues/983
Edited by 🤖 GitLab Bot 🤖