Add filters to the milestones resolver
What does this MR do?
This MR improves the milestone resolver in the following ways:
- adds arguments allowing milestones to be found by title (exact match and substring search)
- adds a convenience argument to deal with the common need to find milestones active on a single given date
- updates the description of time frame arguments to emphasize that they represent an
OVERLAPS
operation - add tests for
within_timeframe
, since it appeared to be untested. - adds a new input object to represent timeframes, which provides better type information to clients
The new input object allows up to statically represent the restriction that if the range is specified, both ends of it must be given. It also encapsulates the validation that start <= end
.
The substring search threshold for milestones is reduced to 2 because otherwise the common case of searching for all milestones at 1.x
are inexpressible. The smaller number of milestones (compared to tables such as issues) and the short titles that they typically have, means this is likely to result in acceptable performance.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Alex Kalderimis