kria / tfsnotificationrelay Goto Github PK
View Code? Open in Web Editor NEWAn extensible plugin for TFS that sends notifications to Slack, HipChat and IRC
License: GNU General Public License v3.0
An extensible plugin for TFS that sends notifications to Slack, HipChat and IRC
License: GNU General Public License v3.0
how would this work for hosted tfs?
The ability to send work item comments (WorkItemComment) is great but the value is diluted as we can get flooded with changeset comments associated these work items.
Example:
Tom commented on Product Backlog Item #35367 - xxxxxxxx
Comment
Associated with changeset 10892: xxxxxxxxx
Would it be possible to add an option to filter the changeset comments out, so that we only receive real work items comments?
Hey Kria,
I'm working to extend the Notificator to send a message to a server when a build is complete. It is not working, and when I checked the viewer/windows logs/application, I saw this error message:
Detailed Message: The subscriber TfsNotificationRelay raised an exception while being notified of event Microsoft.TeamFoundation.WorkItemTracking.Server.WorkItemChangedEvent.
Exception Message: Object reference not set to an instance of an object. (type NullReferenceException)
[...]
c:\repos\TfsNotificationRelay\TfsNotificationRelay\EventHandlers\BaseHandler.cs:line 80
Apparently, it's a problem in Base Handler, at line 80, which is
timer.Start();
Do u have any idea about what could be making this error to happen?
I also would like to say thanks for your great work in this Notificator. It have been helping me a lot to understand the TFS notification system.
Thank you,
Bruno.
Hello,
Any chance you would dual license your tech with either MIT or Apache 2.0? Can't use the GNU licenses where I work.
Thanks.
Hi,
I can't get the "GitPush" event to work in combination with the "gitRepository" filter.
Here is what works and what doesn't work:
I'm using TFS 2015 update 3 and TfsNotificationRelay.tfs2015-v1.18.0. As repository filter, I'm using a simple one word regex.
Could there be an issue there?
Thanks,
Guillaume
Will This work in TFS 2010?
Hi, first of all, congrats on a useful tool you build kria. I like the structure and it seems config should be pretty powerful as well. I've just got one small problem with it. It does nothing ! :D
I followed the instructions carefully. All is copied where it should be. Config file is setup with my unique webhook (I am trying to use it with slack) but I see nothing. I've enabled logfile but it's not even created. What would you recommend to check? We have 12.0.40629.0 (Tfs2013.Update5) installed.
Do it!
vNext builds aren't generating any notifications. Hopefully they've added a new event to subscribe to.
The images that post into the Slack channel appear to be broken.
https://s3-us-west-2.amazonaws.com/slack-files2/bot_icons/2015-05-20/4988082289_48.png
returns:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>BB2D45FAF1E035DF</RequestId>
<HostId>
s9nWq88O4Se+Lqm1BOj9FqRdFHKD+SlHdb2SFcMs6P+3yRfCkgTDiRlElEZfRmYkO69aznwkxxU=
</HostId>
</Error>
Hi, is it possible to add the feature to filter fields with specific value?
For example, only send updates of work items with "Release=xxxxxx".
Thank you,
It would be very beneficial if the notifier would also relay "Discussion Only" history items to slack. First, this would make it incredibly easy for my developers to keep up with activity on work items even if they don't change state. Second, this might also replace the lack of @mentions in TFS by allowing developers to @mention slack usernames in the TFS comments.
Great plugin, very much looking forward to implementing for all of our teams!
I recently upgraded to TFS 2015 and am now trying to get TFSNotificationRelay to work. It's not working, but when I try and enable tracing with the following.
DECLARE @traceId UNIQUEIDENTIFIER = NEWID()
EXEC prc_CreateTrace @traceId = @traceId, @area = 'TfsNotificationRelay'
Nothing happens. No log is created.
The released dll's do not work on TFS2015. After building a release version myself, the integration worked again.
Hi, I am trying to configure TfsNotificationRelay with TFS 2015.1 and Slack. I have followed the Installation guide from the Wiki word-for-word as well as enabled logging, and I am having no luck (also getting no logs).
I had a few questions regarding the configuration:
Thanks for any help you could provide!
I would like to request Rocket.Chat integration. There is definitely a need for it, if anyone fancies implementing it, it would be great.
My configuration by userMaps
Below screen shot
Result below, It have no highlight
Full DevCore.TfsNotificationRelay.dll.config on below
DevCore.TfsNotificationRelay.dll.txt
ref:
#25
https://github.com/kria/TfsNotificationRelay/wiki/Installation
How to do can display highlight or "@" in Slack?
It is possible to implement recovery of associated changeset in BuildCompleteNotification? With the changeset number, User, and comantário (limiting the characters)
Add config examples that start at bare minimum along with full featured examples
After installing on my TFS 2013 server, I received the following error:
TF400443: Failure loading extensions of type Microsoft.TeamFoundation.Framework.Server.IEnsureMachineExistsExtension, Microsoft.TeamFoundation.Framework.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Plugin directory = D:\Program Files\Microsoft Team Foundation Server 12.0\Application Tier\Web Services\bin\Plugins.
Any thoughts about what be causing it?
I have forked and am starting to implement Team Support. The scenario is that we have different teams within our TFS and we have matching team slack channels. So I only want checkins from team members in Team A to go to the Team A slack channel.
I have basically finished it, but wanted to open this issue up to open discussion.
I'd like to start using all the neat C# 6 features (in both the 2013 and 2015 branches). This means that Visual Studio 2015 will be needed in order to build the source. The project will still target .NET 4.5.
If someone has a problem with this, speak up!
Great plugin! But what I'm missing is work item type filtering. We use work items solely for code reviews, and those generate two work items per review: a request and a response. But only the response is interesting from a Slack point of view.
I've already added the support in a fork and will create a pull request for it.
The plugin doesn't work with the next major version of TFS.
This appears to be a similar issue to #49 where the new update appears to have changed the interface again. Looking in the Event log we get this exception:
TF53010: The following error has occurred in a Team Foundation component or extension:
Date (UTC): 7/19/2017 9:57:37 AM
Machine: <removed>
Application Domain: /LM/W3SVC/2/ROOT/tfs-8-131449300951399158
Assembly: Microsoft.TeamFoundation.Framework.Server, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v4.0.30319
Service Host: <removed>
Process Details:
Process Name: w3wp
Process Id: 6132
Thread Id: 4224
Account name: <removed>
Detailed Message: The subscriber TfsNotificationRelay raised an exception while being notified of event Microsoft.VisualStudio.Services.CodeReview.Discussion.WebApi.Events.DiscussionsNotification.
Exception Message: Method not found: 'Microsoft.TeamFoundation.Git.Server.CommitMetadataAndChanges Microsoft.TeamFoundation.Git.Server.ITeamFoundationGitCommitService.GetCommitManifest(Microsoft.TeamFoundation.Framework.Server.IVssRequestContext, Microsoft.TeamFoundation.Git.Server.ITfsGitRepository, Microsoft.TeamFoundation.Git.Server.Sha1Id)'. (type MissingMethodException)
Exception Stack Trace: at DevCore.TfsNotificationRelay.EventHandlers.DiscussionsHandler.CreateNotifications(IVssRequestContext requestContext, DiscussionsNotification args, Int32 maxLines)
at DevCore.TfsNotificationRelay.EventHandlers.BaseHandler.ProcessEvent(IVssRequestContext requestContext, NotificationType notificationType, Object notificationEventArgs, Int32& statusCode, String& statusMessage, ExceptionPropertyCollection& properties)
at Microsoft.TeamFoundation.Framework.Server.TeamFoundationEventService.SubscriptionList.Notify(IVssRequestContext requestContext, NotificationType notificationType, Object notificationEventArgs, String& statusMessage, ExceptionPropertyCollection& properties, Exception& exception)
Hello,
I had two slack notification at C:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\Web Services\bin\Plugins\DevCore.TfsNotificationRelay.dll.config
First below:
Second below:
If I change task at THS.Security project, I will receive two notification.
How do I receive a notification?
Hi,
I still can't get reliable tracing. I'm trying to debug an issue by using the tracing, but whenever I make a change to the config and save, I then get nothing in either the Application Log or the TFS log.
I am triggering events and monitoring the logs, but nothing appears at all. I would have expected to either see an error loading the plugin in the Application Log or start seeing the "ProcessEvent" trace notifications in the TFS log.
Do you have any ideas?
FYI - Alerts aren't coming through either. I think the plugin is failing somewhere, but I get no alerts.
using 1.17.0 for TFS 15 receiving the following when a notification attempts to send.
Was working fine in TFS2015 with previous notifcationrelay version, prior to upgrading to TFS 2017
Detailed Message: TfsNotificationRelay: Notify failed for bot hipChat.
Exception Message: One or more errors occurred. (type AggregateException)
Exception Stack Trace: at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at DevCore.TfsNotificationRelay.HipChat.HipChatNotifier.<>c.<NotifyAsync>b__0_0(Task
1 t)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DevCore.TfsNotificationRelay.HipChat.HipChatNotifier.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DevCore.TfsNotificationRelay.EventHandlers.BaseHandler.d__11.MoveNext()
Inner Exception Details:
Exception Message: An error occurred while sending the request. (type HttpRequestException)
Exception Stack Trace:
Inner Exception Details:
Exception Message: The underlying connection was closed: An unexpected error occurred on a send. (type WebException)Exception Stack Trace: at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
Inner Exception Details:
Exception Message: Authentication failed because the remote party has closed the transport stream. (type IOException)
Exception Stack Trace: at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
This new feature (2017.2) where you can resolve comments, creates two 'commented on' notifications. Could be handled better.
Hi,
If I upgrade to update1, I will not receive notification from the TfsNotificationRelay.
Trying to use with self-hosted version of TFS 2017. About page shows the following:
Microsoft Visual Studio Team Foundation Server
Version 15.105.25910.0
Previous versions worked great with TFS 2015! Thanks!
Thank you for developing TfsNotificationRelay – very interesting tool for TFS,
but I there's problem with vNext builds.
I’ve installed TfsNotificationRelay v1.15.0 on TFS 2015.1.
but it sends post on Slack **only after XAML builds **
After vNext build: no post on Slack and error in Event Viewer:
TF53010: The following error has occurred in a Team Foundation component or extension:
. . .
Detailed Message: TfsNotificationRelay: Notify failed for bot slack5.
Exception Stack Trace: at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at DevCore.TfsNotificationRelay.Slack.SlackNotifier.<>c.<NotifyAsync>b__0_0(Task
1 t)
. . .
Exception Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond …:… (type SocketException) . . .
Full error from Event Log:
VNext_Slack_ERROR.txt
My system: TFS server: Windows Server 2012 R2 Standard,
TFS 2015 14.0.24712.0 (Tfs2015.Update1); SQL Server 2014 (64-bit)
Build machines: Windows Server 2008 R2 Standard, TFS 2012 Up. 2
What's your guess - why it works for XAML builds only ?
Slack recently added a max-width to attachments, which doesn't go well with the git commit rows imo. Move them out of attachments or something.
Hello,
I had two slack notification at C:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\Web Services\bin\Plugins\DevCore.TfsNotificationRelay.dll.config
First below:
<bot id="ths-security-slack" type="DevCore.TfsNotificationRelay.Slack.SlackNotifier, DevCore.TfsNotificationRelay.Slack" textId="slacktext" userMapId="slackusers">
<botSettings>
<add name="webhookUrl" value="bla~bla~" />
<add name="channels" value="#infrastructures-build" />
<!-- one or many comma-separated channels -->
<add name="username" value="THS.Security.dll" />
<add name="iconEmoji" value="" />
<add name="iconUrl" value="" />
<add name="standardColor" value="#68217a" />
<add name="successColor" value="#1cb841" />
<add name="errorColor" value="#ca3c3c" />
<add name="wiCreatedDisplayFields" value="System.AreaPath, System.IterationPath, System.State, System.Reason, System.AssignedTo" />
<add name="wiChangedDisplayFields" value="System.AreaPath, System.IterationPath, System.State, System.Reason, System.AssignedTo" />
</botSettings>
<eventRules>
<rule notify="true" events="All" teamProjectCollection="" teamProject="" teamName="THS.Security" gitRepository="" gitBranch="" gitTag="" areaPath="" workItemType="" workItemfields="System.State, System.AssignedTo" sourcePath="" buildDefinition="" buildStatuses="All" />
</eventRules>
</bot>
Second below:
<bot id="ths-security-sso-slack" type="DevCore.TfsNotificationRelay.Slack.SlackNotifier, DevCore.TfsNotificationRelay.Slack" textId="slacktext" userMapId="slackusers">
<botSettings>
<add name="webhookUrl" value="bla~bla~" />
<add name="channels" value="#sso-build" />
<!-- one or many comma-separated channels -->
<add name="username" value="SSO" />
<add name="iconEmoji" value="" />
<add name="iconUrl" value="" />
<add name="standardColor" value="#68217a" />
<add name="successColor" value="#1cb841" />
<add name="errorColor" value="#ca3c3c" />
<add name="wiCreatedDisplayFields" value="System.AreaPath, System.IterationPath, System.State, System.Reason, System.AssignedTo" />
<add name="wiChangedDisplayFields" value="System.AreaPath, System.IterationPath, System.State, System.Reason, System.AssignedTo" />
</botSettings>
<eventRules>
<rule notify="true" events="All" teamProjectCollection="" teamProject="THS.Security.SSO" teamName="THS.Security.SSO" gitRepository="" gitBranch="" gitTag="" areaPath="" workItemType="" workItemfields="System.State, System.AssignedTo" sourcePath="" buildDefinition="" buildStatuses="All" />
</eventRules>
</bot>
If I change task at THS.Security project, I will receive two notification.
How do I receive a notification?
Add support for Microsoft Teams
We have been using the Slack integration for a few months with some success. A week ago we updated to v1.13, and started receiving triplicate entries in the channel for each update. Today we tried 1.14, and now are getting four entries for each update. The config file, which has separate bots - sharing one webhookUrl value - for each event, didn't change in between 1.13 and 1.14.
Is there a step in the install routine that I've missed, or some other oversight on my part?
The current version seems to see all notifications to one single room in HipChat. Would really be useful if it can support TFS project to HipChat room mapping, so the notifications for a specific project would go to a project specific room in HipChat.
There are a few major breaking changes in Update 1.
Is there a way or do you plan to create an event that triggers only when tagged commits are made using GIT? It would allow notifying continues integration services like Jenkins.
Hey kria,
First of all I wanted to really thank you for your work! TfsNotificationRelay is great and we're having good success with it for the most part.
We have 3 team projects. I've set up the regex for them and have gone from very specific to very broad catch-all regexes to see if it makes a difference, but it doesn't seem to.
2 of the projects send out the alerts just fine. 1 one of them remains stubborn. The only difference that jumps out between these is the project template. The team project giving us issues was set up over a year ago with a different template (and in fact, under an older version of TFS, I think it was 2012) than the other two (both of which work just fine). Do you have any idea if this could affect which events are dispatched to TfsNotificationRelay, and if so, if there's a way to ensure these are set up?
We're currently running TFS 2013.2. If there's anything I can do on my end to troubleshoot this let me know.
Thanks for any help, and thanks again for your work on this!
With a go-live release getting closer, it's about time I look at running the plugin on TFS 2015. Separate releases for 2013 and 2015 will probably be necessary because of breaking changes.
Hi, this is almost certainly a config issue, so i'd appreciate some help please....
Using TFS 2015 Update 2, patch 1.
Installed as directed on Wiki page for vNext Builds and regular TFS interaction. Currently only getting personal DMs for build statuses, nothing for Work Item assignments etc.
Using default configuration as follows:
<bot id="slackdm" type="DevCore.TfsNotificationRelay.Slack.DirectMessageNotifier, DevCore.TfsNotificationRelay.Slack" textId="slacktext" userMapId="slackusers">
<botSettings>
<add name="token" value="XXXXXXXXXXTOKEN HEREXXXXXXXXXXX" />
<add name="standardColor" value="#68217a" />
<add name="successColor" value="#1cb841" />
<add name="errorColor" value="#ca3c3c" />
<add name="wiCreatedDisplayFields" value="System.AreaPath, System.IterationPath, System.State, System.Reason, System.AssignedTo"/>
<add name="wiChangedDisplayFields" value="System.AreaPath, System.IterationPath, System.State, System.Reason, System.AssignedTo"/>
</botSettings>
<eventRules>
<rule notify="true" events="All" teamProjectCollection="" teamProject="" teamName="" gitRepository="" gitBranch="" gitTag="" areaPath="" workItemType="" workItemfields="System.State, System.AssignedTo" sourcePath="" buildDefinition="" buildStatuses="All" />
</eventRules>
</bot>
Some breaking changes to fix.
I was thinking about extending the logging to have log levels. That way it would be possible to leave logging on without having to create huge log files.
Trace
Info
Warning
Error
Let me know if this would be worthwhile.
It would be great to have a filter on specific users on any WorkItem*
events.
Use case - 100 work items were included in the most recent build. When the build completes all 100 work items are updated and commented on. I want to filter those notifications out.
Hi!
Is there a way to set up a notification to be sent on push to a specific git branch?
I could only find gitRepository
attribute in rule configuration, it would be great if a branch name could be specified there as well.
Hopefully the new release management that came in TFS 2015.2 has some events to catch.
More specifically trying to use Microsoft.VSTS.Common.Priority and Microsoft.VSTS.Common.Severity.
The commit row ordering is messed up since last release. Something to do with the UTC change? I want the head of the branch to be on top and the commits in the same order as they would appear in 'git log'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.