Repository navigation
fix(sprint): fetch all sprint pages so move --to finds sprints beyond the first 50 - #141
Merged
Merged
Conversation
… the first 50 SprintService.get_sprints() called python-jira's sprints() without maxResults, so only the first page (50 sprints) came back. On boards with a long sprint history the active sprint is not on that page: 'sprint move ISSUE --to <name>' failed with 'Sprint not found', and 'sprint list' without --state silently showed only the oldest 50. Pass maxResults=False so python-jira fetches all pages. This covers every caller (move, list, show, workflow) and every state filter in one place, so no per-call-site workaround is needed. Fixes #140
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
budjira sprint move ISSUE --to "<name>"failed withSprint '<name>' not found on board <id>for existing, active sprints as soon as a board has more than 50 sprints (#140).Cause
SprintService.get_sprints()called python-jira'ssprints()withoutmaxResults, which defaults to 50 — only the first page was searched byfind_sprint_by_name(), andsprint listwithout--stateshowed only the oldest 50 sprints.Fix
Pass
maxResults=Falseinget_sprints()so all pages are fetched. One place, coversmove,list,showand every state filter. The optional "active/future first" two-phase search from the issue was deliberately not implemented: with all pages fetched the search is already complete, and the added complexity buys no correctness.Tests
4 new tests including the exact reported scenario: a fake client emulating python-jira's 50-per-page truncation with 147 sprints where the active target lives on page 2. Red-green verified (tests fail with the fix stashed). Full suite: 1370 passed, 3 skipped; coverage 89%; all pre-commit hooks green.
Fixes #140