Saif Khan

{ I am Saif } "Knowledge is power, information is free, share it!"
posts - 24, comments - 111, trackbacks - 0

My Links

News

Archives

.NET

Hardware

Networking

Sunday, May 02, 2010

Getting codebaseHQ SVN ChangeLog data in your application

I deploy apps via ClickOnce. After each deployment we have to review the changes made and send out an email to the users with the changes. What I decided now to do is to use CodebaseHQ’s API to access a project’s SVN repository and display the commit notes so some users who download new updates can check what was changed or updated in an app. This saves a heck of a lot of time, especially when your apps are in beta and you are making several changes daily based on feedback.
You can read up on their API here
Here is a sample on how to access the Repositories API from a windows app
Public Sub GetLog()
        If String.IsNullOrEmpty(_url) Then Exit Sub
        Dim answer As String = String.Empty
        Dim myReq As HttpWebRequest = WebRequest.Create(_url)
        With myReq

            .Headers.Add("Authorization", String.Format("Basic {0}", Convert.ToBase64String(Encoding.ASCII.GetBytes("username:password"))))
            .ContentType = "application/xml"
            .Accept = "application/xml"
            .Method = "POST"
        End With

        Try

            Using response As HttpWebResponse = myReq.GetResponse()

                Using sr As New System.IO.StreamReader(response.GetResponseStream())
                    answer = sr.ReadToEnd()
                    Dim doc As XDocument = XDocument.Parse(answer)
                    Dim commits = From commit In doc.Descendants("commit") _
                                  Select Message = commit.Element("message").Value, _
                                                AuthorName = commit.Element("author-name").Value, _
                                                AuthoredDate = DateTime.Parse(commit.Element("authored-at").Value).Date
                    grdLogData.BeginUpdate()
                    grdLogData.DataSource = commits.ToList()
                    grdLogData.EndUpdate()

                End Using
            End Using

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

 

Originally I was using myReq.Credentials = New NetworkCredential("username", "password") and then it stopped working after a few weeks. It looks like CodebaseHQ change their API access to Basic authorization.

The _url variable is basically the path to your repository e.g. https://mycompany.codebasehq.com/projectname/repositoryname/commits/head. You can find more information on the API here

Here is a list of available properties from the commits

<commit>
     <ref>40320d0d4f85fa7294a71e2d5291b8660f60c01f</ref>
     <message>add dev &amp; staging to reserved domains</message>
     <author-name>Adam Cooke</author-name>
     <author-email>adam@atechmedia.com</author-email>
     <authored-at type="datetime">2009-10-12T17:49:25+01:00</authored-at>
     <committer-name>Adam Cooke</committer-name>
     <committer-email>adam@atechmedia.com</committer-email>
     <committed-at type="datetime">2009-10-12T17:49:46+01:00</committed-at>
     <parent-refs>48fe6489f9b68777aa36f1a6009b3039d4a7c234</parent-refs>
     <tree-ref>78ce1e531939b1c4e10820f8e1c293339208d3ee</tree-ref>
     <author-user>adam</author-user>
     <committer-user>adam</committer-user>
 </commit>
 

 EDIT:

Here is what my change-log screen lools like in my app

4-3-2011 1-34-03 AM

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, May 02, 2010 5:48 PM | Feedback (2) |

Repository and Ticket management in a Windows Environment

I’ve been using AxoSoft’s bug tracking application for a while, although and excellent piece of software I had some issues with it
·         It was SLOOOW (both desktop and web). I don’t care what Axosoft says, I tired multiple servers etc. I’ve been long enough in this field to tell you when something is not right with an app.
·         The cost! It’s not feasible for a small team.
 
I must say though, that they have some nice features which are not commonly found on other bug tracking software. I wouldn’t go on to list any here. I would prefer you download and try their app and see for yourself.
In my quest to find a replacement, I tried a few. The successor had to satisfy the following
·         A 99.99% Windows Environment.
·         Bug Tracking.
·         Ticket Management (power users and project managers can open tickets on projects).
·         Repository (I decided to merge bug tracking and repository to get my team to be more productive).
·         Unlimited users.
·         Cost.
Being the head of IT security for the firm I work for, making the decision to move data offsite was a hard decision to make, but turned out to be one I am not regretting so far.
My choice was down to Altassian JIRA and codebaseHQ. I ended up going with the latter… (I still love the greenhopper from Altassian…its freaking cool!)
5-3-2010 1-01-22 AM
CodebaseHQ is nice and simple and has all the features I needed. I’ve been using them for a few months now and very happy. Their pricing…well, see for yourself. I was also able to get our SVN data… (Yes, SVN! I don’t go near the Visual Sourcesafe thing…it’s not that safe (pardon the pun). I am hearing some nice things about TFS 2010) over to codebaseHQ. We use VisualSVN to access repositories.
…so if you are a Windows developer (or team) codebaseHQ is worth checking out!

Edit ~ Special mention

I also tried FugBugz from frogcreek.com. It's also an excellent piece of software but at the time didn't fit my enviornment. Joel and his team are smart people and deserved mentioning.

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, May 02, 2010 5:06 PM | Feedback (0) |

Powered by: