Add helper function to use paging links#9306
Conversation
src/inmanta/util/__init__.py
Outdated
|
|
||
| async def iter_result(result: "Result", env: str, client: "Client") -> AsyncIterator["Result"]: | ||
| yield result | ||
| async for next_link_url in result.all(): |
There was a problem hiding this comment.
this plumbing is a bit weird, we should do a call about it I think
tests/util/test_util.py
Outdated
| async def test_helper_method_using_paging_links( | ||
| client: protocol.Client, | ||
| fetch_all_data_coro: Coroutine[Any, Any, common.Result], | ||
| fetch_page_by_page_coro: Coroutine[Any, Any, common.Result], | ||
| page_size: int, | ||
| env: str, | ||
| ) -> None: |
There was a problem hiding this comment.
This helper makes it hard to understand what the testcase is testing.
Options I see to improve:
- I would pass in the expected number of pages as a parameter to this method
- I would name it
assert_nottest_(i.e. it is not a test, it is an assertion helper)
| description: Add helper method to use paging links | ||
| issue-nr: 8801 | ||
| change-type: minor | ||
| destination-branches: [master, iso8] |
There was a problem hiding this comment.
I would also include a changelog entry
changelogs/unreleased/8801-add-helper-method-to-use-paging-links.yml
Outdated
Show resolved
Hide resolved
…ks.yml Co-authored-by: Wouter De Borger <wouter.deborger@inmanta.com>
Co-authored-by: Wouter De Borger <wouter.deborger@inmanta.com>
|
Processing this pull request |
|
Failed to merge changes into iso8 due to merge conflict. Please open a pull request for these branches separately by cherry-picking the commit that was made on the branch master (git cherry-pick d6c7c13). |
|
Merged into branches master in d6c7c13 |
|
Not closing this pull request due to previously commented issues for some of the destination branches. Please open a separate pull request for those branches by cherry-picking the relevant commit. You can safely close this pull request and delete the source branch. |
…urned by v2 Rest API endpoints that support paging. See [documentation](helper_method_for_paging) for more information. (Issue #8801, PR #9306) # Description Add `Result.all()` helper method. closes #8801 Follow-up ticket for api improvement [here](#9320), I tried for a while to get the plumbing right, but I couldn't. # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info)
|
This branch was not deleted as it seems to still be in use. |
…urned by v2 Rest API endpoints that support paging. See [documentation](helper_method_for_paging) for more information. (Issue #8801, PR #9306) Add `Result.all()` helper method. closes #8801 Follow-up ticket for api improvement [here](#9320), I tried for a while to get the plumbing right, but I couldn't. Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info)
…urned by v2 Rest API endpoints that support paging. See [documentation](helper_method_for_paging) for more information. (Issue #8801, PR #9337) follow up iso8 PR to #9306 Add `Result.all()` helper method. closes #8801 Follow-up ticket for api improvement [here](#9320), I tried for a while to get the plumbing right, but I couldn't. Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info) # Description * Short description here * closes *Add ticket reference here* # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info)
# Description follow up fix to github.com//pull/9306 # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info)
# Description follow up fix to github.com//pull/9306 # Self Check: Strike through any lines that are not applicable (`~~line~~`) then check the box - [ ] Attached issue to pull request - [ ] Changelog entry - [ ] Type annotations are present - [ ] Code is clear and sufficiently documented - [ ] No (preventable) type errors (check using make mypy or make mypy-diff) - [ ] Sufficient test cases (reproduces the bug/tests the requested feature) - [ ] Correct, in line with design - [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: ) - [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info)
Description
Add
Result.all()helper method.closes #8801
Follow-up ticket for api improvement here, I tried for a while to get the plumbing right, but I couldn't.
Self Check:
Strike through any lines that are not applicable (
~~line~~) then check the box