Skip to content

Revert "Merge branch 'remove-custom-getter-methods-for-secondary-emails' into 'master'"

Heinrich Lee Yu requested to merge revert-da560e59 into master

What does this MR do and why?

Reverts !69648 (merged)

This is causing isssues with issue and MR creation when the user has a private commit email.

See gitlab-com/gl-infra/production#5549 (closed)

How to set up and validate locally

  1. Create / update a user to have a private commit email.

    user.update_column(:commit_email, '_private')
  2. Check if model is valid.

    user.valid?

Before

[1] pry(main)> i = Issue.new(project: Project.first, author: User.first, title: 'Test', assignee_ids: [4155490]); nil
=> nil
[2] pry(main)> i.valid?
=> false
[3] pry(main)> i.errors.full_messages
=> ["Assignees is invalid"]
[4] pry(main)> user = User.find(4155490)
=> #<User id:4155490 @marcel.amirault>
[5] pry(main)> user.valid?
=> false
[6] pry(main)> user.errors.full_messages
=> ["Commit email is invalid"]
[7] pry(main)> user.commit_email
=> "_private"

After

[1] pry(main)> i = Issue.new(project: Project.first, author: User.first, title: 'Test', assignee_ids: [4155490]); nil
=> nil
[2] pry(main)> i.valid?
=> true
[3] pry(main)> i.errors.full_messages
=> []
[4] pry(main)> user = User.find(4155490)
=> #<User id:4155490 @marcel.amirault>
[5] pry(main)> user.valid?
=> true
[6] pry(main)> user.errors.full_messages
=> []
[7] pry(main)> user.commit_email
=> "4155490-marcel.amirault@users.noreply.dev.engwan.me"

MR acceptance checklist

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

Edited by Heinrich Lee Yu

Merge request reports

Loading