Implement a link between changesets and bugs

stodge - June 16, 2009 - 12:03
Project:Version Control API
Version:6.x-1.0-rc2
Component:Commit Log
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:Newbie
Description

As far as I'm aware, there's no direct link between a changeset and a bug/ticket. A critical feature IMO is providing such a link. I realise this could be raised against the versioncontrol_svn module as well but I thought I would start here.

This feature would facilitate implementing code reviews e.g.

#1

jpetso - June 16, 2009 - 14:19
Project:Version Control / Project Node integration» Version Control API
Version:6.x-1.0-beta2» 6.x-1.0-rc2
Component:Code» Commit Log

How do you imagine a "direct link", and what should a preliminary user interface for this feature provide? Version Control API itself offers the repository link for issue/case/bug trackers which you can enter in the repository edit form, if such a link template is present then Commit Log will link Drupal-style issue numbers ("#12345 by jpetso: blah blah") to their corresponding issue URLs.

There's no database table capturing such relations though (so backlinks from the issue are not currently possible), and the issue number format in the commit message is also not extensible. I will gladly accept patches that change these shortcomings.

Oh, and I think the main API module is appropriate as target for this feature request; after all, commit<->issue relations are one of the primary use cases.

#2

stodge - June 16, 2009 - 14:48

I just started reading through the version control code so I'm not familiar with it yet; I'm just thinking at a higher level to incorporate existing functionality we have at work with Team Foundation Server and Trac.

So as a high level example, say we have a content type ChangesetOperation in the database that contains details of a single commit operation (update/add etc). The ChangesetOperation would have a field called ticket_id, which is extracted from the commit message. E.g. the commit message is:

refs #100

The changeset operation's ticket_id would be set to 100. Then when you view ticket 100, you can see a list of all changesets (basic details to save space). Exactly as you do in ClearQuest/ClearCase and Team Foundation Server.

Hopefully that makes sense. I'm only working at a high abstract level as I'm not familiar enough with version control modules to relate it to their data. I'm trying to find a screenshot to help but I haven't found anything useful yet.

Thanks

#3

stodge - June 16, 2009 - 14:59

The nearest I could find in a hurry is this Redmine page:

http://www.redmine.org/issues/3279

Note that the "Associated revisions" are shown when viewing the ticket.

#4

jpetso - June 16, 2009 - 15:34

Right, that's approximately what I expected. Valid request, although instead of a content type we might just have a table relating two values, the version control operation (a.k.a. vc_op_id) and the issue (a.k.a. nid). Then provide a block that appears in issue nodes and links to the operation URL returned by versioncontrol_get_url_commit_view(). Also provide a setting that the admin can customize for the regular expression in the commit message in order to correctly retrieve the issue id.

This functionality can and should be implemented as an extension module, and is probably pretty easy to implement, using hook_versioncontrol_operation() with the regular expression determining the issue id from $operation['message']. Still takes some work, of course, but all the infrastructure is there and the requirements are straightforward. I'm tagging it with the "Newbie" tag because this one seems like an ideal way to get familar with Version Control API.

#5

stodge - June 16, 2009 - 15:53

I don't claim to yet understand most of what you wrote, but I think it makes sense. :)

 
 

Drupal is a registered trademark of Dries Buytaert.