Set organization for GitLab employees as GitLab
What does this MR do?
Related to #212461 (closed)
Important! The callback User#set_organization_for_gitlab_employee
will only work after the feature flag gitlab_employee_badge
is taken off of the User#gitlab_employee?
method or the feature is always enabled.
If the feature flag is disabled, we cannot rely on this callback.
For database review
SQL query:
SELECT
"users".*
FROM
"users"
WHERE (email LIKE '%@gitlab.com')
AND (organization != 'GitLab'
OR organization IS NULL)
AND "users"."confirmed_at" IS NOT NULL
When trying to run explain SELECT "users".* FROM "users" WHERE (email LIKE '%@gitlab.com') AND (organization != 'GitLab' OR organization IS NULL) AND "users"."confirmed_at" IS NOT NULL
in #database-lab
channel, I'm getting an error ERROR: failed to run explain without execution: pq: syntax error at or near "<"
. I can't spot what is the problem myself.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team