https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292009-04-06T04:20:37ZRedmineRedmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85042009-04-06T04:20:37ZFrederic Morin
<ul></ul><p>can you provide (attach) a sample graph produced by your query ?</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85092009-04-06T10:09:29ZMatthew W
<ul></ul><p>Frederic Morin wrote:</p>
<blockquote>
<p>can you provide (attach) a sample graph produced by your query ?</p>
</blockquote>
<p>I can email you one if you want? It's essentially just a directed graph with nodes for open tickets (with ID and title) and edges for 'precedes' dependencies. Kind of a critical path diagram, although adding estimates to it would help with that.</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85102009-04-06T10:23:40ZJean-Baptiste Barth
<ul></ul><p>Matthew W wrote:</p>
<blockquote>
<p>I can email you one if you want?</p>
</blockquote>
<p>I think you should attach a sample here, more than one person would be interested in seeing that..</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85112009-04-06T10:43:02ZMatthew W
<ul></ul><blockquote>
<p>I think you should attach a sample here, more than one person would be interested in seeing that..</p>
</blockquote>
<p>Unfortunately it's a private project, not like super top secret or anything but at the same time not sure we want our dev stuff up here in all eternity. So probably best if you email me for it, sorry to be a pain.</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85142009-04-06T11:46:05ZJean-Baptiste Barth
<ul><li><strong>File</strong> <a href="/attachments/1832">redmine_graph.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1832/redmine_graph.png">redmine_graph.png</a> added</li></ul><p>OK, no problem. Thanks for having emailed it !</p>
<p>I tried to ruby-ise your code so it uses ActiveRecord and Redmine objects, it will be easier to adapt for other people (maybe it's not totally equivalent, I didn't keep the "fixed_version_id = 1") :<br /><pre>
#!/bin/sh
(
echo "digraph redmine {";
ruby script/runner 'Issue.find(:all).select{|i| !i.closed? }.map{|i| puts "#{i.id} [label=\"#{i.id}: #{i.subject.chomp.gsub(/((?:[^ ]+ ){4})/, "\\1\\n")}\"]"}';
ruby script/runner 'IssueRelation.find(:all, :include => [:issue_from, :issue_to]).select{|ir| ir.relation_type == "precedes" && !ir.issue_from.closed? && !ir.issue_to.closed? }.map{|ir| puts "#{ir.issue_from_id} -> #{ir.issue_to_id}"}';
echo "}"
) | dot -Tpng > /var/www/redmine_graph.png
</pre></p>
<p>It works well, I attach a sample result. I obtained it by replacing the first ruby line by :<br /><pre>
ruby script/runner 'Issue.find(:all).select{|i| !i.closed? }.map{|i| puts "#{i.id} [label=\"#{i.id}: My issue #{i.id}\"]"}';
</pre></p>
<p>Maybe your sample with this line would be better ? If so, delete mine and put your own..</p>
<p>Anyway, it may be difficult to integrate such a feature in core, since it's based upon an external program (graphviz)... but I may be wrong!</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85162009-04-06T12:20:45ZJean-Baptiste Barth
<ul></ul><p>Here is a complete ruby/rake solution :<br /><pre><code>namespace :redmine do
task :graphviz => :environment do
f = Tempfile.new('graphviz')
f.puts "digraph redmine {"
Issue.find(:all).select do |i|
!i.closed?
end.map do |i|
f.puts "#{i.id} [label=\"#{i.id}: #{i.subject.chomp.gsub(/((?:[^ ]+ ){4})/, "\\1\\n")}\"]"
end
IssueRelation.find(:all, :include => [:issue_from, :issue_to]).select do |ir|
ir.relation_type == "precedes" && !ir.issue_from.closed? && !ir.issue_to.closed?
end.map do |ir|
f.puts "#{ir.issue_from_id} -> #{ir.issue_to_id}"
end
f.puts "}"
f.flush
IO.popen("dot -Tpng -o /var/www/redmine_graph.png #{f.path}")
f.unlink
end
end</code></pre>You can register it in "lib/tasks/graphviz.rake" and call it with "rake redmine:graphviz".<br />Any opinion about that ?</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85172009-04-06T12:28:52ZMatthew W
<ul></ul><p>Jean-Baptiste Barth wrote:</p>
<blockquote>
<p>Here is a complete ruby/rake solution :<br />[...]You can register it in "lib/tasks/graphviz.rake" and call it with "rake redmine:graphviz".<br />Any opinion about that ?</p>
</blockquote>
<p>Nice, yeah that looks a lot cleaner than my shell script.</p>
<p>A couple of gotchas in that script are: it's doing some really crude word-wrapping on issue titles:</p>
<p>{{{<br />.gsub(/((?:[^ ]+ ){4})/, "\\1\\n")<br />}}}</p>
<p>because I couldn't figure out how to make graphviz do this - but maybe there's a better way. Also the label needs escaping for graphviz incase it contains a closing quote.</p>
<p>Imagine you might wanna customize where it puts the .png output too.</p>
<p>Cheers for tidying this up though, glad it's of use!</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85192009-04-06T12:40:53ZMatthew W
<ul></ul><p>Re dependencies, I don't think it'd hurt to have a rake task in there with a runtime dependency on graphviz - it could warn people when run if graphviz isn't installed, but wouldn't affect the smooth running of anything else.</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85212009-04-06T14:21:35ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Here is a quick conversion to a controller that can be used inside a plugin:</p>
<pre>
class GraphvizController < ApplicationController
unloadable
def graph
f = ""
f << "digraph redmine {\n"
Issue.find(:all).select do |i|
!i.closed?
end.map do |i|
f << "#{i.id} [label=\"#{i.id}: #{i.subject.chomp.gsub(/((?:[^ ]+ ){4})/, "\\1\\n")}\"]\n"
end
IssueRelation.find(:all, :include => [:issue_from, :issue_to]).select do |ir|
ir.relation_type == "precedes" && !ir.issue_from.closed? && !ir.issue_to.closed?
end.map do |ir|
f << "#{ir.issue_from_id} -> #{ir.issue_to_id}\n"
end
f << "}\n"
png = nil
IO.popen("dot -Tpng", "r+") do |io|
io.binmode
io.write f
io.close_write
png = io.read
end
send_data png, :type => 'image/png', :filename => 'graph.png', :disposition => 'inline'
end
end
</pre>
<p>No file is written on disk.<br />I just converted the script but some optimizations can be done when retrieving issues...</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=85262009-04-06T16:09:20ZJean-Baptiste Barth
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Here is a quick conversion to a controller that can be used inside a plugin:</p>
<p>[...]</p>
<p>No file is written on disk.<br />I just converted the script but some optimizations can be done when retrieving issues...</p>
</blockquote>
<p>Thanks ! Actually I was wondering how to do that without a Tempfile, it's a perfect example...<br />And indeed, I didn't try to optimize it, it was just to show how it could be integrated to a rake task or something else in the app.</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=191262010-08-08T16:29:38ZNorbert Melzer
<ul></ul><p>Is there already a plugin the code from Jean-Philippe Lang?<br />I use redmine to keep track over non ruby (on rails) projects, so I really dont know how to really do anything ruby related.</p>
<p>Really cool would be if I could set different filters, and if closed issues that are blocking ore preceeding other issues would be shown also, perfectly in another color. Different arrow-types for blocking, duplicate, preceeding would be awesome too :D</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=223722010-11-13T13:09:52ZHauke Heibel
<ul></ul><p>Since we cannot vote on features (at least not that I am aware of), I am writing this post to state that I would love to see the Graphiviz feature too!</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=243242011-01-21T13:58:00ZSascha Herrmann
<ul></ul><p>+1</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=381042012-05-12T08:06:47ZTerence Mill
<ul></ul><p>You could use <a href="http://www.ndl.kiev.ua/content/redmine-wiki-external-filter-plugin" class="external">redmine-wiki-external-filter-plugin</a> to integrate this external program call when writing a <macro>show_issue_graph</macro> on a wiki seite where this png file will be embedded instead.</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=425512012-10-31T01:51:00ZMatt Palmer
<ul></ul><p>I've just created a plugin based on the controller code Jean-Philippe posted in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Export feature(to csv/pdf) doesn't work (in Japanese) (Closed)" href="https://www.redmine.org/issues/9">#9</a>. It's available on Github at <a class="external" href="https://github.com/mpalmer/redmine_issue_dependency_graph">https://github.com/mpalmer/redmine_issue_dependency_graph</a>. At the moment it only does a graph of issues in a particular version, but I might go nuts one day and write a full "show me all issues related to this one" tree graph.</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=455962013-02-12T22:45:47ZTerence Mill
<ul></ul><p>related:</p>
<p><a href="http://www.redmine.org/issues/12647" class="external">issue relations network view</a><br /><a href="http://www.redmine.org/issues/559" class="external">Workflow Enhancements -Part2</a></p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=583162014-08-27T15:14:55ZSantiago Pérez
<ul></ul><p>Matt Palmer wrote:</p>
<blockquote>
<p>I've just created a plugin based on the controller code Jean-Philippe posted in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Export feature(to csv/pdf) doesn't work (in Japanese) (Closed)" href="https://www.redmine.org/issues/9">#9</a>. It's available on Github at <a class="external" href="https://github.com/mpalmer/redmine_issue_dependency_graph">https://github.com/mpalmer/redmine_issue_dependency_graph</a>. At the moment it only does a graph of issues in a particular version, but I might go nuts one day and write a full "show me all issues related to this one" tree graph.</p>
</blockquote>
<p>Hi Matt,</p>
<p>I tried to install your plugin with the actual redmine (2.5.2) with no success (I have no error on terminal when installing, but nothing appears on the plugin administrator tab on redmine). Have you tried to install it in new redmine versions?</p>
<p>Your plugin is the only one I have found that graph the dependencies between the issues, really valuable. Is there another one now around?.</p>
<p>Thanks in advance,</p>
<p>Santiago</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=596602014-11-08T08:31:03ZLaurent Dairaine
<ul></ul><p>+1</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=615642015-02-17T12:51:43ZDawid Grzegorczyk
<ul></ul><p>Hi,<br />I successfully migrated this plugin to Redmine 2.3.1. My pull request is available here: <a class="external" href="https://github.com/mpalmer/redmine_issue_dependency_graph/pull/2">https://github.com/mpalmer/redmine_issue_dependency_graph/pull/2</a><br />Best of whishes,<br />Zły Kapitan</p> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=658242015-09-07T04:25:55ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/12647">Feature #12647</a>: issue relations network view</i> added</li></ul> Redmine - Feature #2448: Graphviz of ticket dependencies (with example)https://www.redmine.org/issues/2448?journal_id=747952016-11-30T13:00:48ZKamran Soomro
<ul></ul><p>Hi Matt,</p>
<p>I was wondering if your plugin has been updated for the latest version of Redmine. If so, could you please send it to me?</p>
<p>Matt Palmer wrote:</p>
<blockquote>
<p>I've just created a plugin based on the controller code Jean-Philippe posted in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Export feature(to csv/pdf) doesn't work (in Japanese) (Closed)" href="https://www.redmine.org/issues/9">#9</a>. It's available on Github at <a class="external" href="https://github.com/mpalmer/redmine_issue_dependency_graph">https://github.com/mpalmer/redmine_issue_dependency_graph</a>. At the moment it only does a graph of issues in a particular version, but I might go nuts one day and write a full "show me all issues related to this one" tree graph.</p>
</blockquote>