#8 Scmbug And Test Director Integration

closed-accepted
nobody
None
5
2008-02-22
2007-01-24
rob_webset
No

Hi David, just to follow up on the E-mail, I thought I'd post the diff file (against 1.9.2) here to make sure I don't lose it!

The attached diff file adds support for:

1) Test Director as a Bug Tracking System (http://www.mercury.com/us/products/quality-center/)

2) Support for ScmBug (http://www.mkgnu.net/?q=scmbug) when used with Bugzilla and test Director.

Addition 1:
In order to use the Test Director interface users will need to ensure that you have:
a) The Perl Win32::OLE package installed.
b) The Test Director "Mercury Quality Center System Test Remote Agent Add-in"
(Available from the Test Director Help->Add-ins menu).

Addition 2:
This enables users to input a bug ID and have the code files changed under that ID to be loaded into a Topic. (It makes use of the ScmBug comments that are added to the bug).

One other change I have made is so that if there is no web link to a defect set in the codestriker config file then just the bug ID is displayed without a link on the web pages.

Thanks, Rob

Discussion

  • rob_webset
    rob_webset
    2007-01-24

    Test Director Scmbug diff

     
  • rob_webset
    rob_webset
    2007-04-24

    Logged In: YES
    user_id=1137102
    Originator: YES

    Found a minor tweak which will help the display of the tag in Test Director:

    Once these changed have been implemented the following change can be made to codestriker\lib\Codestriker\BugDB\TestDirectorConnection.pm in the function: "update_bug" add the following line to the beginning:
    $$bug{"BG_DEV_COMMENTS"} .= "\n<HTML><BODY>";

    and the following line to the end of the comment:
    $$bug{"BG_DEV_COMMENTS"} .= "</BODY></HTML>";

    Thanks

    Rob

     
  • rob_webset
    rob_webset
    2007-05-23

    New TestDirectorConnection.pm

     
  • rob_webset
    rob_webset
    2007-05-23

    Logged In: YES
    user_id=1137102
    Originator: YES

    I have been improving a little more. Ignore the previous change for the update_bug function in codestriker\lib\Codestriker\BugDB\TestDirectorConnection.pm instead just replace it with the following version of TestDirectorConnection.pm (Attached).

    Cheers

    Rob

    File Added: TestDirectorConnection.pm

     
  • rob_webset
    rob_webset
    2007-06-25

    Logged In: YES
    user_id=1137102
    Originator: YES

    OK, there is another minor tweak:

    File: Subversion.pm
    Function: sub getDiffFromBugId
    Add:
    $justFileName =~ s/ /%20/g;

    Just after the setting of $justFileName in the for loop.

    Thanks
    Rob

     
  • David Sitsky
    David Sitsky
    2008-01-10

    Logged In: YES
    user_id=208928
    Originator: NO

    Hi Rob,

    Thanks for submitting this. The Test Director stuff is easy to add in, but I have a couple of questions regarding scmbug.

    At a quick glance from your code, it appears when we create a topic, you now have the capability to effectively lookup the specified bug records, go through all the bug comments section, and locate the scmbug comments, and parse out the changelist.

    Is it possible for scmbug to insert more than one changelist to a given bug record? If so, which one will we pick up?

    Also - is it possible somehow to query the scmbug daemon for this information instead? If it is possible, I'd prefer this approach, as it means we don't need to add in support for reading bug comments for every bug tracking system Codestriker supports.

     
  • rob_webset
    rob_webset
    2008-01-10

    Logged In: YES
    user_id=1137102
    Originator: YES

    Hi David,

    Yes it is possible for ScmBug to add multiple comments, for an example see:

    http://bugzilla.mkgnu.net/show_bug.cgi?id=1092

    The code that I have supplied should go through all of the comments and retrieve all of the changes.

    I agree contacting the ScmBug Daemon would be a prefered solution, however this would require either Codestriker and ScmBug running on the same machine or preferable a "bundle" from ScmBug to be provided to Codestriker than can then be called.

    Something like. Install ScmBug, then install codestriker, then copy over a directory from ScmBug into a given location within codestriker and update the codestriker config to enable the feature. (Or maybe an install script to add the ScmBug code)

    May I suggest that maybe we look at integrating the changes with the reading of the Bug currently within the patch so that we get the added functionality and a good grasp of what we require.

    Quite a while ago I discussed with Kristis (the owner of ScmBug) the support for interworking with codestriker and he seems very keen to progress the idea.

    Once we have a working system I'll then try looking at a patch for ScmBug to supply the required interface for codestriker, Kristis is pretty good at reviewing and commenting on these sort of things. Once we have that I'll then look at another patch for codestriker to use the new functionality in ScmBug.

    How does that sound?

    Thanks

    Rob

     
  • David Sitsky
    David Sitsky
    2008-01-11

    Logged In: YES
    user_id=208928
    Originator: NO

    Hi Rob,

    That all sounds good - I'll try to look at integrating your patch this weekend - time permitting. It touches a number of key areas of the system, so I want to do it carefully, but at a quick glance, it looks great.

    Cheers,
    David

     
  • David Sitsky
    David Sitsky
    2008-01-13

    Logged In: YES
    user_id=208928
    Originator: NO

    Hi Rob,

    Ok - I've got TestDirectorConnection checked in with some minor changes, so that it will not break non-Win32 systems, and also I've updated install.pl to check for Win32::OLE.

    The next step will be to look at the scm-bug specific changes - I'll get back to you on this once I have studied your changes in more detail.

     
  • David Sitsky
    David Sitsky
    2008-01-13

    Logged In: YES
    user_id=208928
    Originator: NO

    Hi Rob,

    It would be good if you can look at the current Code from CVS to let me know what you think.

    For the next step, it would be great if you can change the bug tracking connection implementations slightly. If you look at the code for get_bug_file_list() for both Bugzilla and TestDirector, there is a lot of common code there. Ideally, these bug tracking modules shouldn't have to know anything about scm_bug.

    Can I suggest you change this implementation so that bug tracking connections instead implement:

    get_comments($bugid) which returns a list of strings, the actual comments linked to the bug.

    then perhaps ScmBugUtils can take this list, and do the work of parsing out the file changes, so that this code is in a single place.

    Does that sound reasonable? Once we have done this, then we can look at the remaining parts of your changes.

    Incidentally - check out the "noconnection" bug tracking implementation that is in 1.9.4, as this implements some of what you have done already.

    Cheers,
    David

     
  • David Sitsky
    David Sitsky
    2008-01-13

    Logged In: YES
    user_id=208928
    Originator: NO

    Hi Rob,

    Once you have made that changed to the bug tracking modules, the end game here I believe is we create a new Repository module, and call it ScmBug.pm. This should be able to take for now, either a start_tag or an end_tag argument, which is basically a comma-separated list of bug IDs. This module should have a delegate Repository module which at the moment is either Cvs or Subversion, for pulling out the actual file diffs.

    It should then be able to create the diff text for this, by doing what you have implemented already, by first getting the comments for each bug ID from the bug tracker, getting the changelist, then using the delegate Repository object for building up the diff file.

    That way, we don't have to change the create topic page user interface at all, which I think it better, since it is already very complicated. Also - I think the ScmBug functionality is really another instance of a Repository object, or a "diff generator".

    Does that make sense? I'm happy to try and help to fill in the gaps, but my time is a bit limited.

    We can also go to email now if it makes life easier.

    Cheers,
    David

     
  • rob_webset
    rob_webset
    2008-01-29

    No http bug link specified

     
    Attachments
  • rob_webset
    rob_webset
    2008-01-29

    Logged In: YES
    user_id=1137102
    Originator: YES

    Hi David,

    Just going through some of the CVS changes you have done and comparing them with my version. One thing that could be easily re-integrated now which is independant of the ScmBug changes is support for Bug systems that have no http view available for them.

    The patch attached is the CVS Patch diff that tortoisecvs generates. Hope that's OK (the tortoisecvs patch option at lease deals with the CVS directories etc)

    Cheers

    Rob

    File Added: no_bug_link.patch

     
  • rob_webset
    rob_webset
    2008-02-04

    Logged In: YES
    user_id=1137102
    Originator: YES

    Hi David,

    I have attached a patch which will do the integration between Scmbug and codestriker.

    I hope that I haven't missed any of the points that you have raised. The good news about this patch (unlike my original one) is that it is much smaller and a lot more generic. I have tried to re-use as much code as logically possible and better defined the boundaries of what Scmbug and Codestriker do towards providing the data.

    I have used tortoisecvs patch diff again for ease (Let me know if this isn't OK).

    I also believe that in theory this will provide support for all BugDB's and Code repositories without any further changes (Obviously that is limited to the repositories and bug databases that are currently supported by both ScmBug and Codestriker).

    The only configurations that I have tested in are Subversion/TestDirector and I did find a couple of bugs in the Subversion module that I have fixed and included in the diff.

    1) Detection of if it is a file or directory etc was not picking up on files correctly.
    2) Reviewing files that have been deleted as part of the changeset (Generation of diff)

    Hope this is OK

    Rob

    File Added: scmbug_support1.patch

     
  • rob_webset
    rob_webset
    2008-02-04

    Scmbug Integration 1

     
    Attachments
  • rob_webset
    rob_webset
    2008-02-04

    Scmbug reference only code

     
  • rob_webset
    rob_webset
    2008-02-04

    Logged In: YES
    user_id=1137102
    Originator: YES

    Hi David,

    I thought that I'd give you a quick overview of how I've pulled things together.

    I have submitted a patch to Kritis (Scmbug owner)

    http://bugzilla.mkgnu.net/show_bug.cgi?id=1097

    Which adds support for retrieving a "change set" which details all the files changed and the versions changed from and to. I have also written an mini installer which a user would run, all this does is bundle up all the Scmbug files required to call the Scmbug Daemon and get the list of changes. The user can have this directory created anywhere they wish (although I would suggest the Codestriker/lib directory).

    The codestriker code is then able to just load this package and make calls to Scmbug as required, this should help isolate any Scmbug changes from codestriker.

    I have attached a zip file of the files that the installer will generate. This is for your reference only while you look over the patch and will not be required to be distributed with codestriker. (Scmbug will distribute these).

    Hope this is OK

    Rob

    File Added: Codestriker_Scmbug_library.zip

     
  • rob_webset
    rob_webset
    2008-02-21

    Logged In: YES
    user_id=1137102
    Originator: YES

    Patch for further changes as per CVS repo 3pm 21st Feb 2008

    File Added: scmbug_support2.patch

     
  • rob_webset
    rob_webset
    2008-02-21

    Logged In: YES
    user_id=1137102
    Originator: YES

    Patch for further changes as per CVS repo 3pm 21st Feb 2008

    The right one this time.

    File Added: scmbug_support3.patch

     
  • rob_webset
    rob_webset
    2008-02-21

    Scmbug Integration 3

     
    Attachments
  • David Sitsky
    David Sitsky
    2008-02-22

    • status: open --> closed-accepted