-
Notifications
You must be signed in to change notification settings - Fork 2k
Add reverse query param while fetching job allocations #18824
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
base: main
Are you sure you want to change the base?
Conversation
|
I am not sure if this is the right way to do it. Other implementations like the one in |
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.
Hi @Sanskar531! Thanks for this PR! As you've noted in your PR description, we should be pushing the reverse parameter down into the state query. The reason is because of pagination. For example, suppose I have the following allocations:
aaaaaaaa-71ba-11ee-950b-bfbf31e28f07bbbbbbbb-71ba-11ee-b9ea-af44d029c7facccccccc-71ba-11ee-80f2-4be2f9fab70edddddddd-71ba-11ee-81a1-db53adff8b79eeeeeeee-71ba-11ee-976a-3f503a3105b0
And then I make a query with per_page=3 and reverse=true. The way you've got it here, we'd return the following:
cccccccc-71ba-11ee-80f2-4be2f9fab70ebbbbbbbb-71ba-11ee-b9ea-af44d029c7faaaaaaaaa-71ba-11ee-950b-bfbf31e28f07
But what we really want to return is:
eeeeeeee-71ba-11ee-976a-3f503a3105b0dddddddd-71ba-11ee-81a1-db53adff8b79cccccccc-71ba-11ee-80f2-4be2f9fab70e
Once you've got that done I'll be happy to re-review. Also, can you run make cl to add a changelog entry?
| enabled, this value must match a namespace that the token is allowed to | ||
| access. This is specified as a query string parameter. | ||
|
|
||
| - `reverse` `(bool: false)` - Specifies the list of returned allocations to be sorted in the reverse lexicographical order. By default, they are lexicographically sorted. |
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.
Added "by ID", and also we hard-wrap markdown text:
| - `reverse` `(bool: false)` - Specifies the list of returned allocations to be sorted in the reverse lexicographical order. By default, they are lexicographically sorted. | |
| - `reverse` `(bool: false)` - Specifies the list of returned allocations to be | |
| sorted in the reverse lexicographical order. By default, they are | |
| lexicographically sorted by ID. |
|
Hey! Thanks for the guidance. That makes a lot of sense! So just confirming before I rework this that I can make the change to the function signature of |
Yeah, that looks like the right approach. But there's a |
#17742
Job allocations can now be reverse sorted. I have also updated the docs for it.