Add support for filtering MRs by review in GraphQL

What does this MR do?

This adds support for filtering merge requests by their reviewer.

This feature is complete at the model, service/finder and UI level, but lacks support in the public GraphQL API.

GraphQL Queries

We can now filter by reviewer from Project.mergeRequests and any of the user merge request fields:

query {
  currentUser {
    // assigned to me for review by me, any project
    reviewerMergeRequests {
      nodes { title reference }
    }
    // authored by me, reviewed by some-reviewer
    authoredMergeRequests(reviewerUsername: "some-reviewer" {
      nodes { title reference }
    }
    // assigned to me, reviewed by some-reviewer
    assignedMergeRequests(reviewerUsername: "some-reviewer" {
      nodes { title reference }
    }
  }
  project(fullPath: "gitlab-org/gitlab") {
    mergeRequests(reviewerUsername: "some-user-name") {
      nodes { title reference }
    }
  }
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Alex Kalderimis

Merge request reports

Loading