Resolve access request todos for groups and projects
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
Project access request todos auto resolution
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:
- Create a public group named
todo_public_group
. - Let users
user1
,user2
anduser3
be the owners oftodo_public_group
group. - From another user account
user4
who is not a member of the group, raise access request. - Group access request todos will be created for users
user1
,user2
anduser3
. -
user1
accepts/denies the access request foruser4
. - The access request todo for
user1
should be marked done in the todos dashboard. - Access request todos for other group owners
user2
anduser3
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #374726 (closed)
Edited by Hitesh Raghuvanshi