Skip to content

Resolve access request todos for groups and projects

Hitesh Raghuvanshi requested to merge 374726-resolve-todo-on-action into master

What does this MR do and why?

In MRs !103316 (merged) and !106550 (merged), we created todos for last 10 active owners of groups and projects whenever a user raises request for them.

In this MR, we are resolving the access request todos for the owner who either accepts or denies the membership request.

Screenshots or screen recordings

Group access request todos auto resolution

group_todo_resolve_1080

Project access request todos auto resolution

project_resolve_todos_1080

Query plan

Sample query
SELECT 
  "todos"."id" 
FROM 
  "todos" 
WHERE 
  "todos"."user_id" = 2982208 
  AND "todos"."action" = 10 
  AND "todos"."author_id" = 11485419 
  AND (
    "todos"."state" IN ('pending')
  ) 
  AND "todos"."target_type" = 'Namespace' 
  AND "todos"."state" != 'done';

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/15061/commands/52372

How to set up and validate locally

Adding steps for group access request todos here, steps for project will be similar:

  1. Create a public group named todo_public_group.
  2. Let users user1, user2 and user3 be the owners of todo_public_group group.
  3. From another user account user4 who is not a member of the group, raise access request.
  4. Group access request todos will be created for users user1, user2 and user3.
  5. user1 accepts/denies the access request for user4.
  6. The access request todo for user1 should be marked done in the todos dashboard.
  7. Access request todos for other group owners user2 and user3 will still remain there, we will queue them for deletion in a follow-up MR.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #374726 (closed)

Edited by Hitesh Raghuvanshi

Merge request reports