alexkvak / teamcity-slack

TeamCity Slack plugin
MIT License
124 stars 23 forks source link

Plugin does not work when TeamCity is deployed to a context path other than root #53

Closed timgoodchild closed 5 years ago

timgoodchild commented 5 years ago

Firstly, good work on the plugin. I started looking at this plugin due to the branch regex feature.

My production TeamCity instance is deployed onto a "teamcity" context path and unfortunately the plugin does not work in this scenario. I also created a new local instance without an nginx proxy and found the same issues.

1) On the Slack admin config page it is possible to save the config however the redirect url is missing the context and so the following is shown:-

image

2) The Slack tab on the build settings does not load, due to an error:-

image

In the server log, I see:-

WARN - ework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/teamcity/teamcity/app/slackIntegration/buildSettingList.html] in DispatcherServlet with name 'buildServer'

It's clear from this that the context path is being duplicated resulting in an invalid URL.

I have a fix for both these issues and I'm now using the plugin without issues in my production instance. I'll submit a PR but please do run some tests to confirm that everything is working as expected with and without a context path.