Add support for limit and offset in list_values method#5176
Add support for limit and offset in list_values method#5176Kami merged 16 commits intoStackStorm:masterfrom
Conversation
|
We just reformatted the code with black. (Hooray!) And this PR got caught in the cross fire too. (Arrgh!) |
|
@cognifloyd Can you please also point @anirudhbagri in the right direction to finish this PR? |
cognifloyd
left a comment
There was a problem hiding this comment.
I'm just reviewing this. My first question was, what defines the default limit? It looks like it's defined in config:
Lines 43 to 44 in 56101b8
Lines 84 to 89 in 8496bb2
st2/st2api/st2api/controllers/resource.py
Lines 126 to 129 in 8496bb2
So, could we use the default from the config?
|
Let's see. I think we'll also need some tests for this feature. It looks like this is where the list_values() tests are: Oh, and I guess that's also the test that is failing: https://github.com/StackStorm/st2/pull/5176/checks?check_run_id=2063056481#step:14:2287 Plus, I think we'll need a test for the st2client bit. |
|
Oh. And I often forget adding a changelog entry. Please do that too. Then I think this will be good to merge :) |
arm4b
left a comment
There was a problem hiding this comment.
Thanks, @anirudhbagri for the contribution and @cognifloyd for review and making this PR complete 👍
@Kami would also appreciate your final 👀 and ✔️ as someone involved in previous pagination discussions around this specific issue.
| if user: | ||
| params["user"] = user | ||
|
|
||
| if offset: |
There was a problem hiding this comment.
Since if we use a truthy check, this means offset won't be included if set to 0, but yeah I think this should be fine since that's the current / existing default behavior if offset is not specified.
|
I have upgraded to latest Stackstorm 3.8 version and I am getting also this issue. Any fix?
My workflow_clean.py Temporary Fix |
Added ability to provide limit and offset for
list_values().Partially fixes #5097 and fixes #5171.