elasticsearch: group-level search returning projects is broken
Extracted from https://gitlab.com/gitlab-org/gitlab-ee/issues/11419#note_180248725
This search is broken on staging, with group-level search enabled with elasticsearch:
https://staging.gitlab.com/search?utf8=%E2%9C%93&snippets=&scope=&search=gitlab&group_id=9970
Sentry error: https://sentry.gitlab.net/gitlab/staginggitlabcom/issues/799270/
ActionView::Template::Error: undefined method `repository' for #<Elasticsearch::LiteProject:0x00007f37f59d7a90>
NoMethodError: undefined method `repository' for #<Elasticsearch::LiteProject:0x00007f37f59d7a90>
from banzai/filter/relative_link_filter.rb:180:in `repository'
from banzai/filter/relative_link_filter.rb:39:in `block in linkable_files?'
from gitlab/utils/strong_memoize.rb:30:in `strong_memoize'
from banzai/filter/relative_link_filter.rb:38:in `linkable_files?'
from banzai/filter/relative_link_filter.rb:49:in `process_link_attr'
from banzai/filter/relative_link_filter.rb:24:in `block in call'
from nokogiri/xml/node_set.rb:238:in `block in each'
from nokogiri/xml/node_set.rb:237:in `upto'
from nokogiri/xml/node_set.rb:237:in `each'
from banzai/filter/relative_link_filter.rb:23:in `call'
from html/pipeline/filter.rb:127:in `call'
from html/pipeline.rb:131:in `block in perform_filter'
from html/pipeline.rb:169:in `instrument'
from html/pipeline.rb:130:in `perform_filter'
from html/pipeline.rb:116:in `block (2 levels) in call'
from html/pipeline.rb:115:in `each'
from html/pipeline.rb:115:in `inject'
from html/pipeline.rb:115:in `block in call'
from html/pipeline.rb:169:in `instrument'
from html/pipeline.rb:113:in `call'
from html/pipeline.rb:145:in `to_html'
from banzai/pipeline/base_pipeline.rb:23:in `block (2 levels) in singleton class'
from banzai/renderer.rb:133:in `post_process'
from gitlab/metrics/instrumentation.rb:161:in `block in post_process'
from gitlab/metrics/method_call.rb:36:in `measure'
from gitlab/metrics/instrumentation.rb:161:in `post_process'
from banzai.rb:28:in `post_process'
from markup_helper.rb:286:in `prepare_for_rendering'
from markup_helper.rb:115:in `markdown_field'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/shared/projects/_project.html.haml:59:in `block in _app_views_shared_projects__project_html_haml__1214704747018947844_69939099768080'
from action_view/helpers/cache_helper.rb:243:in `write_fragment_for'
from action_view/helpers/cache_helper.rb:233:in `fragment_for'
from action_view/helpers/cache_helper.rb:164:in `cache'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/shared/projects/_project.html.haml:19:in `_app_views_shared_projects__project_html_haml__1214704747018947844_69939099768080'
from action_view/template.rb:157:in `block in render'
from active_support/notifications.rb:168:in `instrument'
from action_view/template.rb:352:in `instrument_render_template'
from action_view/template.rb:155:in `render'
from action_view/renderer/partial_renderer.rb:342:in `block in render_partial'
from action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
from active_support/notifications.rb:168:in `instrument'
from action_view/renderer/abstract_renderer.rb:41:in `instrument'
from action_view/renderer/partial_renderer.rb:331:in `render_partial'
from action_view/renderer/partial_renderer.rb:310:in `render'
from action_view/renderer/renderer.rb:47:in `render_partial'
from action_view/helpers/rendering_helper.rb:34:in `render'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/shared/projects/_list.html.haml:35:in `block in _app_views_shared_projects__list_html_haml___895969437134961059_69939099092080'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/shared/projects/_list.html.haml:33:in `each'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/shared/projects/_list.html.haml:33:in `each_with_index'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/shared/projects/_list.html.haml:33:in `_app_views_shared_projects__list_html_haml___895969437134961059_69939099092080'
from action_view/template.rb:157:in `block in render'
from active_support/notifications.rb:168:in `instrument'
from action_view/template.rb:352:in `instrument_render_template'
from action_view/template.rb:155:in `render'
from action_view/renderer/partial_renderer.rb:342:in `block in render_partial'
from action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
from active_support/notifications.rb:168:in `instrument'
from action_view/renderer/abstract_renderer.rb:41:in `instrument'
from action_view/renderer/partial_renderer.rb:331:in `render_partial'
from action_view/renderer/partial_renderer.rb:310:in `render'
from action_view/renderer/renderer.rb:47:in `render_partial'
from action_view/helpers/rendering_helper.rb:34:in `render'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/search/_results.html.haml:24:in `_app_views_search__results_html_haml___2866376694097797421_69939098244960'
from action_view/template.rb:157:in `block in render'
from active_support/notifications.rb:168:in `instrument'
from action_view/template.rb:352:in `instrument_render_template'
from action_view/template.rb:155:in `render'
from action_view/renderer/partial_renderer.rb:342:in `block in render_partial'
from action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
from active_support/notifications.rb:168:in `instrument'
from action_view/renderer/abstract_renderer.rb:41:in `instrument'
from action_view/renderer/partial_renderer.rb:331:in `render_partial'
from action_view/renderer/partial_renderer.rb:310:in `render'
from action_view/renderer/renderer.rb:47:in `render_partial'
from action_view/helpers/rendering_helper.rb:34:in `render'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/search/show.html.haml:9:in `_app_views_search_show_html_haml__4337567431878392832_69939162290020'
[...]
from application_controller.rb:117:in `render'
[...]
from /opt/gitlab/embedded/bin/unicorn:23:in `<main>'
I think it's to do with what happens when you find a project while searching at group level. I don't see it at project or global level.
I'd expect this is a blocker for rolling out to gitlab.com @DouweM @phikai . The fix is, hopefully, not difficult, and something we could pick into %12.0