Error when moving group work item to epic work item
It's not possible to move around group issues on the legacy epic.
How to reproduce:
- Enable:
namespace_level_work_items
andsync_work_item_to_epic
, and - Disable
make_synced_work_item_read_only
feature flag - Create a parent epic work item
- Create an issue work item on the group level as children of the parent epic work item
- Create another epic work item as children of the parent
- Make sure you're on the legacy epic view and move the issue underneath the child epic
=> This results in an error because in EpicIssues::CreateService
, we assume that the issue is a project issue.
This can lead to issues with
- The REST or GraphQL API
- Maybe with the sync from work item to legacy epic
"undefined method `group' for nil:NilClass\n\n ::Preloaders::GroupPolicyPreloader.new(projects.filter_map(&:group), current_user).execute
Stracktrace
"ee/app/services/epic_issues/create_service.rb:62:in `each'",
"ee/app/services/epic_issues/create_service.rb:62:in `filter_map'",
"ee/app/services/epic_issues/create_service.rb:62:in `linkable_issuables'",
"app/services/issuable_links/create_service.rb:69:in `render_not_found_error?'",
"app/services/issuable_links/create_service.rb:27:in `execute'",
"ee/app/services/epics/tree_reorder_service.rb:59:in `create_issuable_links'",
"ee/app/services/epics/tree_reorder_service.rb:36:in `set_new_parent'",
"ee/app/services/epics/tree_reorder_service.rb:17:in `execute'",
"ee/app/graphql/mutations/epic_tree/reorder.rb:24:in `resolve'",
"lib/gitlab/graphql/present/field_extension.rb:18:in `resolve'",
"lib/gitlab/graphql/tracers/metrics_tracer.rb:10:in `execute_query'",
"lib/gitlab/graphql/tracers/logger_tracer.rb:11:in `execute_query'",
"lib/gitlab/graphql/tracers/application_context_tracer.rb:12:in `block in execute_query'",
"lib/gitlab/application_context.rb:133:in `block in use'",
"lib/gitlab/application_context.rb:133:in `use'",
"lib/gitlab/application_context.rb:66:in `with_context'",
"lib/gitlab/graphql/tracers/application_context_tracer.rb:11:in `execute_query'",
"app/graphql/gitlab_schema.rb:46:in `multiplex'",
"app/controllers/graphql_controller.rb:231:in `execute_query'",
"app/controllers/graphql_controller.rb:73:in `execute'",
"ee/lib/gitlab/ip_address_state.rb:10:in `with'",
"ee/app/controllers/ee/application_controller.rb:45:in `set_current_ip_address'",
"app/controllers/application_controller.rb:468:in `set_current_admin'",
"lib/gitlab/session.rb:11:in `with_session'",
"app/controllers/application_controller.rb:459:in `set_session_storage'",
"lib/gitlab/i18n.rb:114:in `with_locale'",
"lib/gitlab/i18n.rb:120:in `with_user_locale'",
"app/controllers/application_controller.rb:450:in `set_locale'",
"app/controllers/application_controller.rb:443:in `set_current_context'",
Edited by Nicolas Dular