-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: apply consistent behaviour of the reverse query parameter #12244
Conversation
8740dcb
to
bbe7ffe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I assume that CSI test is unrelated, but might want to rebase on main just in case |
bbe7ffe
to
9c2db51
Compare
Ah yeah, it was fixed here: #12245 Rebased just in case to double-check. |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
The
reverse
query parameter usesGetReverse
to traverse the go-memdb table in the opposite order. Initially (#12186) this was used to return results in ascending or descending chronological order, but since this was only possible in some situations where the table schema allowed thereverse
query parameter would only work in some specific combination of query parameters.Given that there is no inherit meaning in using
Get
orGetReverse
(they are just opposite orders to traverse results) thereverse
query parameter can actually be used in most situations.This PR adds the
sort
argument to state store functions used by the list endpoints that have been updated so far. Ifsort
isSortReverse
, theGetReverse
method is used and results are returned in the reverse order from the default.No changelog required since it's continuation of #12186.