Skip to content

Filters out project bots from invite member selections

What does this MR do and why?

What

  • Filters out project_bot user types from the invite modal selection dropdown
  • Adds without_project_bot to the users API to support the filter

Why

  • From a project adding a project_bot(and group bot) with the invite modal will error out as seen in the description of #355659 (closed)
    • why this errors out the way reported is explained in #355659 (comment 872309230) and relates to a policy preventing project_bot types from being added in the member creation process.
    • we shouldn't need to invite project_bots from the invite modal anyway as the /-/settings/access_tokens is used for that process as detailed in #355659 (comment 874116075)
      • this is also true for group bots, which are user_type project_bot as well.

New query analysis

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/9465/commands/33571

Screenshots or screen recordings

member type header header
project Screen_Shot_2022-03-23_at_5.01.05_PM Screen_Shot_2022-03-24_at_3.19.37_PM
group Screen_Shot_2022-03-23_at_5.01.32_PM Screen_Shot_2022-03-24_at_3.20.10_PM

How to set up and validate locally

  1. Create a new group.
  2. Create a new project under that group.
  3. Create project bot for the group following this guide https://docs.gitlab.com/ee/user/group/settings/group_access_tokens.html#create-a-group-access-token-using-ui
  4. Create project bot for the project following this guide https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#create-a-project-access-token
  5. Attempt to invite the project bot to the project by searching for 'project' or 'bot' following this guide https://docs.gitlab.com/ee/user/project/members/#add-users-to-a-project
  6. Validate project bot cannot be found.
  7. Attempt to invite the project bot to the group by searching for 'project' or 'bot' following this guide https://docs.gitlab.com/ee/user/group/#add-users-to-a-group
  8. Attempt the invite steps on master and they should be found when searching, but error if trying to submit the invite.

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 #355659 (closed)

Edited by Doug Stull

Merge request reports