tcWebHooks alpha release available – Now much better!

Posted on Updated on

It’s been a long time coming, but I finally got a chance to work on the tcWebHooks plugin for TeamCity.

I have an alpha release on sourceforge for download here:

The main features are:

  • buildStatusDelta information (broken, fixed, success, failure)
  • being able to trigger webhooks based on deltas (on completion).
  • buildStatusHtml field which contains an html status message containing links back to the build
  • buildStatusUrl field which contains a URL back to the build instance in case you want to roll your own links.
  • Now uses the zip file plugin format. If you are upgrading please remember to remove your old folder and jar as they are no longer required.

There are quite a few refactorings under the hood. Please backup your existing config before you upgrade because the XML format has changed and you won’t be able to roll back.

As usual, please put comments below or on the bugs page.

Here is a screen shot of the new tcWebHooks editor dialog.

It’s very very alpha at the moment. Internally it’s very different. As a result of adding these nested settings, I’ve had to change the XML format. So please please backup your config directory (folder) before installing. I have a format converter, which is unit tested, but you never know 😉
I’ve removed the “buildStatusChanged” event. It was incredibly misleading, as most people thought it was referring to historical events, rather than in build events.

To install.

  • Shutdown teamcity.
  • Remove the tcWebhooks (or whatever you called it) folder inside your .BuildServer/plugins folder
  • Backup your .BuildServer/config folder
  • Drop the new ZIP into .BuildServer/plugins/
  • Startup teamcity.
Please let me know how you get on using the comment below.

16 thoughts on “tcWebHooks alpha release available – Now much better!

    Jason Meridth said:
    May 18, 2012 at 13:16

    Installed and testing. Thank you for the hard work

    Michael Russell said:
    March 5, 2013 at 19:41

    Thanks for your work. Is it possible to customize the messages sent to hipchat? Specifically, I’d like to add the git branch name to the message.

      netwolfuk responded:
      March 7, 2013 at 05:35

      Hi Michael. It’s not currently possible to modify the message sent to hipchat. That does seem like a useful feature though. Thanks for the comment.

        Matt said:
        July 24, 2013 at 17:51

        I thought the custom-temaplates inside the plugin-settings.xml file was there to modify the message sent to hipchat. I am able to use that to modify the message, but as Michael suggested I’d like to put the git branch name in there too. I tried ${branch} but I get UNRESOLVED. Is the branch name not something available here? Thanks.

        netwolfuk responded:
        July 28, 2013 at 01:09

        Hi Matt. Can you create a bin and try posting a webhook there? I really want to know if the branch is actually being populated by the webhook correctly. There should be a value listed as branch.

        Jeff Yates (@jefftunes) said:
        August 22, 2013 at 21:40

        ${branch} is showing as UNRESOLVED for us too when we get the message to hipchat. Any idea what this could be?

        Jeff Yates (@jefftunes) said:
        August 22, 2013 at 21:57

        Ok, I used to see what was going on and the “branch” value isn’t in the name/value pairs that are posted. The only indication that I had included the ${branch} value i my custom template is the presence of the UNRESOLVED text in the buildStatusHtml and text values.

        netwolfuk responded:
        August 22, 2013 at 21:58

        Thanks. What version of TeamCity is it?

    Brian Craig said:
    April 9, 2013 at 18:06

    I’d also like to be able to customize the messages that are going to hipchat. Seeing which branch is being built in those messages would be great.

    netwolfuk responded:
    April 15, 2013 at 05:00

    The branch is already available as a field in tcWebHooks. However, I don’t use GIT (yet), so don’t know what it looks like.
    What do you get from the variable?

    I have two thoughts.

    1) Just add (branch:” %branch%) to the html status message that HipChat gets (if branch != null).
    2) Implement a proper message builder, so that it could be completely controlled based on values in the other fields and custom strings.

    Number two then brings up the following questions:
    Do you customise per webhook? Per project? For all webhooks?
    The three fields that I imagine need customising are “message”, “text” and “buildStatusHtml”.
    How to handle when values are empty or null?

    Anything else?

      Brian Craig said:
      April 15, 2013 at 12:46

      For me a customized message per webhook would be the way to go.

      And if we’re wishing, I’d like to be able to send HipChat values for both the notify and color options that they have available. That way on a build failure, I can color it red and make it beep at me.

        netwolfuk responded:
        April 15, 2013 at 13:20

        The TeamCity endpoint on HipChat is a custom page. HipChat’s Web API shows it is possible though. I’ve emailed HipChat support to ask about getting those standard API extras added to the custom TeamCIty endpoint.

        Brian Craig said:
        April 15, 2013 at 15:20

        Awesome, thanks! Let me know if there’s anything I can do to help convince them that it’s a good idea.

    netwolfuk responded:
    April 16, 2013 at 12:37

    Garret from HipChat replied that those extra options are already enabled on the TeamCity endpoint. See the link below for a blog post about it.

    Beware of a bug. Editing a webhook in the UI does not properly retain the extra parameters.

    […] asked in the comments about setting the notify flag and changing the colour of messages sent to HipChat channels from […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s