Add IssuableFinder support for OR filtering of assignees
What does this MR do?
This is similar to !54444 (merged) but for assignees. This allows OR filtering of assignees and refactors the assignee filter into a separate class.
Testing manually
- Enable the
:or_issuable_queries
feature flag. - Visit
http://localhost:3000/h5bp/html5-boilerplate/-/issues?or[assignee_username][]=user1&or[assignee_username][]=user2
Note: The filter bar won't show the filter tokens yet because this is backend only
Sample query
SELECT "issues".*
FROM "issues"
WHERE "issues"."project_id" = 2880930
AND ("issues"."state_id" IN (1))
AND (EXISTS (
SELECT "issue_assignees".*
FROM "issue_assignees"
WHERE "issue_assignees"."user_id" IN (
SELECT "users"."id" FROM "users" WHERE (LOWER("users"."username") IN (LOWER('engwan'), LOWER('mcelicalderonG')))
) AND (issue_id = issues.id)
))
AND "issues"."issue_type" IN (0, 1)
ORDER BY "issues"."created_at" DESC, "issues"."id" DESC
LIMIT 20 OFFSET 0
Time: 4.987 ms
- planning: 1.213 ms
- execution: 3.774 ms
- I/O read: 0.000 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 2052 (~16.00 MiB) from the buffer pool
- reads: 0 from the OS file cache, including disk I/O
- dirtied: 0
- writes: 0
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/4135/commands/14411
- The AND version of this query has multiple EXISTS statements per given assignee while this one has a single one with a subquery for the multiple users.
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
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
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #296031 (closed)
Edited by Heinrich Lee Yu