stable

Clone or download

Read-only

refactor: Flatten comparison matching

No functional change for cross-tracker TQL queries on numeric duck-typed fields. Why? Due to the structure of the TQL language, we are forced to identify the type of the Comparison before we know its left-hand part (the Searchable). It makes things painful for us because for each type of comparison, we will repeat the code to build a duck-typed field and match its type. Having more flexibility could help us group related things together: it is the same process to retrieve a duck-typed field, no matter the comparison. Using an enum breaks the "visitor" spirit, but there are also advantages: - match expression raises an error if a branch is not handled, so we should have an equivalent guarantee of completeness as visitor - we can pass different parameters to each branch. With visitor, we are forced to pass the same parameters. This limitation is the reason for the generic VisitorParameter and why we must pass so much stuff in nested collection parameters. - We are no longer forced to instantiate a different class for each comparison. The architecture should be easier to understand (no jumping between interfaces and visitors). part of story #10710 search on fields with duck typing Change-Id: I9e1c0c08201cb1032fdb755526528384036a9b77

Modified Files

Name
M plugins/crosstracker/include/CrossTracker/REST/v1/CrossTrackerReportsResource.php +3 −17 Go to diff View file
D plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/BetweenComparisonFromWhereBuilder.php +0 −39 Go to diff View file
D plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/EqualComparisonFromWhereBuilder.php +0 −71 Go to diff View file
R plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/LesserThanComparisonFromWhereBuilder.php Go to diff View file
D plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/GreaterThanComparisonFromWhereBuilder.php +0 −39 Go to diff View file
D plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/GreaterThanOrEqualComparisonFromWhereBuilder.php +0 −39 Go to diff View file
D plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/InComparisonFromWhereBuilder.php +0 −39 Go to diff View file
D plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/LesserThanOrEqualComparisonFromWhereBuilder.php +0 −39 Go to diff View file
D plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/NotEqualComparisonFromWhereBuilder.php +0 −71 Go to diff View file
D plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/NotInComparisonFromWhereBuilder.php +0 −39 Go to diff View file
M plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/FromWhereSearchableVisitorParameters.php +1 −1 Go to diff View file
M plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilderVisitor.php +10 −18 Go to diff View file
M plugins/crosstracker/include/crosstrackerPlugin.php +3 −17 Go to diff View file
M plugins/crosstracker/tests/integration/CrossTracker/Report/Query/Advanced/DuckTypedField/NumericDuckTypedFieldTest.php +2 −16 Go to diff View file
R plugins/crosstracker/tests/unit/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/EqualComparisonFromWhereBuilderTest.php Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/BetweenComparison.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/Comparison.php +2 −0 Go to diff View file
R plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilder/Field/FromWhereBuilder.php Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/EqualComparison.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/GreaterThanComparison.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/GreaterThanOrEqualComparison.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/InComparison.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/LesserThanComparison.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/LesserThanOrEqualComparison.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/NotEqualComparison.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/NotInComparison.php +5 −0 Go to diff View file