https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292009-04-06T08:07:21ZRedmineRedmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=85052009-04-06T08:07:21ZMohan Varma
<ul></ul><p>+1</p>
<p>We are having the same issue.</p>
<p>Regards,<br />Mohan.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=91232009-05-10T23:29:51ZLincoln Stoll
<ul></ul><p>Isn't this the same as issue <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Repository commits in subprojects won't reference tickets in parent projects (Closed)" href="https://www.redmine.org/issues/2255">#2255</a> , and possibly implemented by the patch in <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Allow commit messages to refer to issues in project ancestor tree, not just project (Closed)" href="https://www.redmine.org/issues/2256">#2256</a>?</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=91242009-05-11T00:02:51ZLincoln Stoll
<ul><li><strong>File</strong> <a href="/attachments/2000">commit_update_parent_project.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/2000/commit_update_parent_project.patch">commit_update_parent_project.patch</a> added</li></ul><p>This is a combination of the patch in <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Allow commit messages to refer to issues in project ancestor tree, not just project (Closed)" href="https://www.redmine.org/issues/2256">#2256</a> and an update to the issue page to make it link to the correct project in the associated revisions.</p>
<p>This should fix this issue - it allows you to commit to a subprojects repository, and update the parent project.</p>
<p>The patch is against rev 2731 (0.8.3)</p>
<p>Does anything else need to be done to make this visible and get it accepted?</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=91402009-05-12T00:46:21ZLincoln Stoll
<ul></ul><p>Note - you will need to have the repository module enabled in the master project (even if it doesn't have a repository) to get the associated revisions details in the issue</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=91412009-05-12T02:24:42ZZarooba Rozruba
<ul></ul><p>The patch to the file app/views/issues/_changesets.rhtml should be accepted no matter what, after all, the db schema allows for linking repository changesets across projects.</p>
<p>I am testing the changes to app/models/changeset.rb .</p>
<p>This sounds amazingly promising. I will keep you up to date.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=93772009-05-19T17:11:38ZZarooba Rozruba
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>30</i></li></ul><p>Jean-Philippe Lang committed part of the fix through ticket <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Moving an issue to another project copies the associations revisions instead of updating them (Closed)" href="https://www.redmine.org/issues/3376">#3376</a></p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=93962009-05-19T20:59:14ZBob Roberts
<ul></ul><p>Zarooba Rozruba wrote:</p>
<blockquote>
<p>Jean-Philippe Lang committed part of the fix through ticket <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Moving an issue to another project copies the associations revisions instead of updating them (Closed)" href="https://www.redmine.org/issues/3376">#3376</a></p>
</blockquote>
<p>I've applied the attached patch and amended line no.83 in changeset.rb so that any revisions that contain issue IDs for sibling projects are also properly linked in those projects. This has been working great for us for a while now. The recent commit above also fixes the case where tickets are moved between projects and ensure the revision association is always correct.</p>
<pre><code>project_list = [repository.project.self_and_siblings] + repository.project.ancestors</code></pre>
<p>The use case for us was simple, we have a master project with 10 sub projects and some issues are fixed that affect say 3 projects in one go so are committed together in one revision. In this case it would be useful to retain the revision association for all issues across these projects (they all have have the same root repository path anyway)</p>
<p>To get this patch committed into trunk, would it be sensible to add some config options per project under the repository module that can define the expected behaviour of this? i.e. Revisions committed against this project that reference tickets in [self],[self + siblings], [self + all ancestors, self and parent] are allowed?</p>
<p>As a setup note, for any parent/ancestor projects, make sure you have enable the repository module to allow revision linking to work correctly across projects (you do not have to configure it)</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=108162009-09-03T18:31:26ZWilliam Baum
<ul></ul><p>This is awesome, but I took it further with a simple change..</p>
<p>The ability to associate issues from ancestor projects is a start, but I found it still way too limiting. We have different repositories by the type of stuff (database objects vs. visual studio projects, requirements documents, etc.) Issues need to be associated with all of those.. So why limit it at all?</p>
<pre>
#project_list = [repository.project] + repository.project.ancestors
project_list = Project.find(:all)
</pre>
<p>This allows any change in any repository to be associated with any issue. If the user doesn't have access to the other repository, they get an error message.. perfect. Furthermore, you can create dummy projects just to hold repositories and now you can have as many repositories as you want..</p>
<p>I have this running in redmine 0.8.4 as well as a recent trunk, and it's working great!</p>
<p>My experience with ruby is extremely limited, so if there's a better syntax or something, please let me know.</p>
<p>--Bill</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=108702009-09-08T22:13:02ZRoman Musin
<ul></ul><p>+1</p>
<p>It is real need.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=129372009-12-14T12:13:53ZThomas Pihl
<ul></ul><p>+1</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=129982009-12-16T11:53:30ZMarkus Meier
<ul></ul><p>+1</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=132282009-12-24T11:39:33ZLalit Roul
<ul></ul><p>make it +1 from me too..</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=132292009-12-24T11:46:58ZLalit Roul
<ul></ul><p>forgot to mention an important thing if it can be considered, our requirement is not strictly a parent-child requirement, so we have kept project all at top level. But would still like to have a cross project issue-revision relation.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=154022010-03-24T10:23:51ZGeordee Naliyath
<ul></ul><p>I need this too. We have different subprojects created for different modules and there is a user acceptance testing subproject. The commits in the module-specific subproject is not linked to an issue in user acceptance testing subproject. I usually hold myself back from applying patches. Hope to get this issue resolved in the trunk sometime soon.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=154122010-03-24T15:12:57ZWilliam Baum
<ul><li><strong>File</strong> <a href="/attachments/3447">100324-cross-project-revisions.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3447/100324-cross-project-revisions.patch">100324-cross-project-revisions.patch</a> added</li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>30</i> to <i>80</i></li></ul><p>I too would like to see this in the trunk, perhaps controlled by an "Allow cross-project revisions" admin setting.</p>
<p>In recent versions, this has become even easier to achieve, as the trunk allows revisions to refer to different projects in the same tree. It does this be checking all of the referenced issues in the revision to see if they refer to the current project or its ancestors or descendants in <code>app/models/changeset.rb</code>: <br /><pre>
# Finds issues that can be referenced by the commit message
# i.e. issues that belong to the repository project, a subproject or a parent project
def find_referenced_issues_by_id(ids)
return [] if ids.compact.empty?
Issue.find_all_by_id(ids, :include => :project).select {|issue|
project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project)
}
end
</pre></p>
<p>To get cross-project revisions, we just need to skip those checks:<br /><pre>
# Finds issues that can be referenced by the commit message
# i.e. issues that belong to the repository project, a subproject or a parent project
def find_referenced_issues_by_id(ids)
return [] if ids.compact.empty?
Issue.find_all_by_id(ids, :include => :project).select {|issue|
project == project
###project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project)
}
end
</pre></p>
<p>I'm attaching an svn formatted patch against <a class="changeset" title="Cleans up status assignment in IssuesController#new handled by Issue#safe_attributes= now." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3606">r3606</a>, which is still current, as changset.rb is currently at <a class="changeset" title="Avoid unnecessary SQL queries when loading changesets." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3473">r3473</a>. While patches are cumbersome to maintain, this one's really a one-liner in one file.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=174962010-06-19T21:45:39ZFelix Schäfer
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>As far as I can tell, something similar (or that exactly) exists in currrent trunk, probably 0.9-stable too, closing this issue.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=175872010-06-21T14:03:48ZWilliam Baum
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>This is still valid, as the trunk allows revisions only to issues in related projects (parents, children). This change allows revisions in any repository to be associated with an issue in any project.</p>
<p>This is an essential part of the way we use Redmine in our organization, and I personally see no benefit in preventing revisions from being associated with issues, but perhaps this should be controlled by a permission setting?</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=227222010-11-26T11:35:48ZJohn Bart
<ul></ul><p>+1 here. It could be controlled by the existing admin setting to allow cross project issue linkage. If you need that, chances are more than well that you'd require this patch here as well. Would be great to see such a change in the trunk.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=260052011-03-07T06:07:15ZBob Bottle
<ul></ul><p>+1 to William Baum's comment 17. Would be good if issues were related to any project in redmine, not just parent/child projects.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=260082011-03-07T06:26:21ZToshi MARUYAMA
<ul><li><strong>Category</strong> changed from <i>Issues</i> to <i>SCM</i></li></ul> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=309322011-07-21T05:10:31ZMartin Denizet (redmine.org team member)martin.denizet@supinfo.com
<ul></ul><p>Felix Schäfer wrote:</p>
<blockquote>
<p>As far as I can tell, something similar (or that exactly) exists in currrent trunk, probably 0.9-stable too, closing this issue.</p>
</blockquote>
<p>I tested in 1.2.0, using commit messages, you can indeed create references to issues in ancestor or descendant project. However the ancestor or descendant project <strong>must</strong> have repository configured.<br />I don't see the reason for it to be this way.</p>
<p>In my organization, we have a project with a repository for the product development and sub-projects for customers implementations (With Gantt for deployment planning and specific issues). We are not able yet to link revisions to customers issues.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=309842011-07-22T08:31:01ZArtur Wasilewski
<ul></ul><p>+1</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=319942011-09-05T01:34:23ZDavid Chiew
<ul></ul><p>+1 please!</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=349682011-12-21T19:08:15ZWilliam Baum
<ul></ul><p>My apologies, I intended to update this months ago..</p>
<p>In app/models/changeset.rb you'll find:<br /><pre>
def find_referenced_issue_by_id(id)
return nil if id.blank?
issue = Issue.find_by_id(id.to_i, :include => :project)
if issue
unless issue.project &&
(project == issue.project || project.is_ancestor_of?(issue.project) ||
project.is_descendant_of?(issue.project))
issue = nil
end
end
issue
end
</pre></p>
<p>It's that <code>unless</code> business that's preventing the links unless the projects are related.</p>
<p>Just comment out that whole if block or the change the <code>unless</code> to:<br /><pre>
unless project == project
</pre></p>
<p>This will enable changesets in any repository to reference issues in any project.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=353952012-01-16T20:35:28ZWilliam Roush
<ul></ul><p>+1, should be in trunk, commits from other projects may influence related projects.</p> Redmine - Defect #3087: Revision referring to issues across all projectshttps://www.redmine.org/issues/3087?journal_id=357472012-02-02T18:10:13ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Revision referring to issues across projects</i> to <i>Revision referring to issues across all projects</i></li><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Target version</strong> set to <i>1.4.0</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul>This is now fixed:
<ul>
<li>related changesets are displayed on the issue even if the repository module is disabled on the issue's project (<a class="changeset" title="Fixed: associated changesets from other projects are not visible if the current project doesn't h..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/8749">r8749</a>)</li>
<li>a new setting is added in <a class="changeset" title="Adds a setting that allows to reference/fix issues of all projects (#3087)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/8750">r8750</a> to allow issues from any project to be referenced/fixed (by default, only issues of parent and subprojects can be referenced/fixed)</li>
</ul>