Skip to content

Add a shared avatar image for security policy bots

What does this MR do and why?

In MR !145423 (merged), we added an avatar image for the new security policy bots. In MR !145718 (closed), we planned to add the same avatar image for the existing security policy bots. However, as discussed in this comment, this would introduce a lot of duplicate images. To avoid that, we created the MR !146942 (merged), to add a shared image for the security policy bots. Unfortunately, the MR did not work as expected in production, and we reverted it in MR !149605 (merged).

This MR updates the code used in MR !146942 (merged) to use the ActionController::Base.helpers.image_path to get the correct image path to add a shared image for security policy bots avatars.

Related to #421386 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshot_2024-07-29_at_2.49.57_PM

How to set up and validate locally

  1. Create a new project
  2. Go to Secure > Policies
  3. Click on New policy
  4. Select Scan execution policy
  5. Add a name to the policy
  6. Click on Configure with a merge request
  7. Merge the new MR to add the policy
  8. After our work in !145423 (merged), the policy bots are created with an avatar. To test this MR, we need to delete the avatar with the command below in the rails console:
User.where(user_type: :security_policy_bot).last.update_column(:avatar, nil)
  1. Go back to the project created on step 1
  2. Go to Manage > Members and verify the GitLab Security Policy bot has the security-bot avatar.

image

  1. Verify the avatar filename is nil in the database
User.where(user_type: :security_policy_bot).last.avatar
Edited by Marcos Rocha

Merge request reports

Loading