stable

Clone or download

Read-only

feat: Raise MYSELF() error for anonymous user and group Submitter checks

Part of story #36833 search on semantics and always there fields even if not defined How to test: 1. As a logged-in user, prepare a project dashboard with a cross-tracker search widget. Write a query like `@submitted_by = MYSELF()`. Save the report. (same step for =, !=, IN() and NOT IN() comparisons and @last_update_by searchable). 2. As an anonymous (logged out) user, browse the project dashboard prepared at step 1. The comparison should be flagged as invalid instead of mistakenly falling back to empty string '' and causing an unhandled exception "Comparison to empty string should have been flagged as invalid for Users metadata" 3. No other functional change. CI should be happy. Why ? List fields bound to users behave this way for TQL single-tracker. MYSELF() should not be defaulted to empty string, they do not have the same meaning. We should raise an error just like for TQL. This is part of the refactoring of the structure of the query validation to transition away from checks being grouped by comparison type (equals, lesser than, etc). We want to group checks by semantic / field type instead, as it is easier to understand. Most of the time, we work "field by field", so it makes more sense to have all the business rules for a given field in as few files as possible, instead of having all the business rules for "equals" comparisons being grouped together. Furthermore, usage of inheritance makes it hard to keep a mental model of the validation rules for a given field. Change-Id: I2282f6a9aac2eb379d52a4fdcd5bdf3f94119262

Modified Files

Name
M plugins/crosstracker/include/CrossTracker/REST/v1/CrossTrackerReportsResource.php +1 −0 Go to diff View file
A plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryValidation/Metadata/ArtifactSubmitterChecker.php +103 −0 Go to diff View file
M plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryValidation/Metadata/FlatInvalidMetadataChecker.php +3 −2 Go to diff View file
M plugins/crosstracker/include/crosstrackerPlugin.php +1 −0 Go to diff View file
M plugins/crosstracker/tests/integration/CrossTracker/Tests/Report/ArtifactReportFactoryInstantiator.php +1 −0 Go to diff View file
M plugins/crosstracker/tests/unit/CrossTracker/Report/Query/Advanced/InvalidTermCollectorVisitorTest.php +1 −0 Go to diff View file
A plugins/crosstracker/tests/unit/CrossTracker/Report/Query/Advanced/QueryValidation/Metadata/ArtifactSubmitterCheckerTest.php +159 −0 Go to diff View file