BugNET

Open source issue tracking & project management

Forums

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsOther Extension...Other Extension...VCS integration in general and Bazaar specificallyVCS integration in general and Bazaar specifically
Previous
 
Next
New Post
6/7/2010 7:59 AM
 
If there's a BugNet webservice (I'll go and look at it in a minute) then that's perfect.

I can, I assume, push data into BugNet using that service. So what I'd be doing is "calling" the service with some parameters like: defect ID, and some text (which will probably be a list of files which I'm committing to Bazaar). So when files are changed and committed, the BugNet ticket will automatically log which files were changed for each defect. I think that's what I want.

So I only have to write code at the Bazaar end, to tickle the correct Web Service in the appropriate way. Bazaar is Python, but I'm sure that's sortable. Jolly good, that's better than having to write something at each end.
 
New Post
6/7/2010 8:43 AM
 
The webservices in BugNET are far from complete. Have a look around in that section and see what you will need, which is not there. Let us know what you think and we talk further. There is, unfortunately, pretty little.

As far as constructing the correct request from python is concerned, I am sure thats a breeze. You can already perform most postback functions with POST queries from something else. I know cause I fuzzed (see pentest) parts of the code to test for exploits and vunrabilities.

Follow me on twitter: @stewartmoss http://www.twitter.com/stewartmoss
Follow BugNETProject on twitter: @bugnetproject http://www.twitter.com/bugnetproject
 
New Post
6/7/2010 9:45 AM
 
Yup, the Bazaar end is straight forward. Broadly, it will "ping" a URL out of the box, with just this in bazaar.conf:
bugtracker_ha_url = http://www.my_website.co.uk/BugNet/Issues/IssueDetail.aspx?id={id}
But that's not how BugNet expects to be told to mark something as "fixed"; it's insecure; and because it's zero-programming effort, I can't enhance it directly with the additional data I'd like (a file list and a comment).

So I need a Bazaar plugin. It is simple to write one of those and hook it into (say) the post commit event. I have that running; just need to work out how to get a list of changed files and a comment line in my test hook and I'm half way there.


But then looking at the BugNet web services, the only likely one is:
CreateNewIssueRevision (int revision, int issueId, string repository, string revisionAuthor, string revisionDate, string revisionMessage)
I will poke that and see what it does. I don't have it running on a local server so I'll need to write some code (authorize, then call it). Whilst writing web services code in c# is easy, it may take me a little longer to figure it out in Python.


I think you're saying that I may be better off simulating a POST in order to stuff my data into Bugnet. I could look at the standard BugNet post details, and then make the Bazaar plugin generate the same thing. However then I have an authentication problem.
 
New Post
6/8/2010 7:01 AM
 
I found this example of how to call a .net webservice using python that may help.  http://www.beardygeek.com/2009/01/how...

Davin Dubeau

follow us on twitter facebook users group google plus
 
New Post
6/9/2010 9:07 AM
 
If you put a .py file with this in it into the ~/.bazaar/plugins/ directory then the Python prints a list of changed files out when you make a commit to Bazaar.
This is already done by Bazaar of course... step 2 is to make it poke that list into a web service... I'll look at that reference which I also found.
from bzrlib import (branch,errors,lazy_import,)
__version__ = '0.0.1'
version_info = 0,1,0
def pre_commit_hook(local, master, old_revno, old_revid, future_revno, future_revid, tree_delta, future_tree):
"""This hook executes pre-commit."""

# For all added files...
for path, file_id, kind in tree_delta.added:
print "Added " +path

# For all files with modifications...
for path, file_id, kind, text_modified, meta_modified in tree_delta.modified:
if not text_modified:
continue
print "Modified " +path

# For all renamed files
for (oldpath, newpath, file_id, kind,text_modified, meta_modified) in tree_delta.renamed:
if not text_modified:
continue
print "Renamed " +newpath

branch.Branch.hooks.install_named_hook('pre_commit', pre_commit_hook, '***Custom pre_commit hook')
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsOther Extension...Other Extension...VCS integration in general and Bazaar specificallyVCS integration in general and Bazaar specifically


Forum Policy

These Discussion Forums are dedicated to the discussion of the BugNET issue tracker.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:
1. No Advertising.
2. No Flaming or Trolling.
3. No Profanity, Racism, or Prejudice.
4. Site Moderators have the final word on approving/removing a thread or post or comment.
5. English language posting only, please.