Skip to content

Fix Spring Reloading AdminMode::Client

Jason Goodman requested to merge fix-spring-reload-admin-client into master

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

Availability and Testing

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

Merge request reports

Loading