Giter VIP home page Giter VIP logo

teamcity-slack's People

Contributors

adbrvn avatar alexkvak avatar alextim-empawa avatar ansman avatar danatkinson avatar dev704 avatar freakmoder avatar ianleeclaxton avatar lazytarget avatar oskarrisberg avatar queen-of-code avatar timgoodchild avatar tomtasche 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

teamcity-slack's Issues

Move build notification config to build features section

We want to use slack notification configs in build templates. This could be done by moving configuration into the build settings at build feature section.

This solution will make possible to copy build config with notification configs inside.

Unable to get a positive result with the "try it" functionality

Hi,
Version used: 1.1.5
I've configured slack according to the documentation, including the oAuth token.
It even seems to be connected with slack, since when i'm entering a non existing channel, i get an error, and if the channel exist, i'm able to save the configuration.

Configuration:
image

But when the build is executed, no message is sent to slack.
When i press the "Try it" button, which most likely should send a default message to the configured slack channel, it just spins forever:
image

Any hints what's wrong here?

Plugin unable to rout to server

When attempting to setup the plugin any attempts by the modify the plugin's setting/access the Slack tab in the project tries to access the wrong IP address. When trying to submit plugin settings I get redirected to the wrong IP (plugin attempts to connect to 10.1.2.55 when my IP is 10.1.2.134).

I was able to modify the form action (pictured below) using Chrome Dev Tools to correct the IP address and the form submitted correctly.
image

Looking at the network calls when selecting the Slack tab in a project and it appears that they are also using the same incorrect IP address.

I attempted to restart the TeamCity service in hopes that this was just an odd Java environment issue, but this did not help.

TeamCity version used: 2017.2.2

{users} field is not returned

Maybe I do not understand the set up enough but when using the following template the {users} field is not populated when builds fail and the 'personal' slack notification is not sent.

<{link}|{name} - #{number}>
Status: {status}
{users}
{reason}

Notes:

  • users are set up with the same email address in TeamCity as in Slack
  • Administration > Slack > Personal notifications enabled (only if build fails) - is checked.

why is branch a required field

Branch is a required field. Why?

We have TeamCity configurations without any repository behind.
They are set up as nightly test runs based on some artifact dependencies from other builds.

Feature branches notifications

Case
There are feature branches in project. It's needed to notify feature developer about failed builds.

Solution
Let's add checkbox in build settings that allows plugin to notify code authors according to those settings rules. Additionally channel name become non-required.
Note that global setting "Personal notifications enabled (only if build fails)" will also work and not duplicate notifications about build failures.

Allow alerts for builds with no branch or vcs root

First off, thank you for making this plugin. My team loves it.

I was wondering if it is possible to allow alerting for build tasks that do not have vcs roots configured. For example, one of our TeamCity build projects does not have a vcs root. It just performs one or more tasks.

Thanks!

Plugin doesn't save config when the server is not in the root

The settings page will not post to the proper url when teamcity is installed on a path other than root. For example on server.com/tc/app/...

The form to save config posts to "/app". I believe changing the action of this form to include the Server Global Setting "Server URL" would fix the issue.

Doesn't seem to build in windows

I could be wrong, but i don't think this project builds properly in windows because of some funky lineendings in the MessageBuilderTest. Three in total. I ran into this when trying to package it on my dev-machine after making some additions. Looked strange as i hadn't touched these classes. :)
In windows the multiline strings seem to create other line-endings than regular strings. (Using regular strnigs resolves the problem)

Example of a failing test

"MessageBuilder.compile" should "compile template with artifactsRelUrl placeholders" in {
    implicit val build = stub[SBuild]

    build.getFullName _ when() returns "Full name"
    build.getBuildNumber _ when() returns "2"
    build.getBuildStatus _ when() returns Status.NORMAL
    build.getContainingChanges _ when() returns mockChanges
    build.getArtifactsDirectory _ when() returns new File("/full/artifacts/path/my/build/folder/")

    val messageTemplate = """{name}
                            |{artifactsRelUrl}
                          """.stripMargin

    messageBuilder(artifactsPath = "/full/artifacts/path/").compile(messageTemplate) shouldEqual 
    SlackAttachment(
      s"""Full name
        |my/build/folder
      """.stripMargin.trim, MessageBuilder.statusNormalColor)
  }

The failing tests in Maven

MessageBuilder.compile
- should compile template with changes placeholders *** FAILED ***
  SlackAttachment(Full name

  - Did some changes Second line [name1]
  - Did another changes [name2],#ed2c10) did not equal SlackAttachment(Full name

  - Did some changes Second line [name1]

  - Did another changes [name2],#ed2c10) (MessageBuilderTest.scala:121)
- should compile template with artifactsRelUrl placeholders *** FAILED ***
  SlackAttachment(Full name

  fullartifactspathmybuildfolder,#02c456) did not equal SlackAttachment(Full name

  my/build/folder,#02c456) (MessageBuilderTest.scala:197)
- should compile template with artifactLinks placeholder *** FAILED ***
  SlackAttachment(Full name

  https://team.city/download/directory/artifact.txt
  https://team.city/download/directory/folder/artifact2.txt,#02c456) did not equal SlackAttachment(Full name

  https://team.city/download/directory/artifact.txt

  https://team.city/download/directory/folder/artifact2.txt,#02c456) (MessageBuilderTest.scala:302)

Getting 403 Forbidden when configuring the plugin after installation

  1. Installed the plugin
  2. Opened slack admin page
  3. Entered OAuth token
  4. Entered Sender Name
  5. Click Submit

Getting this below error.

403 Forbidden: Responding with 403 status code due to failed CSRF check: request's "Origin" header value "null" does not match Host/X-Forwarded-Host header values or server's CORS-trusted hosts, consider adding "Origin: http://<my_teamcity_server>.ca.com" header.

Error adding Slack to project

I'm having trouble adding a channel for the notifier. I have the OAuth key entered for our site, and I've made a channel #build-status which the app bot has joined, but it does not seem to recognize the channel. Not sure what to do -- any help?

image

image

Something went wrong

I'm not sure if I'm misunderstanding the instructions, but I can't get this to work. When I click "Try" I get the message "Something went wrong".

I followed the instructions for Slack, making sure that I'm using the bot key, and the channel without the "#".

Is the public artifact URL necessary? I tried mydomain.com/system/artifacts but I get nothing. I'm using the newest version of TeamCity running on AWS.

Plugin does not apply teamcity proxy settings

  1. Created a new app on api.slack.com
  2. Activated the feature incoming webhooks
  3. Added a bot users
  4. Installed the app into the channel.
  5. Copied the bot user oauth access token.

Result: Unable to create session by config

"Try it" fails to return

Hi there

After setting up the application and bot, I wanted to test my configuration with "Try it" on a build configuration, the "Sending..." pop up box hangs and the stack trace below is output in teamcity-server.log
Seems to be during compilation of a regex (I used ".*")
Of note: I am using svn as a repo and it's unclear to me what "branch" means in svn, which is why i used ".*"

ERROR -   jetbrains.buildServer.SERVER - Error java.lang.NullPointerException while processing request: POST '/app/slackIntegration/buildSettingTry.html?id=XXXX', from client X.X.X.X:55244, authenticated as 'xxxx' {id=1} 
java.lang.NullPointerException
        at com.fpd.teamcity.slack.MessageBuilder.$anonfun$compile$9(MessageBuilder.scala:59)
        at scala.Option.map(Option.scala:146)
        at com.fpd.teamcity.slack.MessageBuilder.$anonfun$compile$8(MessageBuilder.scala:59)
        at scala.util.matching.Regex.$anonfun$replaceAllIn$1(Regex.scala:491)
        at scala.collection.Iterator.foreach(Iterator.scala:929)
        at scala.collection.Iterator.foreach$(Iterator.scala:929)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1406)
        at scala.util.matching.Regex.replaceAllIn(Regex.scala:491)
        at com.fpd.teamcity.slack.MessageBuilder.compile(MessageBuilder.scala:56)
        at com.fpd.teamcity.slack.controllers.BuildSettingsTry.$anonfun$handle$4(BuildSettingsTry.scala:31)
        at scala.Option.flatMap(Option.scala:171)
        at com.fpd.teamcity.slack.controllers.BuildSettingsTry.$anonfun$handle$2(BuildSettingsTry.scala:30)
        at scala.Option.flatMap(Option.scala:171)
        at com.fpd.teamcity.slack.controllers.BuildSettingsTry.$anonfun$handle$1(BuildSettingsTry.scala:29)
        at scala.Option.flatMap(Option.scala:171)
        at com.fpd.teamcity.slack.controllers.BuildSettingsTry.handle(BuildSettingsTry.scala:28)
        at com.fpd.teamcity.slack.controllers.SlackController.doHandle(SlackController.scala:17)
        at com.fpd.teamcity.slack.controllers.SlackController.doHandle$(SlackController.scala:15)
        at com.fpd.teamcity.slack.controllers.BuildSettingsTry.doHandle(BuildSettingsTry.scala:14)
        at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:75)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:147)
        at 
[...]

Icon and Display name not showing

Any idea what I'm doing wrong? I followed your setup instructions and it's all working except the bot is posting with a username of 'TeamCity' and with an icon of the Slack 'bots' integration.

The screenshot below shows that the display name and icon I've set isn't being used, any idea what to do?

https://i.imgur.com/ppnxa0K.png

Setup in TeamCity 2017 fails

After setup the OAuth access token, click save and the next message appears:

"Unable to create session by config"

Team city version ->

TeamCity 2017.1.5 (build 47175), effective release date 2017-Apr-10, currently running in the ...

Plugin fails to load config. Parsing failed

In our case we have slack channels with cyrillic chars in it like ит. It worked like charm before we restarted server. After server restart we got a plugin load error. Manually removing cyrillic chars from plugin's json config is a current solution.

Traceback:

[2017-12-26 09:03:07,796]   WARN - inLoader$TeamCityPluginContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.fpd.teamcity.slack.pages.BuildPage#0' defined in Byte array resource [plugin: Slack Integration#slackIntegration-server-1.0.0.jar!/META-INF/build-server-plugin-slackIntegration.xml]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.fpd.teamcity.slack.ConfigManager#0' defined in Byte array resource [plugin: Slack Integration#slackIntegration-server-1.0.0.jar!/META-INF/build-server-plugin-slackIntegration.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fpd.teamcity.slack.ConfigManager]: Constructor threw exception; nested exception is org.json4s.ParserUtil$ParseException: parsing failed 
[2017-12-26 09:03:07,803]  ERROR - gins.spring.SpringPluginLoader - Error loading plugin 'Slack Integration': Failed to initialize spring context: Error creating bean with name 'com.fpd.teamcity.slack.pages.BuildPage#0' defined in Byte array resource [plugin: Slack Integration#slackIntegration-server-1.0.0.jar!/META-INF/build-server-plugin-slackIntegration.xml]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.fpd.teamcity.slack.ConfigManager#0' defined in Byte array resource [plugin: Slack Integration#slackIntegration-server-1.0.0.jar!/META-INF/build-server-plugin-slackIntegration.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fpd.teamcity.slack.ConfigManager]: Constructor threw exception; nested exception is org.json4s.ParserUtil$ParseException: parsing failed 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.fpd.teamcity.slack.pages.BuildPage#0' defined in Byte array resource [plugin: Slack Integration#slackIntegration-server-1.0.0.jar!/META-INF/build-server-plugin-slackIntegration.xml]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.fpd.teamcity.slack.ConfigManager#0' defined in Byte array resource [plugin: Slack Integration#slackIntegration-server-1.0.0.jar!/META-INF/build-server-plugin-slackIntegration.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fpd.teamcity.slack.ConfigManager]: Constructor threw exception; nested exception is org.json4s.ParserUtil$ParseException: parsing failed
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at jetbrains.buildServer.plugins.spring.SpringPluginLoader.pluginClassesLoaded(SpringPluginLoader.java:102)
	at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at jetbrains.buildServer.util.EventDispatcher$3.run(EventDispatcher.java:126)
	at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:71)
	at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:120)
	at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:70)
	at com.sun.proxy.$Proxy25.pluginClassesLoaded(Unknown Source)
	at jetbrains.buildServer.plugins.PluginManagerImpl$2.visitPlugin(PluginManagerImpl.java:140)
	at jetbrains.buildServer.plugins.PluginsCollection$6.run(PluginsCollection.java:261)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.fpd.teamcity.slack.ConfigManager#0' defined in Byte array resource [plugin: Slack Integration#slackIntegration-server-1.0.0.jar!/META-INF/build-server-plugin-slackIntegration.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fpd.teamcity.slack.ConfigManager]: Constructor threw exception; nested exception is org.json4s.ParserUtil$ParseException: parsing failed
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:279)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
	... 28 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fpd.teamcity.slack.ConfigManager]: Constructor threw exception; nested exception is org.json4s.ParserUtil$ParseException: parsing failed
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)
	at jetbrains.buildServer.spring.InstantiationStrategySelector$1.instantiate(InstantiationStrategySelector.java:77)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
	... 41 more
Caused by: org.json4s.ParserUtil$ParseException: parsing failed
	at org.json4s.native.JsonParser$.parse(JsonParser.scala:134)
	at org.json4s.native.JsonParser$.parse(JsonParser.scala:80)
	at org.json4s.native.JsonMethods.parse(JsonMethods.scala:13)
	at org.json4s.native.JsonMethods.parse$(JsonMethods.scala:9)
	at org.json4s.native.JsonMethods$.parse(JsonMethods.scala:63)
	at com.fpd.teamcity.slack.ConfigManager.readConfig(ConfigManager.scala:28)
	at com.fpd.teamcity.slack.ConfigManager.<init>(ConfigManager.scala:25)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
	... 44 more
Caused by: java.nio.charset.MalformedInputException: Input length = 1
	at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.io.BufferedReader.read1(BufferedReader.java:212)
	at java.io.BufferedReader.read(BufferedReader.java:286)
	at org.json4s.ParserUtil$Buffer.read(ParserUtil.scala:165)
	at org.json4s.ParserUtil$Buffer.next(ParserUtil.scala:113)
	at org.json4s.native.JsonParser$Parser.nextToken(JsonParser.scala:271)
	at org.json4s.native.JsonParser$.$anonfun$astParser$1(JsonParser.scala:186)
	at org.json4s.native.JsonParser$.$anonfun$astParser$1$adapted(JsonParser.scala:143)
	at org.json4s.native.JsonParser$.parse(JsonParser.scala:131)
	... 55 more

weird OutOfMemoryError?

Hi.
I changed Slack OAuth Access Token in Administration and it throws TeamCity error when I click Save button.
my server has 50% memory usage (more than 200MB free memory)

TeamCity Diagnostics shows 100MB memory increases after the crisis.

Do you have any idea?

Trace: java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:3332)
	at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
	at java.lang.StringBuilder.append(StringBuilder.java:136)
	at ch.qos.logback.core.pattern.FormattingConverter.write(FormattingConverter.java:40)
	at ch.qos.logback.core.pattern.PatternLayoutBase.writeLoopOnConverters(PatternLayoutBase.java:119)
	at ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:149)
	at ch.qos.logback.classic.PatternLayout.doLayout(PatternLayout.java:39)
	at ch.qos.logback.core.encoder.LayoutWrappingEncoder.doEncode(LayoutWrappingEncoder.java:134)
	at ch.qos.logback.core.OutputStreamAppender.writeOut(OutputStreamAppender.java:194)
	at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:219)
	at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103)
	at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88)
	at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
	at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:273)
	at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260)
	at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442)
	at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
	at ch.qos.logback.classic.Logger.debug(Logger.java:503)
	at com.ullink.slack.simpleslackapi.impl.SlackJSONSessionStatusParser.parse(SlackJSONSessionStatusParser.java:67)
	at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl.connectImpl(SlackWebSocketSessionImpl.java:313)
	at com.ullink.slack.simpleslackapi.impl.SlackWebSocketSessionImpl.connect(SlackWebSocketSessionImpl.java:285)
	at com.fpd.teamcity.slack.SlackGateway.$anonfun$sessionByConfig$2(SlackGateway.scala:97)
	at com.fpd.teamcity.slack.SlackGateway$$Lambda$1919/892078448.apply$mcV$sp(Unknown Source)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at scala.util.Try$.apply(Try.scala:209)
	at com.fpd.teamcity.slack.SlackGateway.sessionByConfig(SlackGateway.scala:97)
	at com.fpd.teamcity.slack.controllers.ConfigController.$anonfun$handle$1(ConfigController.scala:33)
	at com.fpd.teamcity.slack.controllers.ConfigController$$Lambda$2198/1736282298.apply(Unknown Source)
	at scala.Option.map(Option.scala:146)
	at com.fpd.teamcity.slack.controllers.ConfigController.handle(ConfigController.scala:27)
	at com.fpd.teamcity.slack.controllers.SlackController.doHandle(SlackController.scala:17)

Multiple slack teams

Hi. I have several slack teams for several projects in teamcity.
How can i setup URL for each team per project?

No preview available

Hello.
All notification has no preview - [no preview available]. I using default text from your example.
Is it fixable by my side?

Personal build notifications aren't getting through

I installed the plug-in and enabled personal notifications. I also set up the Slack notifier on my profile to send a notification on any build, default branch, whenever the build starts, just as a test. But I don't get any notifications on Slack. Just wondering if I'm missing something.

The Slack notifications for specific build configurations, as outlined in the documentation, work fine.

Cannot configure plugin OAuth token

Hi, I'm trying to use your plugin for slack notifications from team city, but I can't seem to get the configure to work successfully. The plugin installed correctly (I used your prebuilt 1.0 release, uploaded the zip to teamcity and restarted). As directed by the instructions, I went to Administration -> Slack, and checked the Enabled button, which presented me with the OAuth token field. I entered my xoxp-******* token, and clicked Submit. Every time, I get the error "Unable to create session by config" returned to me. I've tried numerous times, verified the app install and OAuth token (another plugin can use it to post to my build channel successfully), and restarted TeamCity multiple times. It would be great to get this plugin working, as I prefer the customization options over the alternatives.

Thank you,
Graham

{mentions} int the Slack message

Hi!

Great plugin! I have a quick question:

How does plugin determine Slack user name so it work with message?

{mentions} - Slack users mentions only if build fails. Unknown users will be skipped.

Also - in the global notification rules I specified notify if failed build is assign to me... And I have yet to receive any notification in my tests... I am sure it has something to do with TeamCity to Slack user names...

Thanks!

Andrew

Failure -> success and success -> failure transition does not consider branch mask

Given.
One configuration for several branches and several slack notification configurations for each branch.
At least one slack notification configurations triggers only if build status changed.

Problem.
In this case plugin should look up through the history and apply branch from current build to find the previous build properly.

Master branches are always unknown

I have set up several projects now and they all have unknown master branches in this plugin. When I look in bitbucket I see that they in fact are named "master".

Try it sends notification for wrong branch

Given.
Slack notifications is set for branch dev.
Last successful build was on master branch.
User click Try it and becomes message about master branch's build.
Expected.
User becomes message about dev branch's build.

Personal notifications don't work

Hello,

I just installed this plugin and it's functionality works ok for channels. However it is not sending any private notifications. Are there any prerequisites or additional configuration to set?

Cheers,
Martyna

Error: Previous build not found

Hi, we're using TeamCity Professional 2018.1.2 (build 58537)
Has two branches for build:
default branch name: refs/heads/master and refs/heads/dev with no branch specification filled
With branch in slack config: master, refs/heads/master,
when I'm try — previous build not found, but there is a lot of them.
screen shot 2018-10-09 at 18 13 03

Multiply channels notification

Can you add possibility to notify each build step to more than one slack channel? Now plugin can notify to the one channel only.

Global setting sender name

By default plugin sends messages as app with "TeamCity".
We need to give an ability to change this name is global settings page.

Unable to create session by config: missing_scope

I am getting an error when saving the settings in Administration > Slack. It is possible that my TeamCity is quite out-dated (version 10), is there any fix without upgrading?

Unable to create session by config: missing_scope

Unable to send notification with custom teamcity placeholder

When i add to message template Triggered by: {%teamcity.build.triggeredBy.username%} ant try to test notification ("try it") i got server error 500 with Error: java.lang.NullPointerException

Trace: java.lang.NullPointerException
	at com.fpd.teamcity.slack.MessageBuilder$MessageBuilderContext.$anonfun$getBuildParameter$1(MessageBuilder.scala:112)
	at com.fpd.teamcity.slack.MessageBuilder.$anonfun$compile$8(MessageBuilder.scala:77)
	at scala.util.matching.Regex.$anonfun$replaceAllIn$1(Regex.scala:491)
	at scala.collection.Iterator.foreach(Iterator.scala:929)
	at scala.collection.Iterator.foreach$(Iterator.scala:929)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1406)
	at scala.util.matching.Regex.replaceAllIn(Regex.scala:491)
	at com.fpd.teamcity.slack.MessageBuilder.compile(MessageBuilder.scala:64)
	at com.fpd.teamcity.slack.controllers.BuildSettingsTry.$anonfun$handle$1(BuildSettingsTry.scala:46)
	at scala.util.Try$.apply(Try.scala:209)
	at com.fpd.teamcity.slack.controllers.BuildSettingsTry.handle(BuildSettingsTry.scala:36)
	at com.fpd.teamcity.slack.controllers.SlackController.doHandle(SlackController.scala:17)
	at com.fpd.teamcity.slack.controllers.SlackController.doHandle$(SlackController.scala:15)
	at com.fpd.teamcity.slack.controllers.BuildSettingsTry.doHandle(BuildSettingsTry.scala:21)
	at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:101)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:174)
	at jetbrains.buildServer.controllers.BaseController.handleRequest(BaseController.java:80)
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.processedByMainServlet(TeamCityDispatcherServlet.java:8)
	at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:4)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at jetbrains.buildServer.web.jsp.JspPrecompilerFilter.doFilter(JspPrecompilerFilter.java:161)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(DisableSessionIdFromUrlFilter.java:8)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107)
	at jetbrains.buildServer.diagnostic.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:46)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
	at jetbrains.buildServer.web.DependencyParametersCalculationContextFilter.doFilter(DependencyParametersCalculationContextFilter.java:10)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
	at jetbrains.buildServer.web.ContentSecurityPolicyFilter.doFilter(ContentSecurityPolicyFilter.java:2)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
	at jetbrains.buildServer.web.CSRFFilter.doFilter(CSRFFilter.java:100)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:112)
	at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73)
	at jetbrains.buildServer.web.DelegatingFilter.doFilter(DelegatingFilter.java:37)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:9)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:677)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)

Error during authentication : missing_scope

Hi,

I wasn't able to make this plugin work. When I apply Slack configuration it just goes back to "disabled" state with message: Unable to create session by config

Below catalina.out:

17:29:18.535 [TC: 17:29:18 POST '/app/slackIntegration/config?enabled=1&oauthKey=MY_TOKEN&senderName=&publicUrl=', from client 192.168.252.3:57842, authenticated as 'MY_USER' (MY_USER) {id=1}; http-nio-8111-exec-2] INFO  c.u.s.s.i.SlackWebSocketSessionImpl - connecting to slack
17:29:19.328 [TC: 17:29:18 POST '/app/slackIntegration/config?enabled=1&oauthKey=MY_TOKEN&senderName=&publicUrl=', from client 192.168.252.3:57842, authenticated as 'MY_USER' (MY_USER) {id=1}; http-nio-8111-exec-2] DEBUG c.u.s.s.i.SlackWebSocketSessionImpl - HTTP/1.1 200 OK
17:29:19.328 [TC: 17:29:18 POST '/app/slackIntegration/config?enabled=1&oauthKey=MY_TOKEN&senderName=&publicUrl=', from client 192.168.252.3:57842, authenticated as 'MY_USER' (MY_USER) {id=1}; http-nio-8111-exec-2] DEBUG c.u.s.s.i.SlackJSONSessionStatusParser - parsing session status : {"ok":false,"error":"missing_scope","needed":"rtm:stream","provided":"identify,incoming-webhook"}
17:29:19.329 [TC: 17:29:18 POST '/app/slackIntegration/config?enabled=1&oauthKey=MY_TOKEN&senderName=&publicUrl=', from client 192.168.252.3:57842, authenticated as 'MY_USER' (MY_USER) {id=1}; http-nio-8111-exec-2] ERROR c.u.s.s.i.SlackWebSocketSessionImpl - Error during authentication : missing_scope

Thanks!

Teamcity artifacts url is invalid

Hi,

I'm trying to get the APK link to sent to Slack by using https://github.com/alexkvak/teamcity-slack#artifactlinks

But the URL format sent to Slack is invalid, it sent like this:

http://<TeamCity_host_url>/repository/download/<BuildName>/<Environment>/<buildid>/my.apk

but the correct link format should be like this:

http://<TeamCity_host_url>/repository/download/<BuildName>_<Environment>/<buildid>:id/my.apk

Attach artifacts

Hi!
Thank you for this plugin.
Is it possible to attach the artifacts from TeamCity? URL link is fine but we have a lot of users in build chat who doesn't have access to TeamCity.
Kindly Regards

Try it for personal notifications

When build settings is set only for private notification, Try it should send probe message to current TeamCity user's Slack account.

Unable to set up correct branch

I have set up this plugin in teamcity, and it should post to slack when the build succeeds or fails. If I click the "Try it" link, it posts a message to the correct channel with the correct status, name and build number. The branch is set as unknown:

----------------
MyProject :: master - 79
Branch: Unknown
Status: succeeded

But when the build actually succeeds or fails, nothing happens in slack.

I have the following settings:

Branch: master
Slack channel: techfeed
And/or notify commiters: [x]
Message template: the default template
Trigger when build is successful: [x]
Trigger when build is failed: [x]

What am I supposed to put in the branch-field? I only want to trigger slack notifications for the master branch.

Timeout when submitting OAuth Access Token

I've followed the steps to make a slack app, activated incoming webhooks etc...

When I go to enter Bot User OAuth Access Token in the teamcity admin slack page, I click submit, but after about 15 seconds I get ERR_CONNECTION_TIMED_OUT page on chrome.

Have you run into this? Any guidance?

I'm using Teamcity 2017.1.3 along with v1.1.8 of your build

Thanks so much for your help.

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.