Skip to content

Fix autoload issue with RelativePositioning.range

What does this MR do?

This moves the definition of RelativePositioning.range to lib/gitlab/relative_positioning.rb.

Referencing RelativePositioning::Range would trigger the autoloading of lib/gitlab/relative_positioning/range.rb. But when that class isn't referenced yet, RelativePositioning won't have the range method and we get an exception like:

NoMethodError (undefined method `range' for Gitlab::RelativePositioning:Module):
  lib/gitlab/relative_positioning/mover.rb:33:in `move'
  app/models/concerns/relative_positioning.rb:129:in `move_between'
  app/services/issues/update_service.rb:108:in `handle_move_between_ids'
  lib/gitlab/metrics/instrumentation.rb:160:in `block in handle_move_between_ids'
  lib/gitlab/metrics/method_call.rb:27:in `measure'
  lib/gitlab/metrics/instrumentation.rb:160:in `handle_move_between_ids'
  app/services/issues/update_service.rb:8:in `execute'
  ee/app/services/ee/issues/update_service.rb:23:in `execute'
  app/services/boards/issues/move_service.rb:89:in `update'
  app/services/boards/issues/move_service.rb:60:in `move_single_issue'
  app/services/boards/issues/move_service.rb:10:in `execute'
  app/graphql/mutations/boards/issues/issue_move_list.rb:74:in `move_issue'
  ee/app/graphql/ee/mutations/boards/issues/issue_move_list.rb:21:in `move_issue'
  app/graphql/mutations/boards/issues/issue_move_list.rb:61:in `resolve'

Screenshots (strongly suggested)

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
Edited by Heinrich Lee Yu

Merge request reports

Loading