Giter VIP home page Giter VIP logo

tcslackbuildnotifier's Introduction

tcSlackBuildNotifier

Deprecation notice

This project is no longer actively maintained - JetBrains has added Slack functionality to TeamCity 2020.1

Join the chat at https://gitter.im/PeteGoo/tcSlackBuildNotifier

Overview

Posts Build Status to Slack

Sample Notification Sample Notification

Tested on TeamCity 8.1.2 (build 29993), 9.1 (build 36973)

Installation

Head over to the releases section and get the zip labelled tcSlackNotifierPlugin.zip from there (do not download the one on this page). Copy the zip file into your TeamCity plugins directory.

You will need to restart the TeamCity service before you can configure the plugin.

Configuration

Once you have installed the plugin and restarted head on over to the Admin page and configure your Slack settings.

Admin Page Configuration

  • your default channel is the channel with the # in front of it e.g. #general.
  • your team name is the team e.g. mycoolteam NOT mycoolteam.slack.com.
  • The user token is available when you got to https://api.slack.com/web while logged in to your Slack instance. Under "authentication" you should see a token displayed like below. Alternatively you can use the full URL from the Incoming Webhooks integration in the API token field. The webhooks integration approach is sometimes more preferable as the token is not tied to a user account.

Sample Auth Token

Usage

From the Slack tab on the project or build page (not the Build Configuration Settings page), add a new Slack Notification and you're away!

Sample Build Configuration

  • Remember to put the # in front of the channel name if applicable.

Mentions

In order to receive mentions and direct messages from the notifier you must go to your profile page in TeamCity and tell it your Slack username (no need to include the @). Once you have done this you can be mentioned on failed builds. You can also subscribe to notifications on your profile page.

Contribution

In order to contribute to the project you first need to checkout the project sources. This project uses the TeamCity Plugin SDK for development.

In order to test the plugin simply run the following command with java and mvn installed:

mvn package tc-sdk:start

By default it will install TeamCity in the version listed in the property in the root pom.xml. However you can overwrite this setting by using the -DteamcityVersion=10.0 switch.

Other available commands can be found here.

tcslackbuildnotifier's People

Contributors

a4vision avatar alexandear avatar anivaniuk avatar dependabot[bot] avatar devfozgul avatar eduardsergeev avatar fatso83 avatar fffej avatar freeyoung avatar garethbragg avatar gitter-badger avatar jeanregisser avatar marvin-w avatar mfloryan avatar myster avatar petegoo avatar pointerrr avatar sovietbear avatar srvrguy avatar uldissturms avatar waelouf 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tcslackbuildnotifier's Issues

Icon does not appear on failed builds

Great tool. Thanks for writing it.

When we get a failed build, we are not getting the icon in the slack window. Successful builds show the TC logo.

Is this expected?

Notification link to Build Log does not include port number

Hello,

Our team city instance is served from a port other than 80. The Build Log URL in the slack notification does not include the port.

It appears that JetBrains' SBuildServer class does not expose a way of retrieving the port. Perhaps a custom field can be added to the plugin to specify the build server port (default to 80 if blank)

Feature request: Custom text on notifications

It would be nice to have an option to define a custom text on notifications for specific project (for example add a "Note:" field containing this custom text in every notification), preferably with support of build variables.

Example use case: My WPF project is automatically packed and uploaded to the Amazon S3 bucket as last step of build and I would like to put a link to download this package and also information about an assembly version into the slack notification.

Global notifications

Can we get a way to set up notifications globally? If I go to the Slack tab on the <Root Project>, it's blank.

Unable to Send Notification - Mattermost

Our organization uses Mattermost. Mattermost accepts all Slack formats and all slack notifiers by default works with them. So in configuration i have given mattermost incoming webhook and while i testing the connection, it fails with below error.

[2016-02-11 10:32:23,984]   INFO - tbrains.buildServer.ACTIVITIES - Loading configuration file: C:\ProgramData\JetBrains\TeamCity\config\slack\slack-config.xml 
[2016-02-11 10:32:31,801]   INFO -   jetbrains.buildServer.SERVER - SlackNotificationListener :: Preparing message for URL http://team.source/hooks/zgxixb6khbnsjj1f78br469n9y 
[2016-02-11 10:32:31,844]   INFO -   jetbrains.buildServer.SERVER - SlackNotificationListener :: Body message will be payload=%7B%22channel%22%3A%22%23Dev%22%2C%22username%22%3A%22TeamCity%22%2C%22text%22%3A%22%5Cu003chttp%3A%2F%2Fbuildserver%2Fbuilds%2F%7CFailed+-+My+Awesome+Build+%235%5Cu003e%22%2C%22icon_url%22%3A%22https%3A%2F%2Fraw.githubusercontent.com%2FPeteGoo%2FtcSlackBuildNotifier%2Fmaster%2Fdocs%2FTeamCity.png%22%2C%22attachments%22%3A%5B%7B%22color%22%3A%22danger%22%2C%22fields%22%3A%5B%7B%22title%22%3A%22My+Awesome+Build%22%2C%22value%22%3A%22Agent%3A+Build+Agent+1%5CnElapsed%3A+224m%3A12s%22%2C%22isShort%22%3Afalse%7D%2C%7B%22title%22%3A%22Commits%22%2C%22value%22%3A%22a5bdc78+%3A%3A+jbloggs+%3A%3A+Bug+fix+for+that+awful+thing%5Cncc4500d+%3A%3A+bbrave+%3A%3A+New+feature+that+rocks%5Cnabb23b4+%3A%3A+ddruff+%3A%3A+Merge+of+branch+xyz%5Cn%22%2C%22isShort%22%3Afalse%7D%2C%7B%22title%22%3A%22Changes+By%22%2C%22value%22%3A%22ddruff%2C+bbrave%2C+jbloggs%22%2C%22isShort%22%3Afalse%7D%5D%2C%22fallback%22%3A%22My+Awesome+Build%22%7D%5D%7D 
[2016-02-11 10:32:32,246]  ERROR -   jetbrains.buildServer.SERVER - Error java.io.IOException: Attempted read from closed stream. while processing request: GET '/slackNotifier/adminSettings.html?test=1&teamName=cochin&defaultChannel=%23Dev&token=http%3A%2F%2Fteam.source%2Fhooks%2Fzgxixb6khbnsjj1f78br469n9y&botName=TeamCity&iconUrl=https%3A%2F%2Fraw.githubusercontent.com%2FPeteGoo%2FtcSlackBuildNotifier%2Fmaster%2Fdocs%2FTeamCity.png&maxCommitsToDisplay=10&showCommits=true&showCommitters=true&showElapsedBuildTime=true&showBuildAgent=true&showFailureReason=true&proxyHost=&proxyPort=&proxyUser=&proxyPassword=', from client 192.168.1.3:3174, authenticated as 'sudheesh' (sudheesh) {id=2} 
java.io.IOException: Attempted read from closed stream.
    at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:167)
    at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.Reader.read(Reader.java:140)
    at org.apache.http.util.EntityUtils.toString(EntityUtils.java:244)
    at org.apache.http.util.EntityUtils.toString(EntityUtils.java:288)
    at slacknotifications.SlackNotificationImpl.postViaWebHook(SlackNotificationImpl.java:259)
    at slacknotifications.SlackNotificationImpl.post(SlackNotificationImpl.java:155)
    at slacknotifications.teamcity.extension.SlackNotifierSettingsController.handleTestNotification(SlackNotifierSettingsController.java:119)
    at slacknotifications.teamcity.extension.SlackNotifierSettingsController.doHandle(SlackNotifierSettingsController.java:74)
    at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:75)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:154)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:3)
    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:1)
    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:6)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at jetbrains.buildServer.diagnostic.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:34)
    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:16)
    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:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

Project-specific slacks

We have multiple teams that use different slacks, but they all build on the same TeamCity server (different projects though).

There does not seem to be a way to use different teams per server - as far as I understand, this plugin can post only to a single team.

This should be a setting that is configurable per-project.

Support for Webhooks tokens

We currently use an API token which is tied to a user.

We should allow a integration token (Incoming Web Hooks) and if we can recognise that we have one of these (How?) use the incoming webhooks API to send the message instead of chat.postMessage.

Content tab changes are not saved if configured on the project level

Hi,
Notifications work fine if I configure them on a project level, however when I change anything on the "Content" tab and save, the changes does not get saved. If I open the Content tab again, the default settings are displayed. Configuration file under pluginData folder remain untouched.
I tried to enable the "Show failure reason" option, but it seems none of the settings can be changed.
The same options seem to be fine when configured globally. Teamcity version: 9.1.3 on Windows Server 2012.

How to use notifications for sub-projects?

If I configure notifications for the top project, and click in "all sub projects", does that mean the notification settings will get inherited, or just that it enables whatever notifications are configured below? I don't seem to get any notifications unless I configure individual projects.

TeamCity 9.1.3 and plugin 1.4.2.

Failed to send notification!

I've got the plugin installed and configured, but when I try to send a test notification, an alert pops up with "Failed to send notification!". The server log displays the following:

ERROR - jetbrains.buildServer.SERVER - Error javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty while processing request: GET '/slackNotifier/adminSettings.html?test=1&teamName=quri&defaultChannel=%23ios&token=https%3A%2F%2Fhooks.slack.com%2Fservices%2F&botName=TeamCity&iconUrl=https%3A%2F%2Fraw.githubusercontent.com%2FPeteGoo%2FtcSlackBuildNotifier%2Fmaster%2Fdocs%2FTeamCity32.png&maxCommitsToDisplay=5&showCommits=true&showCommitters=true&showElapsedBuildTime=true&showBuildAgent=false&showFailureReason=true&proxyHost=&proxyPort=&proxyUser=&proxyPassword=', from client 0:0:0:0:0:0:0:1%0:49784, authenticated as 'builder' (Builder) {id=1}

Followed by a stack trace:

avax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1708)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1691)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1222)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:275)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:254)
    at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
    at slacknotifications.SlackNotificationImpl.postViaWebHook(SlackNotificationImpl.java:244)
    at slacknotifications.SlackNotificationImpl.post(SlackNotificationImpl.java:155)
    at slacknotifications.teamcity.extension.SlackNotifierSettingsController.handleTestNotification(SlackNotifierSettingsController.java:119)
    at slacknotifications.teamcity.extension.SlackNotifierSettingsController.doHandle(SlackNotifierSettingsController.java:74)
    at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:78)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:154)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:22)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at jetbrains.buildServer.web.DependencyParametersCalculationContextFilter.doFilter(DependencyParametersCalculationContextFilter.java:1)
    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:7)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at jetbrains.buildServer.diagnostic.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:37)
    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:25)
    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:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:57)
    at sun.security.validator.Validator.getInstance(Validator.java:161)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:108)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:204)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1188)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:135)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:943)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215)
    ... 57 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
    at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:103)
    at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:87)
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:55)
    ... 68 more

TeamCity Professional 9.1 (build 36973)
tcSlackBuildNotifier v1.4.2

Any advice would be appreciated.

Teamcity 9

I have installed the plugin successfully in tramcity 9.0:

tcSlackBuildNotifier-master n/a n/a <TeamCity Data Directory>/.unpacked/tcSlackBuildNotifier-master

But I can't find it anywhere. Is it supposed to work in TC9?

Long list of projects displays incorrectly

Long list of builds overlapping the buttons

When the list of builds is long it overlaps with the buttons at the bottom of the frame of the slack UI.
(in TeamCity Professional 9.0.2 (build 32195), on the Chrome browser)

If the channel does not exist no error is logged

@dkarzon had an issue with not specifying a "#" for a channel name and silently failed.

Apparently there is an error in the message body.

Also occurs if the token is invalid - we really need to add this to the logs (do not believe the 200 - OK)

specify more than one teams

It'd be great if I could specify user, token and team name project wide in teamcity (not just the channel), since we have multiple slack teams.

Proxy settings are not working

Proxy settings are not taken into account when provided in expected format:

 <proxy host="myproxy.mycompany.com" port="8080">
      <noproxy url=".mycompany.com" />
      <noproxy url="192.168.0." />
    </proxy>

This down to how SlackNotificationListener sets proxy for slackNotification in getFromConfig method. This is not the only problem though, still investigating.

Cannot add notification for _Root project

We'd like to add a notification for the root project, but the Slack tab is blank (i.e. there is no content, and in particular, no link to edit the project slack notifications).

I can however manually edit the url to 'http://TCHOST/slacknotifications/index.html?projectId=_Root', and can then click add notification, but there are no project builds or subproject builds listed, and clicking save doesn't seem to persist anything - I do not see a newly created notification.

We have many projects, and I really don't want to have to edit the projects we wish to notify to slack on an individual-project basis! Any help would be most appreciated.

Documentation outdated?

Hi,

I've been trying to integrate this plugin with TeamCity but following the documentation is problematic.
I can't see a way to generate an OAuth token like shown.
I've tried creating a bot to obtain a token but this doesn't seem to work.
Also could you expand on:

  • your team name
    Could we have some examples? E.g. is it just "Foo" or "foo.slack.com" ?
  • defaultChannel
    Could you say if it needs the leading # ?

It would also be handy if there was a "send a test notification" button rather than triggering builds to try and get it working.

TeamCity 9 support

Unfortunately, this very excellent plugin seems to be broken on TeamCity 9 (I'm using 9.0.3).
The 'Slack Notifications' menu is missing from the Administration page (the Slack configuration dialog still works, though)...

More flexible configuration

The following features of the notifications should be configurable, both default in XML and on configuration UI.

  • Show Build Agent?
  • Commit Details
    • Revision / Commit #
    • User name
    • Commit Messages
    • A short vs detailed? Where short is comma delimited list of committers
  • @mention Users? How to get user names?

Does not work on TeamCity 8.0.5

I configured everything as required, "test connection" worked fine. I've added my slack username on the Notifications page and configured a Slack Notification. It does not send any notifications.

Exception when trying to config TeamCity: 7.1.4 (build 24331)

Hope you can help with this

Unexpected Error

This was not supposed to happen. Please provide the error details to your TeamCity server maintainer.
If you maintain this TeamCity installation please report this error to JetBrains.

Error message: none available
TeamCity: 7.1.4 (build 24331)
Operating system: Windows NT (unknown) (6.2, x86)
Java: 1.6.0_31-b05 (Sun Microsystems Inc.)
Servlet container: Apache Tomcat/7.0.23

Trace: java.lang.reflect.UndeclaredThrowableException
at $Proxy27.fillModel(Unknown Source)
at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.fillModel(PageExtensionsInterceptor.java:40)
at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.processCustomTabs(PageExtensionsInterceptor.java:22)
at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.fillModel(PageExtensionsInterceptor.java:58)
at jetbrains.buildServer.web.impl.PageExtensionsInterceptor.postHandle(PageExtensionsInterceptor.java:46)
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:722)
at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:31)
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:7)
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:0)
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:56)
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:19)
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:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
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:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor185.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at jetbrains.buildServer.web.impl.PagePlaceImpl$ProxyHandler.invoke(PagePlaceImpl.java:11)
... 38 more
Caused by: java.lang.NoSuchMethodError: jetbrains.buildServer.serverSide.SProject.getProjectPath()Ljava/util/List;
at slacknotifications.teamcity.extension.SlackNotificationBuildTabExtension.fillModel(SlackNotificationBuildTabExtension.java:50)
at jetbrains.buildServer.web.openapi.buildType.BuildTypeTab.fillModel(BuildTypeTab.java:70)
... 42 more

[null] appearing after build number in slack

When notifications come into slack they look like this:

Image

Any idea what the [null] is? It would be awesome if instead of null it had [succeeded] or [failed] as then it would appear in the desktop notification so I could see at a glance whether I need to investigate a failed build or not.

When trying to add a notification, the link doesn't work

With version 1.4.4
The link "Click to create new SlackNotification for this project" doesn't work.

In the console, I get the following message: BS.EditSlackNotificationDialog is undefined; the link has an onClick attached to it.

Filter branch builds

We're using gitflow and I end up getting notifications on all my feature branches, which isn't really interesting to me. I'd rather just have it for a couple branches like develop and master. Is this feasible?

Better support for test results

When success, show the number of tests that passed

When build success but tests failed make the colour orange, and show the number of tests that passed and failed.

When a build fails keep it red.

Allow filtering out snapshot dependency failures

My team's build configuration contains a number of projects that are chained together. If the first project in the chain fails, then all of the other projects won't build due to the failed dependency. Unfortunately I get slack notifications for all of the sub projects, which I don't really care about because they aren't the root cause. So an option to filter out real failures from snapshot dependency failures would be fantastic.

"Only trigger when build changes from Success to Failure" not saving

I have "Trigger when build Fails" enabled on a project, and I want to enable the sub-checkbox "Only trigger when build changes from Success to Failure". So I check the box, click Save. If I close the configuration popup and then open it again, the box remains checked, but if I refresh the page and then click Edit again, that box reverts to unchecked. All of the other boxes seem to be saving correctly.

Use TeamCity variable in channel name

It would be great to have ability to specify something like #%teamcity.projectname% in channel name to publish messages for separate projects when using templates.

This issue depends on #13

Better logging for IOException when sending notification.

I cannot seem to use the plugin, I keep getting a "Failed to send notification!" when hitting the test button. I assume I've set something up wrong, but there isn't much to setup :/

I tried using both a token and a webhook. TeamCity version: 9.1 (build 36973)

Stacktrace from teamcity-server.log:

java.io.IOException: Attempted read from closed stream.
    at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:167)
    at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.Reader.read(Reader.java:140)
    at org.apache.http.util.EntityUtils.toString(EntityUtils.java:244)
    at org.apache.http.util.EntityUtils.toString(EntityUtils.java:288)
    at slacknotifications.SlackNotificationImpl.postViaApi(SlackNotificationImpl.java:198)
    at slacknotifications.SlackNotificationImpl.post(SlackNotificationImpl.java:152)
    at slacknotifications.teamcity.extension.SlackNotifierSettingsController.handleTestNotification(SlackNotifierSettingsController.java:119)
    at slacknotifications.teamcity.extension.SlackNotifierSettingsController.doHandle(SlackNotifierSettingsController.java:74)
    at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:78)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:154)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:22)
    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:1)
    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:7)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at jetbrains.buildServer.diagnostic.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:37)
    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:25)
    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:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

Administration Section Missing

I installed the plugin a couple months ago and it's been working great. I decided to rotate my API token due to the recent Slack security breach, but when I go to TeamCity, the Slack Notifications section is not on the Admin Page.

Is this expected behavior (once it's configured, the admin section disappears) or am I missing a step?

Great plugin, btw.

tomcat6 support

Hi
I've faced problem with tomcat6.
tomcat6 can't find custom EL function without prefix.
Do you have plan to support tomcat6?

tomcat6 log

May 04, 2015 9:50:43 AM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet buildServer threw exception org.apache.jasper.JasperException: /plugins/tcSlackNotifications/SlackNotification/projectSlackNotificationTab.jsp(14,4) The function isEnabled must be used with a prefix when a default namespace is not specified at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) at org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1528) at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:131) at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:206) at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:248) at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:56) at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:206) at org.apache.jasper.compiler.Validator$ValidateVisitor.validateFunctions(Validator.java:1553) at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1326) at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1176) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:859) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:859)

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.