Respect ENV and config variables when initializing Bullet

What does this MR do and why?

It fixes setting up bullet gem in various configuration scenarios. Currently it's not possible to disable bullet without going into codebase. ENV variable and config variable are not respected

Here's proper configuration matrix:

ENV['ENABLE_BULLET'] gitlab.yml:bullet.enabled Rails.env Result
nil nil false false
nil nil true true
nil false true false
nil true false true
false true true false
true false false true

Keep in mind that if bullet gem is not loaded it will not be configured regardless of the matrix above.

References

Related issue: https://gitlab.com/gitlab-org/gitlab/-/issues/538847#note_2484088032

MR acceptance checklist

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

Related to #541111 (closed)

Edited by Pavel Shutsin

Merge request reports

Loading