Allow to filter issuables assigned to group members

What does this MR do and why?

!192936 (merged) allows issuables to accept group handles when filtering by author, this MR extends the same functionality for assignees.

A couple of caveats:

  • OR filters are not implemented
  • Only one group handle is accepted to prevent performance issues

IA summary

This code change refactors and expands the filtering functionality for issues and merge requests. Previously, only the author filter supported searching by group handles (like @group/subgroup), but now this capability has been extended to also work with assignee filtering.

The main changes include:

  • Moving the shared group filtering logic into a reusable module called GroupMembersFilterable that both author and assignee filters can use
  • Adding support for filtering assignees by group handles, not just individual usernames
  • Updating the assignee filter to pass the current user context, which is needed for permission checks when accessing group information
  • Expanding the test coverage to verify that both author and assignee filtering work correctly with group handles

References

SQL query plan

The query is filtering GitLab project issues by assignees who are members of https://gitlab.com/gitlab-org/plan-stage/optimize-group/engineers/backend. The query was generated using the GraphQL issues endpoint the same way from the test steps in the next topic

How to set up and validate locally

  1. Create a group (e.g., @testgroup/subgroup)
  2. Add 2-3 users as members to this group
  3. Create several issues in a project where some are assigned by group members and others by non-members 3.1 Ensure the test user has access to both the project and the group
  4. Execute the following GraphQL query
query {
  project(fullPath: "project-from-step-3-full-path") {
    issues(assigneeUsernames: "@testgroup/subgroup") {
      nodes {
        title
        assingees {
          nodes {
            username
          }
        }
      }
    }
  }
}

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Felipe Cardozo

Merge request reports

Loading