10.0.0 - Merge Request Discussion - undefined `resolved_by_push?`
Summary
After upgrading to 10.0.0 from 9.5.4, existing merge request discussions are failing with a 500
error. Stack trace shows that the discussion / note is not implementing resolved_by_push?
.
Steps to reproduce
View discussions of a merge request. (Not sure if having existing merge requests pre-upgrade is necessary).
Example URL: https://REDACTED/some-group/some-project/merge_requests/3
What is the current bug behavior?
500 Error.
What is the expected correct behavior?
Merge request discussion shows up.
Relevant logs and/or screenshots
Stack trace:
ActionView::Template::Error (undefined method `resolved_by_push?' for #<DiffNote:0x00007f78db1370a8>
Did you mean? resolved_by
resolved_by_id?
resolved_by=
resolved_by_id
resolved_by_id=):
1: - if discussion.resolved?
2: .discussion-headline-light.js-discussion-headline
3: = discussion_resolved_intro(discussion)
4: - if discussion.resolved_by
5: by
6: = link_to_member(@project, discussion.resolved_by, avatar: false)
app/models/concerns/resolvable_discussion.rb:25:in `resolved_by_push?'
app/helpers/notes_helper.rb:151:in `discussion_resolved_intro'
app/views/discussions/_headline.html.haml:3:in `_app_views_discussions__headline_html_haml__327920974914302635_70078495558160'
app/views/discussions/_discussion.html.haml:40:in `_app_views_discussions__discussion_html_haml___367245837940979211_70078496836080'
app/views/shared/notes/_notes.html.haml:6:in `block in _app_views_shared_notes__notes_html_haml___697947855402829111_70078496700280'
app/views/shared/notes/_notes.html.haml:2:in `each'
app/views/shared/notes/_notes.html.haml:2:in `_app_views_shared_notes__notes_html_haml___697947855402829111_70078496700280'
app/views/shared/notes/_notes_with_form.html.haml:2:in `_app_views_shared_notes__notes_with_form_html_haml___140661138674495780_70078471840060'
app/views/projects/merge_requests/_discussion.html.haml:11:in `_app_views_projects_merge_requests__discussion_html_haml__718879393872164412_70078470197820'
app/views/projects/merge_requests/show.html.haml:79:in `_app_views_projects_merge_requests_show_html_haml___1709268012554212904_70078487910120'
lib/gitlab/i18n.rb:46:in `with_locale'
lib/gitlab/i18n.rb:52:in `with_user_locale'
app/controllers/application_controller.rb:326:in `set_locale'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/middleware/go.rb:17:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.0.0 Redis Version: 3.2.5 Git Version: 2.13.5 Sidekiq Version:5.0.4 Go Version: unknownGitLab information Version: 10.0.0 Revision: bbf5c73 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://REDACTED HTTP Clone URL: https://REDACTED/some-group/some-project.git SSH Clone URL: git@REDACTED:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.9.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Moreover, OS is: Oracle Linux Server 7.4 / RHEL 7.4
Results of GitLab application Check
Expand for output related to the GitLab application check
Redis version >= 2.8.0? ... yes Ruby version >= 2.3.3 ? ... Exception: undefined method `run_command' for SystemCheck::App::RubyVersionCheck:Class Did you mean? run_commands Git version >= 2.7.3 ? ... Exception: undefined method `run_command' for SystemCheck::App::GitVersionCheck:Class Did you mean? run_commands Git user has default SSH configuration? ... yes Active users: ... 40Checking GitLab ... Finished
Possible fixes
I did a few changes as a temporary workaround, however I don't think this is a proper fix.
File: /opt/gitlab/embedded/service/gitlab-rails/app/helpers/notes_helper.rb
Line: 151
Changed:
def discussion_resolved_intro(discussion)
discussion.resolved_by_push? ? 'Automatically resolved' : 'Resolved'
end
to:
def discussion_resolved_intro(discussion)
#discussion.resolved_by_push? ? 'Automatically resolved' : 'Resolved'
'Resolved'
end
File: /opt/gitlab/embedded/service/gitlab-rails/app/views/discussions/_headline.html.haml
Line: 7
Changed:
- if discussion.resolved_by_push?
with a push
= time_ago_with_tooltip(discussion.resolved_at, placement: "bottom")
to:
- if !discussion.resolved_at.nil?
with a push
= time_ago_with_tooltip(discussion.resolved_at, placement: "bottom")