Giter VIP home page Giter VIP logo

teamcity-hipchat-notifier's People

Contributors

galet avatar kenny-evitt avatar parautenbach avatar pawelpabich avatar pbjorklund avatar rbergman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teamcity-hipchat-notifier's Issues

Connection Failed

I am trying to set this up against teamcity 9 and I get this error.

screen shot 2015-05-19 at 4 13 35 pm

My token is correct. What am I doing wrong?

buildTypeId not required in "build number" default URL

The default URL for build number is ${serverUrl}/viewLog.html?buildId=${buildId}&tab=buildResultsDiv&buildTypeId=${buildTypeId}. The buildTypeId is not required and currently breaks when using TC 8 since the buildTypeIds changed.

Relates to #30

Upgrade from 0.5 to 0.7.2 failed

Hi,

I decided to upgrade HipChat notifier on our 8.1.1 Team City server and now the HipChat page is empty most of the time. If I'm persistent enough :) and hit F5 a lot I can be lucky and end up with a populate screen. This is what I found in TC log:

 jetbrains.buildServer.SERVER - Unhandled exception occurred while calling method fillModel of HipChatConfigurationPageExtension[myIncludeUrl='/plugins/HipChat Notifier/adminSettings.jsp', myPluginName='hipChat', myPlaceId=/admin/admin.html#ADMIN_SERVER_CONFIGURATION@TAB] extension. 
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at jetbrains.buildServer.web.impl.PagePlaceImpl$ProxyHandler.invokeExtensionMethodUnsafe(PagePlaceImpl.java:22)
    at jetbrains.buildServer.web.impl.PagePlaceImpl$ProxyHandler.invoke(PagePlaceImpl.java:21)
    at com.sun.proxy.$Proxy32.fillModel(Unknown Source)
    at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.fillModel(PageExtensionsInterceptor.java:10)
    at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.processCustomTabs(PageExtensionsInterceptor.java:35)
    at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.fillModel(PageExtensionsInterceptor.java:66)
    at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.postHandle(PageExtensionsInterceptor.java:59)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:801)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:13)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at jetbrains.buildServer.web.ParametersProviderCalculationContextFilter.doFilter(ParametersProviderCalculationContextFilter.java:5)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(DisableSessionIdFromUrlFilter.java:2)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at jetbrains.buildServer.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:23)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:10)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
    at com.whatsthatlight.teamcity.hipchat.Utils.getRooms(Utils.java:55)
    at com.whatsthatlight.teamcity.hipchat.HipChatConfigurationPageExtension.fillModel(HipChatConfigurationPageExtension.java:85)
    ... 44 more
[2015-01-22 08:41:42,911]   INFO - .impl.agent.AgentZipLookupTask - Build agent distribution version is set to 29939, hash=SHA-16SLeqiSuraaL7gbcktmMvJXPF7M= 
[2015-01-22 08:42:07,786]   WARN -   jetbrains.buildServer.SERVER - Unhandled exception occurred while calling method fillModel of HipChatConfigurationPageExtension[myIncludeUrl='/plugins/HipChat Notifier/adminSettings.jsp', myPluginName='hipChat', myPlaceId=/admin/admin.html#ADMIN_SERVER_CONFIGURATION@TAB] extension. 
java.lang.reflect.InvocationTargetException

Emoticons Not Appearing

Thanks for this plugin! Overall it works great and is extremely easy to set up, I've just noticed an issue where none of the emoticons at the end of the message are appearing properly. Here is a screenshot showing what I mean:

hipchat_-_general

Is there something that I need to do on either the TeamCity or HipChat side to get this working? Also, is there an easy way to turn the emoticons off?

Thanks!

Loading emoticons causes an infinite loop

On server startup or when reloading emoticons from the configuration page, the API processor sometimes go into an infinite loop. This can cause several problems:

  • The configuration page may seem to hang.
  • Out of memory errors.
  • Exceeding the HipChat API rate limit, causing notifications to be blocked.

The cause is actually a broken HipChat API, as on each subsequent request, it returns a next resource, with zero emoticon items in the set returned for that resource.

Build message does not list contributors

Hi,

We are running 0.4.3 and the notification message does not list contributors. Sample: Build XXXX-QuickCI was successful. It was build number #102 and was triggered by Team Foundation Server. Do we have to enable this message somewhere?

Thanks

Pawel

Upgrade from v0.3.0 to v0.4.0 doesn't play nice

Hi, I'm using the TC 8.1.1 (latest version). I had HitChatNotifier v0.3.0 installed.
Upgrading it to v0.4.0 wasn't smooth. I had to uninstall the older version and then re-install the newer version and restart TC a couple of time to get it to play nicely.

Build number missing at start of build message

The starting build message shows #??? as the build number, rather than the actual build number.

Build Server Code :: Docs on branch refs/heads/master has started. 
This is build number #??? and was triggered by Joseph Lust.  

TeamCity: 9.0.1 (build 32116)
Plugin: latest
SCM: git
Runner: Maven

Note: The end of build message does show the proper build number:

Build Server Code :: Docs on branch refs/heads/master was successful. 
It was build number #0a27596085b9d03bb60d1f239df873283f9936f3 and was triggered by Joseph Lust.  

All config boxes are blank when invalid <#if> statement entered

I was experimenting with having an if statement in the build started box like so:

<#if ${.data_model["system.deployBuildNumber"]}> ${.data_model["system.deployBuildNumber"]} is being deployed</#if>

After hitting save the page reloaded and all build start / successful / failed message boxes were blank. I could no longer click default beside any of them either until I re-saved the empty boxes.

Also is something like this if statement possible? Where it only shows the text if the variable is set.

New feature to notify only when build state changes doesn't work for multiple branches in a single build configuration

We're finding a limitation in the way the new feature to notify only when the build state changes works. It appears to not take into account branches. Specifically, if one build configuration is building multiple branches (as it does in our config), the failures and successes on each branch get glommed together when it comes to calculating state changes. A failure on one branch followed by a success on another will notify for both, even though the second branch has never failed.

No emoticons available

I've installed the notifier in my TeamCity instance and authorised it with a user token.

It's sending notifications, but there aren't any emoticons added. When I look at the admin page it tells me that there are 0 items in the emoticon cache. I've tried clicking the 'reload' button.

What should I check?

Server startup event never fires

I should first note: after the server has been running for a while, the HipChat Notifier works fine.

I'm not really sure what's going on with this, but when I happen to reboot the server I see the "Build server shutting down." message in HipChat. When the server comes back online, I never see the "Build server started." message.

When I RDP to the machine immediately after a reboot and review the HipChat Notifier settings, the "Test connection" button fails and the room list is empty. If I hit the page again X minutes later, "Test connection" works and the rooms dropdown is populated - yet the "Build server started." message still doesn't show in HipChat.

I don't know what happens between it not working right after a reboot, and it working X minutes later. I do have logging enabled. This is the log file after I bounce the server:

2015-04-22 08:30:28,032 - DEBUG - Set "C:\ProgramData\JetBrains\TeamCity\config\hipchat" as the template path 
2015-04-22 08:30:28,058 - INFO  - Project configuration page registered 
2015-04-22 08:30:28,082 - DEBUG - Server extension created 
2015-04-22 08:30:28,086 - DEBUG - Server extension registered 
2015-04-22 08:30:28,102 - INFO  - Global configuration page registered 
2015-04-22 08:30:28,119 - DEBUG - Config file path: C:\ProgramData\JetBrains\TeamCity\config\hipchat.xml 
2015-04-22 08:30:28,119 - INFO  - Controller created 
2015-04-22 08:30:28,128 - DEBUG - Loading existing configuration 
2015-04-22 08:30:28,208 - DEBUG - Caching all available emoticons 
2015-04-22 08:30:28,208 - DEBUG - Start index: 0 
2015-04-22 08:30:29,181 - DEBUG - Adding emoticon: bacon - https://dujrsrsgsd3nh.cloudfront.net/img/emoticons/112717/bacon-1413835253.png 
... moar emoticon stuff ...
2015-04-22 08:30:29,693 - DEBUG - Adding emoticon: forscale - https://dujrsrsgsd3nh.cloudfront.net/img/emoticons/forscale-1428536097.png 
2015-04-22 08:30:29,693 - DEBUG - Start index: 300 
... moar index stuff ...
2015-04-22 08:30:49,969 - DEBUG - Start index: 9900 
2015-04-22 08:30:50,153 - ERROR - Could not retrieve emoticons: 429 Unknown Status 
2015-04-22 08:30:50,153 - INFO  - Emoticon cache reloaded: 214 
2015-04-22 08:30:50,153 - INFO  - Controller initialised 
2015-04-22 08:31:05,196 - DEBUG - Reading template serverStartupTemplate 
2015-04-22 08:31:05,494 - DEBUG - {"color":"gray","message":"Build server started.","notify":false,"message_format":"html"} 
2015-04-22 08:31:05,690 - ERROR - Message could not be delivered: 429 Unknown Status 
2015-04-22 08:31:21,366 - DEBUG - Bypass SSL check: false 
2015-04-22 08:31:21,565 - ERROR - Could not retrieve rooms: 429 Unknown Status 
2015-04-22 08:31:21,565 - DEBUG - Reading template buildStartedTemplate 
2015-04-22 08:31:21,578 - DEBUG - Reading template buildSuccessfulTemplate 
2015-04-22 08:31:21,589 - DEBUG - Reading template buildFailedTemplate 
2015-04-22 08:31:21,592 - DEBUG - Reading template buildInterruptedTemplate 
2015-04-22 08:31:21,595 - DEBUG - Reading template serverStartupTemplate 
2015-04-22 08:31:21,595 - DEBUG - Reading template serverShutdownTemplate 
2015-04-22 08:31:21,596 - DEBUG - Configuration page variables populated 
2015-04-22 08:31:29,549 - DEBUG - Handling request 
2015-04-22 08:31:29,549 - DEBUG - Test connection 
2015-04-22 08:31:29,549 - DEBUG - Testing authentication 
2015-04-22 08:31:29,550 - DEBUG - API URL: https://api.hipchat.com/v2/ 
2015-04-22 08:31:29,550 - DEBUG - API token: xxxxxxxxxxxx 
2015-04-22 08:31:29,741 - ERROR - Authentication failed: 429 Unknown Status 
2015-04-22 08:31:29,741 - DEBUG - Authentication status: false 

After a few minutes, if I refresh the page... the HipChat stuff is working and the log now has this at the end:

2015-04-22 08:34:27,236 - DEBUG - Bypass SSL check: false 
2015-04-22 08:34:27,464 - DEBUG - Unknown property: participants 
2015-04-22 08:34:27,464 - DEBUG - Unknown property: participants 
2015-04-22 08:34:27,465 - DEBUG - Unknown property: participants 
2015-04-22 08:34:27,465 - DEBUG - Unknown property: participants 
2015-04-22 08:34:27,465 - DEBUG - Unknown property: participants 
2015-04-22 08:34:27,465 - DEBUG - Unknown property: participants 
2015-04-22 08:34:27,465 - DEBUG - Unknown property: participants 
2015-04-22 08:34:27,465 - DEBUG - Unknown property: participants 
2015-04-22 08:34:27,466 - DEBUG - Reading template buildStartedTemplate 
2015-04-22 08:34:27,467 - DEBUG - Reading template buildSuccessfulTemplate 
2015-04-22 08:34:27,467 - DEBUG - Reading template buildFailedTemplate 
2015-04-22 08:34:27,468 - DEBUG - Reading template buildInterruptedTemplate 
2015-04-22 08:34:27,468 - DEBUG - Reading template serverStartupTemplate 
2015-04-22 08:34:27,469 - DEBUG - Reading template serverShutdownTemplate 
2015-04-22 08:34:27,469 - DEBUG - Configuration page variables populated 

Question Marks Instead of Emoticons

I recently installed TeamCity and this plugin, and it works quite well. The only problem I'm seeing is that it's showing question-mark squares instead of emoticons. This seems to be happening for the web client as well as the mac client. Is there something configured wrong that I should double-check?

Add release download to readme

I would like to try this plugin out, but I don't want to pull down source and build right now. Is there a location where I can download a release and drop it right into teamcity?

Can't get it to work with TeamCity 8.1.1

I can't get it to work for build events, only when TeamCity server starts/stops.

I'm running v0.5.0 of your plugin and running TeamCity 8.1.1 Enterprise Edition.

  • I have installed the plugin correctly (it's showing up in TeamCity Administration page).
  • I created a new HipChat user for TeamCity.
  • I have created a HipChat API v2 token for that user and configured correctly (Test Connection says "Connection successful!")

What am I doing wrong?

upstream sent too big header while reading response header from upstream

Getting this error when visiting the HipChat Notifier page after installing:

2014/07/25 15:20:48 [error] 772#0: *9618170 upstream sent too big header while reading response header from upstream, client: REDACTED, server: REDACTED, request: "GET /admin/admin.html?item=hipChat&init=1 HTTP/1.1", upstream: "http://127.0.0.1:8080/admin/admin.html?item=hipChat&init=1", host: "REDACTED", referrer: "https://REDACTED/admin/admin.html?item=serverConfigGeneral"

We are on TC 8.0.6.

Default build url points to the project

Even though the text is the name of the build configuration, the url that is linked is to the project. I think it should link to the build configuration.

How to build the project

Hi,
I would like to contribute to the TC Hipchat notifier so I cloned the repo and changed teamcity.home to C:\TeamCity, opended project in IntelliJ, hit build and ended up with gazilion compilation errors. Do you have any step by step guide that I could use? I have installed JDK 1.7.

Thanks

${buildId} in default URLs contains commas

The variable ${buildId} that is in the default URLs contains commas, so build id 2416890 becomes 2,416,890 in the URL which does not work.

A workaround for this is to use the exposed parameters since they appear to be treated as string.
${.data_model["teamcity.build.id"]}

Cannot retrieve rooms

Hi,

I'm currently trying to migrate away from webhooks to your nice plugin but all I get is the following error message in my log files:

ERROR - hatsthatlight.teamcity.hipchat - Could not retrieve rooms: 401 Unauthorized

I'm using TeamCity 8.1.5 and the current version of your plugin (0.8.0).

Any ideas?

Show contributors from snapshot dependecies

Hi,

This might not be possible :). Let's say there are 2 builds A and B. Build A is triggered for each checkin, and build B is triggered by successful build A. Would it be possible to list list of contributors from A (dependency) in notifications for B ?

See and configure the hipchat notifier under my profile -> notification rules

Just curious, have you looked into this? Similar to how the email, jabber, and tray notifier work which would allow for fine control of who is notified and for what projects. Right now i'm using the webhooks plugin, which does the job for sure but am really interested in what you've started here and exceeding that functionality...especially if it can be customized on the user level in the profile.

I've done some somewhat similar integration with hipchat and visualstudio.com build service and source control (https://github.com/sirkirby/TFSChanges). They don't support plugins, but have an api which i poll and post to hipchat via the v1 api. was considering working with the teamcity api too, but i prefer the push approach via plugin that you've started here, much cleaner.

Filtering notifications by branch

We use a feature-branching workflow with Git and TeamCity runs CI on all (auto-discovered) active branches. Is there any way that we can filter notifications so that, for example, we only get notifications for the master branch of any project?

Specify custom channel for server events

We have a fairly busy TeamCity server with a lot of projects/builds owned by various teams, and we want each team to have the ability to opt-in to HipChat notifications for their projects. However, we'd still like to have server events go to our "General" room so everyone knows the server is going up and down.

The only way I could figure out to accomplish this is to set the default room to "General", and then go through every project (over a hundred) to set the room to "(None)". It would be great if there was an easier way!

404 after plugin installation

I just installed the notifier into TeamCity and restarted the server. I see the link to "HipChat Notifier" under the Server Administration links. Clicking on it results in a 404.

The link points to:
https://[my build server]/admin/admin.html?item=hipChat&init=1

When followed I get the 404 at:

https://[my build server]/admin/admin.html?item=hipChat&buildFailedTemplateDefault=Build+%26lt%3Ba+href%3D%26quot%3B%24{serverUrl}%2Fproject.html%3FprojectId%3D%24{projectId}%26quot%3B%26gt%3B%24{fullName}%26lt%3B%2Fa%26gt%3B+%26lt%3B%23if+hasBranch%26gt%3Bon+branch+%26lt%3Bb%26gt%3B%24{branch}%26lt%3B%2Fb%26gt%3B%26lt%3B%2F%23if%26gt%3B+failed.+It+was+build+number+%26lt%3Ba+href%3D%26quot%3B%24{serverUrl}%2FviewLog.html%3FbuildId%3D%24{buildId}%26amp%3Btab%3DbuildResultsDiv%26amp%3BbuildTypeId%3D%24{buildTypeId}%26quot%3B%26gt%3B%23%24{buildNumber}%26lt%3B%2Fa%26gt%3B+and+was+triggered+by+%24{triggeredBy}.+%26lt%3B%23if+hasContributors%26gt%3BContributors%3A+%24{contributors}.%26lt%3B%2F%23if%26gt%3B+%26lt%3Bimg+src%3D%26quot%3B%24{emoticonUrl}%26quot%3B%26gt%3B&buildInterruptedTemplateDefault=Build+%26lt%3Ba+href%3D%26quot%3B%24{serverUrl}%2Fproject.html%3FprojectId%3D%24{projectId}%26quot%3B%26gt%3B%24{fullName}%26lt%3B%2Fa%26gt%3B+%26lt%3B%23if+hasBranch%26gt%3Bon+branch+%26lt%3Bb%26gt%3B%24{branch}%26lt%3B%2Fb%26gt%3B%26lt%3B%2F%23if%26gt%3B+was+cancelled.+It+was+build+number+%26lt%3Ba+href%3D%26quot%3B%24{serverUrl}%2FviewLog.html%3FbuildId%3D%24{buildId}%26amp%3Btab%3DbuildResultsDiv%26amp%3BbuildTypeId%3D%24{buildTypeId}%26quot%3B%26gt%3B%23%24{buildNumber}%26lt%3B%2Fa%26gt%3B+and+was+cancelled+by+%24{cancelledBy}.+%26lt%3Bimg+src%3D%26quot%3B%24{emoticonUrl}%26quot%3B%26gt%3B&serverStartup=true&serverShutdownTemplate=Build+server+shutting+down.&serverShutdownTemplateDefault=Build+server+shutting+down.&buildStartedTemplateDefault=Build+%26lt%3Ba+href%3D%26quot%3B%24{serverUrl}%2Fproject.html%3FprojectId%3D%24{projectId}%26quot%3B%26gt%3B%24{fullName}%26lt%3B%2Fa%26gt%3B+%26lt%3B%23if+hasBranch%26gt%3Bon+branch+%26lt%3Bb%26gt%3B%24{branch}%26lt%3B%2Fb%26gt%3B%26lt%3B%2F%23if%26gt%3B+has+started.+This+is+build+number+%26lt%3Ba+href%3D%26quot%3B%24{serverUrl}%2FviewLog.html%3FbuildId%3D%24{buildId}%26amp%3Btab%3DbuildResultsDiv%26amp%3BbuildTypeId%3D%24{buildTypeId}%26quot%3B%26gt%3B%23%24{buildNumber}%26lt%3B%2Fa%26gt%3B+and+was+triggered+by+%24{triggeredBy}.+%26lt%3B%23if+hasContributors%26gt%3BContributors%3A+%24{contributors}.%26lt%3B%2F%23if%26gt%3B+%26lt%3Bimg+src%3D%26quot%3B%24{emoticonUrl}%26quot%3B%26gt%3B&serverStartupTemplateDefault=Build+server+started.&emoticonCacheSize=0&buildStarted=true&buildSuccessfulTemplateDefault=Build+%26lt%3Ba+href%3D%26quot%3B%24{serverUrl}%2Fproject.html%3FprojectId%3D%24{projectId}%26quot%3B%26gt%3B%24{fullName}%26lt%3B%2Fa%26gt%3B+%26lt%3B%23if+hasBranch%26gt%3Bon+branch+%26lt%3Bb%26gt%3B%24{branch}%26lt%3B%2Fb%26gt%3B%26lt%3B%2F%23if%26gt%3B+was+successful.+It+was+build+number+%26lt%3Ba+href%3D%26quot%3B%24{serverUrl}%2FviewLog.html%3FbuildId%3D%24{buildId}%26amp%3Btab%3DbuildResultsDiv%26amp%3BbuildTypeId%3D%24{buildTypeId}%26quot%3B%26gt%3B%23%24{buildNumber}%26lt%3B%2Fa%26gt%3B+and+was+triggered+by+%24{triggeredBy}.+%26lt%3B%23if+hasContributors%26gt%3BContributors%3A+%24{contributors}.%26lt%3B%2F%23if%26gt%3B+%26lt%3Bimg+src%3D%26quot%3B%24{emoticonUrl}%26quot%3B%26gt%3B&notify=false&buildFailedTemplate=Build+%3Ca+href%3D%22%24{serverUrl}%2Fproject.html%3FprojectId%3D%24{projectId}%22%3E%24{fullName}%3C%2Fa%3E+%3C%23if+hasBranch%3Eon+branch+%3Cb%3E%24{branch}%3C%2Fb%3E%3C%2F%23if%3E+failed.+It+was+build+number+%3Ca+href%3D%22%24{serverUrl}%2FviewLog.html%3FbuildId%3D%24{buildId}%26tab%3DbuildResultsDiv%26buildTypeId%3D%24{buildTypeId}%22%3E%23%24{buildNumber}%3C%2Fa%3E+and+was+triggered+by+%24{triggeredBy}.+%3C%23if+hasContributors%3EContributors%3A+%24{contributors}.%3C%2F%23if%3E+%3Cimg+src%3D%22%24{emoticonUrl}%22%3E&buildFailed=true&buildStartedTemplate=Build+%3Ca+href%3D%22%24{serverUrl}%2Fproject.html%3FprojectId%3D%24{projectId}%22%3E%24{fullName}%3C%2Fa%3E+%3C%23if+hasBranch%3Eon+branch+%3Cb%3E%24{branch}%3C%2Fb%3E%3C%2F%23if%3E+has+started.+This+is+build+number+%3Ca+href%3D%22%24{serverUrl}%2FviewLog.html%3FbuildId%3D%24{buildId}%26tab%3DbuildResultsDiv%26buildTypeId%3D%24{buildTypeId}%22%3E%23%24{buildNumber}%3C%2Fa%3E+and+was+triggered+by+%24{triggeredBy}.+%3C%23if+hasContributors%3EContributors%3A+%24{contributors}.%3C%2F%23if%3E+%3Cimg+src%3D%22%24{emoticonUrl}%22%3E&buildInterrupted=true&buildInterruptedTemplate=Build+%3Ca+href%3D%22%24{serverUrl}%2Fproject.html%3FprojectId%3D%24{projectId}%22%3E%24{fullName}%3C%2Fa%3E+%3C%23if+hasBranch%3Eon+branch+%3Cb%3E%24{branch}%3C%2Fb%3E%3C%2F%23if%3E+was+cancelled.+It+was+build+number+%3Ca+href%3D%22%24{serverUrl}%2FviewLog.html%3FbuildId%3D%24{buildId}%26tab%3DbuildResultsDiv%26buildTypeId%3D%24{buildTypeId}%22%3E%23%24{buildNumber}%3C%2Fa%3E+and+was+cancelled+by+%24{cancelledBy}.+%3Cimg+src%3D%22%24{emoticonUrl}%22%3E&serverStartupTemplate=Build+server+started.&buildSuccessful=true&buildSuccessfulTemplate=Build+%3Ca+href%3D%22%24{serverUrl}%2Fproject.html%3FprojectId%3D%24{projectId}%22%3E%24{fullName}%3C%2Fa%3E+%3C%23if+hasBranch%3Eon+branch+%3Cb%3E%24{branch}%3C%2Fb%3E%3C%2F%23if%3E+was+successful.+It+was+build+number+%3Ca+href%3D%22%24{serverUrl}%2FviewLog.html%3FbuildId%3D%24{buildId}%26tab%3DbuildResultsDiv%26buildTypeId%3D%24{buildTypeId}%22%3E%23%24{buildNumber}%3C%2Fa%3E+and+was+triggered+by+%24{triggeredBy}.+%3C%23if+hasContributors%3EContributors%3A+%24{contributors}.%3C%2F%23if%3E+%3Cimg+src%3D%22%24{emoticonUrl}%22%3E&apiUrl=https%3A%2F%2Fapi.hipchat.com%2Fv2%2F&serverShutdown=true&disabled=false

Getting "Connection failed!" with 0.8.0

I updated to TeamCity 8.1.5 (build 30240) and HipChat Notifier to 0.8.0. The exiting API token seemed to have stopped working, so I generated a new one, which also doesn't appear to be working.

The "Default room" field just says "(None)" and using "Test connection" results in a "Connection failed!" alert.

Is there something else I can/need to do to get this working again?

Http proxy configuration support

Hi,

Is it possible to add configuration and connection support for using http proxy to connect to the hipchat servers?

I tried with teamcity own configuration (https://confluence.jetbrains.com/display/TCD9/How+To...#HowTo...-ConfigureTeamCitytoUseProxyServerforOutgoingConnections)
But seems that the plugin uses Apache HttpClient to connect.
And for that to use a proxy, a Route must be added when creating the client
http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e475

It would be awesome if the HipChatNotifier plugin can have an independent http proxy configuration from the settings on the admin ui. So it's easier to enable a proxy just for this plugin

Thanks and great plugin!

Add a link to the build in the message

It would greatly enhance the user experience if one can click on a link to the specific build in the message sent by the plugin.

The HipChat v2 API supports two types of message formats: plain text and HTML. See https://www.hipchat.com/docs/apiv2/method/send_room_notification.

The functionality differs somewhat:

  • Plan text messages can contain mentions and emoticons and links, but the link's text will be rendered with the URL's text (and will be clickable).
  • HTML messages can't contain mentions or emoticons directly, but links can be added with an a tag. The implication is that the build number can be used as the link text.

The plugin is currently using text messages, as the original idea was to use colour and emoticons to spice up the messages. As an immediate solution, the plain text links can be added to the message templates, but it won't look very nice.

The better solution is to only use HTML messages. What's been avoiding me until now was a way to add emoticons to the message, which was an important incentive for building this plugin, so I'd like to keep it. What can be done, is to use an img tag and retrieve the available emoticons via the API: https://www.hipchat.com/docs/apiv2/method/get_all_emoticons.

A hybrid solution would also be possible where both formats are supported, but will be a lot more work, with a lot of added configuration, and it doesn't seem worth it if HTML messages can do the job.

Exposing build paramters

Is it possible to grab build parameters and display them in a custom field? A use case for this would be displaying the servername that something was deployed to. I tried just placing this in box grabbed for build number but this breaks build chain functionality.

Project/configuration level costumization

Hi,

Is there any way (or plan for future improvement) to be able to set that which project or configuration(preferably) related events should trigger a notification towards HipChat and which shouldn't?

Thanks
cSE

Necessary to create a new HipChat user? What about other Token API?

Hey,

In v1 of the HipChat API you can just create a "notify token" which has write-only access to the chat room, and can send as any arbitrary chat name you like.

I don't like the v2 HipChat API where you need a user token for a bot and it has read and write access.

I'm not familiar with the v2 API for HipChat that much, can you also support a "notify token" style system, ideally?

Cheers

buildTypeId points to old style build type ids in TC 8

Teamcity 8 now supports custom build type IDs. It looks like the buildTypeId is generated using an internal counter and not the actual build type id as specified. Anything created after the new Teamcity was implemented will not work since the old style bt no longer work. On converted values, the redirection works but with a warning on the top to update your bookmarks.

Include short status description in notification

Hi, forgive me if I have missed something in the docs, and this is actually very simple to implement. But I have been trying to include the short description in the hipchat notification, but despite no syntax errors, the notification seems to fail to send.

In the email template this is ${var.buildShortStatusDescription} which gives a brief outline - such as:

(Tests passed: 25)

However, this does not seem to function when including this in the Hipchat template. Clearly 'var' must not be defined, and therefore returns nothing... but I cannot seem to see how to extract the values I need?

P.S The hipchat notifier is excellent by the way!

Support for Teamcity 9

The plugin doesn't seem to be able to connect to the Hipchat server (or the failure happens earlier).
Using the "Test connection" button will give a "Connection failed!" message.

Note that we didn't try the plugin on Teamcity 8 since we upgraded all our servers. For the record, the main server is allowed to communicate with the hipchat api servers.

MessaageFormat of HTML breaks emoticons

Per the HipChat documentation, message_format must be text for emoticons to work. Currently, messages are getting sent in the html format.

HipChat documentation for this.

If I have time, I'll try to spin up a VM to dev and test this change, but I doubt it'll happen. I'm guessing the only change that'll need to be done would be changing line 64 that I linked above from this

this.messageFormat = HipChatMessageFormat.HTML;

to

this.messageFormat = HipChatMessageFormat.TEXT;

My assumption is that the links that are in the message sent to HipChat will be auto-detected as they are full URLs. If they don't get auto-detected, I would suggest removing the emoticons.

Exception when I open the Hipchat Notifier Admin page

Exception when I open the Hipchat Notifier configuration page

TeamCity Enterprise 8.1.4 (build 30168)
HipChat Plugin 0.7.2

[2014-09-16 10:21:11,057] WARN - jetbrains.buildServer.SERVER - Unhandled exception occurred while calling method fillModel of HipChatConfigurationPageExtension[myIncludeUrl='/plugins/HipChat Notifier/adminSettings.jsp', myPluginName='hipChat', myPlaceId=/admin/admin.html#ADMIN_SERVER_CONFIGURATION@TAB] extension.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at jetbrains.buildServer.web.impl.PagePlaceImpl$ProxyHandler.invokeExtensionMethodUnsafe(PagePlaceImpl.java:20)
at jetbrains.buildServer.web.impl.PagePlaceImpl$ProxyHandler.invoke(PagePlaceImpl.java:15)
at com.sun.proxy.$Proxy33.fillModel(Unknown Source)
at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.fillModel(PageExtensionsInterceptor.java:79)
at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.processCustomTabs(PageExtensionsInterceptor.java:49)
at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.fillModel(PageExtensionsInterceptor.java:21)
at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.postHandle(PageExtensionsInterceptor.java:11)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:801)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:28)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at jetbrains.buildServer.web.DependencyParametersCalculationContextFilter.doFilter(DependencyParametersCalculationContextFilter.java:4)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(DisableSessionIdFromUrlFilter.java:3)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at jetbrains.buildServer.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:7)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
at com.whatsthatlight.teamcity.hipchat.Utils.getRooms(Utils.java:55)
at com.whatsthatlight.teamcity.hipchat.HipChatConfigurationPageExtension.fillModel(HipChatConfigurationPageExtension.java:85)
... 47 more

Display proper usernames in build messages

Currently the messages contains information that says "Triggered by Team Foundation Server", it would me much more convenient to know who actually triggered it based on the changeset.

Add more markup to notification messages

Add clickable links for the project and build configuration and perhaps use emphasis for the build status (e.g. put success in bold), which could also point to where the build number's link points.

Cannot Retrieve Rooms

In the Admin page within TeamCity - after setting the APIv2 token - connection test is successful. However after changing any other options and clicking save - message says saved successfully - page reloads but nothing is saved. After enabling debugging - error in the log is as below. Anyone experiencing the same? This is using most recent version of HipChat Notifier - and TC version 8.1.2.

014-09-11 02:08:17,432 - ERROR - Could not get rooms
org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "participants" (Class com.whatsthatlight.teamcity.hipchat.HipChatApiResponseLinks), not marked as ignorable
at [Source: java.io.InputStreamReader@ea48ee; line: 1, column: 54](through reference chain: com.whatsthatlight.teamcity.hipchat.HipChatRooms["items"]->com.whatsthatlight.teamcity.hipchat.HipChatRoom["links"]->com.whatsthatlight.teamcity.hipchat.HipChatApiResponseLinks["participants"])
at org.codehaus.jackson.map.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:53)

Branch name in template?

Hi,

I was hoping to use this for my multi-branch TeamCity builds; however the plugin only mentions the build configuration name (eg, "Build and test" in my case) and does not include the feature branch name that was being built / succeeded / failed.

Any change the messages can be revised to mention the branch name?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.