Skip to content

Added extended dropdown to merge requests header icon

Phil Hughes requested to merge ph/290355/mergeRequestHeaderDropdown into master

What does this MR do?

Adds a extended dropdown to the merge requests header icon that will allow for users to see both assigned and reviewer merge requests.

Query

For User#review_requested_open_merge_requests_count:

SELECT COUNT(*)
FROM "merge_requests"
INNER JOIN "projects" ON "projects"."id" = "merge_requests"."target_project_id"
LEFT JOIN project_features ON projects.id = project_features.project_id
WHERE (EXISTS (SELECT 1 FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 1884221 AND (project_authorizations.project_id = projects.id)) OR projects.visibility_level IN (0,10,20))
AND ("project_features"."merge_requests_access_level" > 0 OR "project_features"."merge_requests_access_level" IS NULL)
AND ("merge_requests"."state_id" IN (1))
AND "projects"."archived" = FALSE
AND EXISTS (SELECT true FROM "merge_request_reviewers" WHERE merge_request_id = merge_requests.id AND "merge_request_reviewers"."user_id" = 1884221)

Explain results (ran on #database-lab): https://explain.depesz.com/s/GbMZ

Screenshots (strongly suggested)

Screenshot_2020-12-15_at_08.33.50

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

Closes #290355 (closed)

Edited by Mayra Cabrera

Merge request reports