update check_suite_id to handle paginated results #338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue being resolved: #332
Solution description
How are we solving the problem?
Updating check_suite_id to use __get_all_entities instead of __send_request to get paginated results. This PR creates a new method __get_all_suites following the pattern used by __get_all_projects and others.
Changes
What changes where made?
check_suite_id now uses __get_all_suites, which wraps __get_all_entities to get paginated results. The API for check_suite_id does not change.
Potential impacts
What could potentially be affected by the implemented changes?
Any area of the cli where check_suite_id is called, it could add latency to the call. It should not otherwise impact anything, since it is still returning a boolean if the suite id is returned.
Steps to test
Happy path to test implemented scenario
Create a project with more than a single page of suites (ie >250). Use the add_run trcli command with --suite-id for a suite in the second page of results and observe that before this is merged, the call will fail with the error "Suite with ID (some id) does not exist in TestRail."
PR Tasks