tf / redmine_merge_request_links

Display links to associated Gitlab merge requests and GitHub pull requests on Redmine's issue page.
https://www.redmine.org/plugins/redmine_merge_request_links
MIT License
35 stars 26 forks source link

Error after executing git apply command #13

Closed Tjird closed 5 years ago

Tjird commented 5 years ago

This is the error that I get when executing the git apply command.

root@redmine-dev-server-1:/usr/src/redmine# git apply plugins/redmine_merge_request_links/patches/view_hook_issues_show_after_details.patch
error: patch failed: app/views/issues/show.html.erb:118
error: app/views/issues/show.html.erb: patch does not apply

The ENV is set and the redmine version is 3.4.6.

These are the lines around line 118 in show.html.erb

<% if @relations.present? || User.current.allowed_to?(:manage_issue_relations, @project) %>
<hr />
<div id="relations">
<%= render :partial => 'relations' %>
</div>
<% end %>
</div>     <---- this is line 118
<%= call_hook(:view_issues_show_after_details, :issue => @issue) %>
tf commented 5 years ago

For me, applying the patch to Redmine 3.4.6 works. Looking at app/views/issues/show.html.erb at that version, line 118 appears to be an empty line. So maybe the file changed locally on your system?

Tjird commented 5 years ago

Strange but ok. I know use the Dockerfile from you and it started but the merge_requests/event page is not found. The ENV for gitlab is filled in.

Forget what I said that it works.

Steps what I did:

root@util-redmine-new-1:/usr/src/redmine# ls ./plugins/
README
root@util-redmine-new-1:/usr/src/redmine# cd ./plugins/
root@util-redmine-new-1:/usr/src/redmine/plugins# git clone https://github.com/tf/redmine_merge_request_links.git
Cloning into 'redmine_merge_request_links'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 365 (delta 3), reused 5 (delta 0), pack-reused 349
Receiving objects: 100% (365/365), 51.83 KiB | 0 bytes/s, done.
Resolving deltas: 100% (143/143), done.
root@util-redmine-new-1:/usr/src/redmine/plugins# cd ..
root@util-redmine-new-1:/usr/src/redmine# rake redmine:plugins:migrate RAILS_ENV=production
Migrating redmine_merge_request_links (Redmine Merge Request Links)...
== 1 CreateMergeRequests: migrating ===========================================
-- create_table(:merge_requests)
   -> 0.0127s
== 1 CreateMergeRequests: migrated (0.0130s) ==================================

== 2 CreateIssuesMergeRequests: migrating =====================================
-- create_join_table(:issues, :merge_requests)
   -> 0.0090s
== 2 CreateIssuesMergeRequests: migrated (0.0091s) ============================

root@util-redmine-new-1:/usr/src/redmine# git apply plugins/redmine_merge_request_links/patches/view_hook_issues_show_after_details.patch
error: patch failed: app/views/issues/show.html.erb:118
error: app/views/issues/show.html.erb: patch does not apply

This is the show.html.erb file https://hastebin.com/gusudayivi.js

Exactly the same for redmine 4.0.

tf commented 5 years ago

The patch is applied in CI for both Redmine 3.4 and 4.0. I also just tried it again on my local machine and could not reproduce the error.

If you can't find out why it fails on your machine you can always apply the patch manually. It is just one line.

Tjird commented 5 years ago

Allright, then I need to apply is manually. But then it's the question what do I need to do? I don't understand what the patch file does.

tf commented 5 years ago

The patch inserts the following line:

<%= call_hook(:view_issues_show_after_details, :issue => @issue) %>

here in app/views/issues/show.html.erb.

Tjird commented 5 years ago

Nice.. The funniest part is that this line already is in the file. I don't know what to do next x).

tf commented 5 years ago

Sorry. This is not a support forum. The issue tracker is meant for discussing bugs and feature enhancements. Please refer to the Redmine docs on how to install plugins.