How can I integrate a bitbucket repository with the hosted on-demand version of FogBugz?
Asked Answered
C

4

9

I use the on-demand (hosted) version of FogBugz. I would like to start using Mercurial for source control. I would like to integrate FogBugz and a BitBucket repository. I gave it a bit of a try but things weren't going very well.

FogBugz requires that you hook up your Mercurial client to a fogbugz.py python script. TortoiseHg doesn't seem to have the hgext directory that they refer to in instructions.

So has anyone successfully done something similar?

Chestonchest answered 23/9, 2008 at 14:51 Comment(4)
Sorry I'm not able to offer any help, but I would suggest rephrasing your question. You're actually asking a yes/no question when you want to know how somebody managed to do it. I suggest: "How do you integrate a bitbucket repository with the hosted FogBugz On-Demand?"Spate
What are all those fogbug questions doing on stackoverflow? Why can you not email support and ask. You are paying them money to host the software (at least I am assuming this), so get some help.Reefer
@Reefer - for others, in order not to have to call support and waste one's time. It saved me some, more than two years after :)Renown
Of course this can be helpful, but I'm just saying that since you spend money with them, you should use their support as well. ;-)Reefer
E
6

From the sounds of it you are wanting to run the hook on your local machine. The hook and directions are intended for use on the central server.

If you are the only one working in your repository or don't mind commit not showing up in FB until after you do a pull, then you can add the hook locally to your primary clone, If you are using your primary clone then you need to do something slightly different from what they say here: http://bugs.movabletype.org/help/topics/sourcecontrol/setup/Mercurial.html

You can put your fogbugz.py anywhere you want, just add a path line to your [fogbugz] section of that repositories hgrc file:

[fogbugz]
path=C:\Program Files\TortoiseHg\scripts\fogbugz.py

Just make sure you have python installed. you may also wish to add a commit hook so that local commits to the repository also get into FB.

[hooks]
commit=python:hgext.fogbugz.hook
incoming=python:hgext.fogbugz.hook

On the Fogbugz install you will want change put the following in your for your logs url:

^REPO/log/^R2/^FILE

and the following for your diff url:

^REPO/diff/^R2/^FILE

When the hook script runs it connects to your FB install and sends it a few parameters. These parameters are stored in the DB and used to generate urls for diffs and log informaiton. The script sends the url of repo, this is in your baseurl setting in the [web] section. You want this url to be the url to your bitbucket repository. This will be used to replace ^REPO from the url templates above. The hook script also passes the revision id and the file name to FB. These will replace ^R2 and ^FILE. So in summary this is the stuff you want to add to the hgrc file in your .hg directory:

[extensions]
hgext.fogbugz=

[fogbugz]
path=C:\Program Files\TortoiseHg\scripts\fogbugz.py
host=https://<YOURACCOUNT>.fogbugz.com/
script=cvsSubmit.asp

[hooks]
commit=python:hgext.fogbugz.hook
incoming=python:hgext.fogbugz.hook

[web]
baseurl=http://www.bitbucket.org/<YOURBITBUCKETACCOUNT>/<YOURPROJECT>/

One thing to remember is that FB may get notified of a checkin before you actually push those changes to bitbucket. If this is the cause do a push and things will work.

EDIT: added section about the FB server and the summary.

Estis answered 23/9, 2008 at 19:43 Comment(1)
thanks for you answer... can you tell me anything about the script parameter that is supposed to go in the [fogbugz] section... since i'm not hosting fogbugz, how does that work?Chestonchest
C
15

Post-mortem:

Bitbucket now has native fogbugz support, as well as other post-back services.

http://www.bitbucket.org/help/service-integration/

Creek answered 4/11, 2008 at 14:28 Comment(2)
cool, thanks for info... now i just have to figure out how to get that to workChestonchest
does this mean we still follow the steps in fogbugz.stackexchange.com/questions/4433/mercurial-integration?Courtship
E
6

From the sounds of it you are wanting to run the hook on your local machine. The hook and directions are intended for use on the central server.

If you are the only one working in your repository or don't mind commit not showing up in FB until after you do a pull, then you can add the hook locally to your primary clone, If you are using your primary clone then you need to do something slightly different from what they say here: http://bugs.movabletype.org/help/topics/sourcecontrol/setup/Mercurial.html

You can put your fogbugz.py anywhere you want, just add a path line to your [fogbugz] section of that repositories hgrc file:

[fogbugz]
path=C:\Program Files\TortoiseHg\scripts\fogbugz.py

Just make sure you have python installed. you may also wish to add a commit hook so that local commits to the repository also get into FB.

[hooks]
commit=python:hgext.fogbugz.hook
incoming=python:hgext.fogbugz.hook

On the Fogbugz install you will want change put the following in your for your logs url:

^REPO/log/^R2/^FILE

and the following for your diff url:

^REPO/diff/^R2/^FILE

When the hook script runs it connects to your FB install and sends it a few parameters. These parameters are stored in the DB and used to generate urls for diffs and log informaiton. The script sends the url of repo, this is in your baseurl setting in the [web] section. You want this url to be the url to your bitbucket repository. This will be used to replace ^REPO from the url templates above. The hook script also passes the revision id and the file name to FB. These will replace ^R2 and ^FILE. So in summary this is the stuff you want to add to the hgrc file in your .hg directory:

[extensions]
hgext.fogbugz=

[fogbugz]
path=C:\Program Files\TortoiseHg\scripts\fogbugz.py
host=https://<YOURACCOUNT>.fogbugz.com/
script=cvsSubmit.asp

[hooks]
commit=python:hgext.fogbugz.hook
incoming=python:hgext.fogbugz.hook

[web]
baseurl=http://www.bitbucket.org/<YOURBITBUCKETACCOUNT>/<YOURPROJECT>/

One thing to remember is that FB may get notified of a checkin before you actually push those changes to bitbucket. If this is the cause do a push and things will work.

EDIT: added section about the FB server and the summary.

Estis answered 23/9, 2008 at 19:43 Comment(1)
thanks for you answer... can you tell me anything about the script parameter that is supposed to go in the [fogbugz] section... since i'm not hosting fogbugz, how does that work?Chestonchest
R
1

Just a heads-up: Fog Creek has released Kiln which provides Mercurial hosting that's tightly integrated with FogBugz and doesn't require any configuration.

I normally wouldn't "advertise" on Stack Overflow (disclaimer: I'm one of the Kiln devs), but I feel that this directly answers the original question.

Roter answered 22/3, 2010 at 21:28 Comment(0)
S
1

It is possible to integrate your GIT BitBucket repository with FogBugz issue tracker, but unfortunately it is not properly documented.

You have to follow steps described at https://confluence.atlassian.com/display/BITBUCKET/FogBugz+Service+Management, but beware that

  1. In CVSSubmit URL you need to put url WITHOUT "?ixBug=bugID&sFile=file&sPrev=x&sNew=y&ixRepository=" parameters.

    It should just be "https://your_repo.fogbugz.com/cvsSubmit.asp"

  2. You will need to mention your FogBugz case ID in the git commit message by putting "BugzID: ID" string in it (this is not documented anywhere :-( ) similar to this:

    git commit -m "This is a superb commit which solves case BugzID: 42"

Of course, commit info will be sent to FogBugz after you push your commit to BitBucket server, not after your do a local commit.

Speakeasy answered 25/11, 2012 at 22:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.