summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-04-18 17:52:37 +0000
committerRémy Coutable <remy@rymai.me>2018-04-18 17:52:37 +0000
commita3bbd0391864d434b7485cea0267624a697aac27 (patch)
treed1b7064a2c2bb1dbbd14f24b0c7719e08fd33f2f /app/models
parent36df521dc90c86cf3bc2d289283a4ad2c80d5e63 (diff)
parent2a9a2b22e622103b753e98cfee856c7f7dabad5f (diff)
downloadgitlab-ce-a3bbd0391864d434b7485cea0267624a697aac27.tar.gz
Merge branch 'bvl-shared-groups-on-group-page' into 'master'
Fix issues on groups group trees Closes #42407 See merge request gitlab-org/gitlab-ce!18390
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/group_descendant.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/models/concerns/group_descendant.rb b/app/models/concerns/group_descendant.rb
index 01957da0bf3..261ace57a17 100644
--- a/app/models/concerns/group_descendant.rb
+++ b/app/models/concerns/group_descendant.rb
@@ -37,7 +37,20 @@ module GroupDescendant
parent ||= preloaded.detect { |possible_parent| possible_parent.is_a?(Group) && possible_parent.id == child.parent_id }
if parent.nil? && !child.parent_id.nil?
- raise ArgumentError.new('parent was not preloaded')
+ parent = child.parent
+
+ exception = ArgumentError.new <<~MSG
+ parent: [GroupDescendant: #{parent.inspect}] was not preloaded for [#{child.inspect}]")
+ This error is not user facing, but causes a +1 query.
+ MSG
+ extras = {
+ parent: parent,
+ child: child,
+ preloaded: preloaded.map(&:full_path)
+ }
+ issue_url = 'https://gitlab.com/gitlab-org/gitlab-ce/issues/40785'
+
+ Gitlab::Sentry.track_exception(exception, issue_url: issue_url, extra: extras)
end
if parent.nil? && hierarchy_top.present?