diff --git a/config/feature_flags/development/bitbucket_server_user_mapping_by_username.yml b/config/feature_flags/ops/bitbucket_server_user_mapping_by_username.yml similarity index 57% rename from config/feature_flags/development/bitbucket_server_user_mapping_by_username.yml rename to config/feature_flags/ops/bitbucket_server_user_mapping_by_username.yml index c672eb1e64ebc8785f4226c47331c3ce4cc397d4..9d86b4f5af470b89045400bdf4c3ef1f860324ea 100644 --- a/config/feature_flags/development/bitbucket_server_user_mapping_by_username.yml +++ b/config/feature_flags/ops/bitbucket_server_user_mapping_by_username.yml @@ -1,8 +1,8 @@ --- name: bitbucket_server_user_mapping_by_username introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36885 -rollout_issue_url: +rollout_issue_url: # No rollout: This is an ops-flag milestone: '13.4' -type: development +type: ops group: group::import -default_enabled: false +default_enabled: false # Flag should be kept disabled by default diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb index 6b163cd1b2d8357e407099f800a0a933e64fd5b4..f3253027d5750d4af6ff4d13ab95304338e8ba30 100644 --- a/lib/gitlab/bitbucket_server_import/importer.rb +++ b/lib/gitlab/bitbucket_server_import/importer.rb @@ -442,10 +442,9 @@ def author_id(rep_object) end def uid(rep_object) - # We want this explicit to only be username on the FF - # Otherwise, match email. - # There should be no default fall-through on username. Fall-through to import user - if Feature.enabled?(:bitbucket_server_user_mapping_by_username) + # We want this to only match either username or email depending on the flag state. + # There should be no fall-through. + if Feature.enabled?(:bitbucket_server_user_mapping_by_username, type: :ops) find_user_id(by: :username, value: rep_object.author_username) else find_user_id(by: :email, value: rep_object.author_email) diff --git a/lib/gitlab/bitbucket_server_import/user_finder.rb b/lib/gitlab/bitbucket_server_import/user_finder.rb index f96454eb2ccab99cf6603135b78f5c4e76363d8a..68bd2d4851a513105b7d7aa7670ea449a04c3edd 100644 --- a/lib/gitlab/bitbucket_server_import/user_finder.rb +++ b/lib/gitlab/bitbucket_server_import/user_finder.rb @@ -24,7 +24,7 @@ def author_id(object) def uid(object) # We want this to only match either username or email depending on the flag state. # There should be no fall-through. - if Feature.enabled?(:bitbucket_server_user_mapping_by_username) + if Feature.enabled?(:bitbucket_server_user_mapping_by_username, type: :ops) find_user_id(by: :username, value: object.is_a?(Hash) ? object[:author_username] : object.author_username) else find_user_id(by: :email, value: object.is_a?(Hash) ? object[:author_email] : object.author_email)