-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add list() methods and deprecate all() methods #329
Merged
Art4
merged 29 commits into
kbsali:v2.x
from
Art4:277-deprecate-all-and-listings-methods
Oct 17, 2023
Merged
Add list() methods and deprecate all() methods #329
Art4
merged 29 commits into
kbsali:v2.x
from
Art4:277-deprecate-all-and-listings-methods
Oct 17, 2023
Conversation
This file contains 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
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v2.x #329 +/- ##
============================================
+ Coverage 95.32% 95.98% +0.65%
- Complexity 365 395 +30
============================================
Files 27 27
Lines 1134 1220 +86
============================================
+ Hits 1081 1171 +90
+ Misses 53 49 -4
☔ View full report in Codecov by Sentry. |
This was referenced Dec 29, 2023
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.
There has always been confusion using the
retrieveAll()
andall()
methods, because the methods have a default limit of 25 and therefore not returns all entries. (#35, #46, #172, #277). The default limit of 25 and max limit of 100 is set by Redmine, see https://www.redmine.org/projects/redmine/wiki/Rest_api#Collection-resources-and-pagination Nevertheless we are able to push the max limit above 100 by making multiple requests internally and merge the results.This PR deprecates every
all()
method in all API classes and it adds new methods likelist()
,listByIssueId()
andlistByProject()
as replacements. This hopefully remove the wrong assumption thatall()
really means all.In this PR we also introduce a new unit testing strategy where every method will get a separate test class where every aspect of the method can be tested.
I propose this PR for Release v2.4.0.
Next we have the
listing()
methods that returns an array asname => id
orid => name
. These methods are inconsistent implemented and are based on a cache filled up by a previous call ofall()
/list()
what can be confusing. I will take care of this in a separate issue, see #338.Closes #277.
Todo
CustomField::list()
Group::list()
Issue::list()
IssueCategory::listByProject()
IssuePriority::list()
IssueRelation::listByIssueId()
IssueStatus::list()
Membership::listByProject()
News::list()
News::listByProject()
Project::list()
Query::list()
Role::list()
Search::listByQuery()
TimeEntry::list()
TimeEntryActivity::list()
Tracker::list()
User::list()
Version::listByProject()
Wiki::listByProject()
docs/usage.md
README.md
Overview