Commit 805234a5 authored by Stan Hu's avatar Stan Hu

Merge branch 'cat-remove-user-secondary-email-ff' into 'master'

Remove user_search_secondary_email feature flag

See merge request gitlab-org/gitlab!49312
parents 3ab9fb53 42b2a72f
...@@ -591,13 +591,7 @@ class User < ApplicationRecord ...@@ -591,13 +591,7 @@ class User < ApplicationRecord
sanitized_order_sql = Arel.sql(sanitize_sql_array([order, query: query])) sanitized_order_sql = Arel.sql(sanitize_sql_array([order, query: query]))
search_query = if Feature.enabled?(:user_search_secondary_email) search_with_secondary_emails(query).reorder(sanitized_order_sql, :name)
search_with_secondary_emails(query)
else
search_without_secondary_emails(query)
end
search_query.reorder(sanitized_order_sql, :name)
end end
# Limits the result set to users _not_ in the given query/list of IDs. # Limits the result set to users _not_ in the given query/list of IDs.
......
---
title: Remove user_search_secondary_email feature flag
merge_request: 49312
author:
type: changed
---
name: user_search_secondary_email
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47587
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/282137
milestone: '13.7'
type: development
group: group::access
default_enabled: false
...@@ -2078,32 +2078,16 @@ RSpec.describe User do ...@@ -2078,32 +2078,16 @@ RSpec.describe User do
end end
describe 'secondary email matching' do describe 'secondary email matching' do
context 'feature flag :user_search_secondary_email is enabled' do it 'returns users with a matching secondary email' do
it 'returns users with a matching secondary email' do expect(described_class.search(email.email)).to include(email.user)
expect(described_class.search(email.email)).to include(email.user)
end
it 'does not return users with a matching part of secondary email' do
expect(described_class.search(email.email[1...-1])).to be_empty
end
it 'returns users with a matching secondary email regardless of the casing' do
expect(described_class.search(email.email.upcase)).to include(email.user)
end
end end
context 'feature flag :user_search_secondary_email is disabled' do it 'does not return users with a matching part of secondary email' do
before do expect(described_class.search(email.email[1...-1])).to be_empty
stub_feature_flags(user_search_secondary_email: false) end
end
it 'does not return users with a matching secondary email' do
expect(described_class.search(email.email)).not_to include(email.user)
end
it 'does not return users with a matching part of secondary email' do it 'returns users with a matching secondary email regardless of the casing' do
expect(described_class.search(email.email[1...-1])).to be_empty expect(described_class.search(email.email.upcase)).to include(email.user)
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment