Add OR filter support for labels
What does this MR do and why?
Adds OR filter support for labels in GraphQL
Sample SQL query for searching issues with type::bug
OR type::maintenance
labels.
Project-level
The label IDs are queried in a separate query so we only have label IDs here
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/13304/commands/46674
Dashboard-level
We can't use the label ID optimization so we use the label names here. I also added a username = engwan
filter here because dashboard queries are very slow because it includes all public projects. The query performs similarly to AND though so this problem isn't specific to OR queries.
https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/13304/commands/46676
How to set up and validate locally
Sample GraphQL query:
query {
project(fullPath: "flightjs/flight") {
issues(or: { labelNames: ["Altima", "Fiero"] }) {
nodes {
id
title
labels {
nodes {
title
}
}
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #296031 (closed)