Fix Spring Reloading AdminMode::Client
What does this MR do?
As described here: gitlab-development-kit#852 (comment 339013137)
I've been getting errors while running rspec
tests with Spring such as the following:
Backtrace
ArgumentError:
A copy of Gitlab::SidekiqMiddleware::AdminMode::Client has been removed from the module tree but is still active!
# ./lib/gitlab/sidekiq_middleware/admin_mode/client.rb:11:in `call'
# ./lib/gitlab/sidekiq_status/client_middleware.rb:10:in `call'
# ./lib/gitlab/sidekiq_middleware/duplicate_jobs/client.rb:9:in `call'
# ./lib/gitlab/sidekiq_middleware/worker_context.rb:9:in `wrap_in_optional_context'
# ./lib/gitlab/sidekiq_middleware/worker_context/client.rb:18:in `call'
# ./config/initializers/forbid_sidekiq_in_transactions.rb:36:in `block (2 levels) in '
# ./app/models/concerns/update_highest_role.rb:29:in `block in update_highest_role'
# ./lib/after_commit_queue.rb:25:in `instance_eval'
# ./lib/after_commit_queue.rb:25:in `block in run_after_commit_or_now'
# ./config/initializers/forbid_sidekiq_in_transactions.rb:8:in `skipping_transaction_check'
# ./lib/after_commit_queue.rb:24:in `run_after_commit_or_now'
# ./app/models/concerns/update_highest_role.rb:24:in `update_highest_role'
# ./config/initializers/forbid_sidekiq_in_transactions.rb:50:in `block in committed!'
# ./config/initializers/forbid_sidekiq_in_transactions.rb:8:in `skipping_transaction_check'
# ./config/initializers/forbid_sidekiq_in_transactions.rb:50:in `committed!'
# ./ee/spec/controllers/projects/feature_flags_controller_spec.rb:9:in `block (2 levels) in '
# -e:1:in `'
Following the suggestion from @engwan (gitlab-development-kit#852 (comment 339169310)), I've prefixed all the classes and modules here with ::
. This seems to fix the issue.
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