Code Monkey home page Code Monkey logo

tfsaggregator-webhooks's Introduction

This repository is no longer being used.

The TFS Aggregator Webhooks solution has been merged back into the tfsaggregator solution.

TFS Aggregator Webhooks.

This is an alternative version of TFS Aggregator that supports Visual Studio Team Services (VSTS). It can be used on premises also, starting from TFS 2015: you have to provide the hosting environment. You can reuse the existing Rules with minimal changes.

This is still a beta version, please provide feedback to the team!

Example Uses

  • Update the state of a Bug, PBI (or any parent) to "In Progress" when a child gets moved to "In Progress"
  • Update the state of a Bug, PBI (or any parent) to "Done" when all children get moved to "Done" or "Removed"
  • Update the "Work Remaining" on a Bug, PBI, etc with the sum of all the Task's "Work Remaining".
  • Update the "Work Remaining" on a Sprint with the sum of all the "Work Remaining" of its grandchildren (i.e. tasks of the PBIs and Bugs in the Sprint).
  • Sum up totals on a single work item (i.e. Dev Estimate + Test Estimate = Total Estimate)
  • Create new work items
  • Create new work item links

Documentation

The complete documentation is available on the project's Documentation Site.

Contributing to the Project

Please read the Contributing document.

tfsaggregator-webhooks's People

Contributors

dellingsworth avatar gitter-badger avatar giuliov avatar jessehouwing avatar jtheuner avatar rbanks54 avatar

Stargazers

 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

tfsaggregator-webhooks's Issues

Object reference not set to an instance of an object. (500)

Hey There,

My Webhook responds everytime with ( Object reference not set to an instance of an object. (500) )
Exception.

How can that Exception be thrown?

` var userStory = self.Parent;

            userStory["Microsoft.VSTS.Scheduling.CompletedWork"] =
                userStory.Children.Sum(task => task.GetField<double>("Microsoft.VSTS.Scheduling.CompletedWork", 0d));
            userStory["Microsoft.VSTS.Scheduling.OriginalEstimate"] =
                userStory.Children.Sum(taskk => taskk.GetField<double>("Microsoft.VSTS.Scheduling.OriginalEstimate", 0d));

`

The Code is very Simple and even provides an default Value.

TFS 2018 - collectionScope

Hi

I am unable to get collectionScope working in my policy file.

TFS URL: http:/source.company.com/tfs/APPS/APPS

Policy file:

  <policy name="PolicyRules">
    <collectionScope collections="APPS" />
    <projectScope projects="APPS" />
        
    <!-- Reference to a previously declared rule.-->
    <ruleRef name="SumTaskEstimatToParent" />
  </policy>

Response in log:
[Diagnostic] 00.910 5d59274b-ef95-41aa-926e-099ecdd4d452 Policy scope Collections(NCAPPS) does not match tfs

In my webconfig I have added the following:

  <appSettings>
    <add key="DefaultLoggingLevel" value="Diagnostic" />

	<system.diagnostics>
		<trace autoflush="true" indentsize="4">
		  <listeners>
			<add name="myListener" 
			  type="System.Diagnostics.TextWriterTraceListener" 
			  initializeData="E:\TfsAggregator\TextWriterOutput.log" />
			<remove name="Default" />
		  </listeners>
		</trace>
	  </system.diagnostics>

Not sure if more logging can be archived since not much is outputted in my log file. When using the server version I remember getting more information :)

Best regards
Mads

Not picking up changed policyFilePath

Hi,

I edited web.config to have a different static value for policyFilePath but it still keeps looking to HelloWorld.policies, even after I restarted the app service.

Aggregator Web App Response with 403 Error

We installed the Aggregator Web App as instructed and everything works great for a few days, then we started getting 403 (Site Disabled) response when the VSTS Web Hook tries to connect to the Aggregator Web App. Please advise.

Status Code: 403 Reason Phrase: Site Disabled HTTP Version: 1.1 Headers: { Date: Tue, 19 Jun 2018 20:40:21 GMT Server: Microsoft-IIS/10.0 Content-Length: 2399 Content-Type: text/html }

Azure Deployment Failed

Hi,

I have tried to use the Deploy to Azure option but receive the Deployment Failed message at the "Updating Website Config" stage the error message is "The current api-version doesn't support RBAC users. please use a newer version instead.(Code: Unauthorised)"

image

Thanks for any help you can provide
Dean

MakeNewWorkItem has bad code in it

public IWorkItem MakeNewWorkItem(string projectName, string workItemTypeName)
{
 if (string.IsNullOrWhiteSpace(projectName))
 {
                throw new ArgumentNullException(nameof(projectName));
            }
            if (string.IsNullOrWhiteSpace(workItemTypeName))
            {
                throw new ArgumentNullException(nameof(workItemTypeName));
            }
            var targetType = this.workItemStore.Projects[projectName].WorkItemTypes[workItemTypeName];
            var target = new WorkItem(targetType);
            IWorkItem justCreated = new WorkItemWrapper(target, this.context);
            this.createdWorkItems.Add(justCreated);
            return justCreated;
        }
        public IWorkItem MakeNewWorkItem(IWorkItem inSameProjectAs, string workItemTypeName)
        {
            if (inSameProjectAs == null)
            {
                throw new ArgumentNullException(nameof(inSameProjectAs));
            }
            return this.MakeNewWorkItem(workItemTypeName, inSameProjectAs[CoreFieldReferenceNames.TeamProject] as string);
        }

See above, the call in the overloaded public IWorkItem MakeNewWorkItem(IWorkItem inSameProjectAs, string workItemTypeName) has the strings in the wrong order

Setup failed

Pushed deploy to azure => seems to hang on this picture. With an angular error.

image

Pricing & Timescales

HI,
When will you be moving out of preview please, and what pricing do you expect to have past that point?
Thanks

Authentication fails against VSTS

Starting a few days ago, a client had the Aggregator start to fail against their VSTS account. I was able to track down the root cause to a "404" error when trying to connect back to VSTS with the URLs scraped from the JSON generated by the service hooks.

I identified the problem: The URI parsing logic strips off everything up to and including the _api part of the URI. In the case of VSTS, this now includes the Team Project GUID. As a result, trying to authenticate to that as though it was the Team Project Collection URI results in a 404 error.

Fixed in PR #21.

ProcessEvent for an event of type workitem.deleted causes Exception

Aggregator.Core.EventProcessor class crashes in the ProcessEvent method
IWorkItem workItem = this.store.GetWorkItem(notification.WorkItemId) when processing an event of type workitem.deleted with the following exception:

Error       [Critical]    00.182 12bff950-6070-4a18-922f-a3f200a305b0 Exception encountered processing notification: TF26198: The work item does not exist, or you do not have permission to access it. 
Stack Trace:   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.LoadWorkItemFromRowSetInternal(Int32 rev, Nullable`1 asof, IWorkItemRowSets witem)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem..ctor(WorkItemStore store, Int32 id)
   at Aggregator.Core.Facade.WorkItemRepository.GetWorkItem(Int32 workItemId)
   at Aggregator.Core.EventProcessor.ProcessEvent(IRequestContext requestContext, INotification notification)
   at Aggregator.WebHooks.Controllers.WorkItemController.Post(JObject payload)

Recommendation regarding new install on TFS 2018

Hi,

We are about to setup a new TFS 2018 installation, and would like to hear what the recommended way to setup TFS Aggregator is going forward? From the release list, it appears that there have been no activity on the webhook version since August, whereas the standard plugin version has been updated as recent as January.

Best regards,
Emil Refn

Deployement Failed

Hello,

I would deploy TfsAggregator on my VSTS with deploy.azure.com.
I am co-admin on Azure subcription and Project Collection Admin on VSTS.
But deployement failed:
tfsa1
tfsa2

Please help me

Support for TEST button

TFS/VSTS has a test button in the WebHook setup wizard. As it sends bogus data (non-exising URLs), TFS Aggregator fails with an exception, translated to an HTTP 500 code.

Add an explicit check for these URLs so it does not fail and replies some "hello world" with HTTP 200.

Web Hook Error: Basic authentication requires a secure connection to the server. (500)

Our VSTS Service Hook was working for a while, then it stopped about a week ago (can't find any older history). History showed "Internal Server Error (500)" from our TFS Aggregator Web App. When performing a test, the error displayed is "Basic authentication requires a secure connection to the server. (500)".

Nothing was changed on the Azure Web App side that we know of.

We deleted the web app and service hook subscriptions and re-created everything to no avail.

Please help. Thanks in advance!

image

policyFilePath

Hi

I have the following two problems with policyFilePath:

I would like to use the following pattern {CollectionId}.{TeamProject}.policies. I am unsure how to get the CollectionId of the collection, how would you do that?

I would like to put the policy file on a separate drive letter since I will be running multiple instances of aggregator behind a loadbalancer. It specifies that it’s a fixed path, could I do a value like U:\Policies<ALL Policies>

Best regards
Mads

Azure Functions

Seems like a perfect use case for Azure Functions (instead of an API App).
A "How-To" would be great.

Feature: Ability to write rules in a separate assembly

To get the benefits of a real IDE, unit testing and debugging, it would be nice not to have to have to write code in XML files. An ideal solution might look something like:

[Rule]
[AppliesTo("Task")]
public void HelloWorldRule(IWorkItemExposed self, IWorkItemRepositoryExposed store, ILogger logger)
{
    logger.Log("Hello '{2}', World from {1} #{0}!", self.Id, self.TypeName, self["System.Title"]);
}
<policy name="SomePolicy">
  <ruleRef assembly="HelloWorldRules.dll" />
</policy>

TFS Aggregator future plan

Are you still working on this functionality or is there something else which is being worked on? I can see it has not been updated since June 2017

Error. A task was canceled.

Hello!

Periodically, webhook in TFS reports an error:

A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Services.ServiceHooks.Common.HttpActionTask.<RunAsync>d__8.MoveNext()

These errors occur in the Feature. Judging by the logs, they occur when attaching child elements

My policies:

<?xml version="1.0" encoding="utf-8"?>
<AggregatorConfiguration>

  <runtime debug="true">
    <rateLimiting interval="00:00:30.00" changes="1000" />
    <logging level="Diagnostic" />
    <script language="C#" />
    <!--
    <authentication username="**DOMAIN**\**user**" password="***" />
    <authentication personalToken="**put-personal-token-here**" />
    -->
  </runtime>

  <rule name="SetEpic" hasFields="My.TargetRelease">
        <![CDATA[
        IWorkItemExposed topEpic = self.FollowingLinks("System.LinkTypes.Hierarchy-Reverse").WhereTypeIs("Epic").AtMost(1000).FirstOrDefault();
        if (topEpic != null)
        {
            string epicTitle = topEpic["Title"] as string;
            logger.Log("Parent Epic ID: {0}", topEpic.Id);
            self["My.TargetRelease"] = epicTitle;
            foreach (var x in self.Children)
            {
               x["My.TargetRelease"] = epicTitle;
            }
        }
        else
        {
      self["My.TargetRelease"] = "N/A";
            foreach (var x in self.Children)
            {
               x["My.TargetRelease"] = "N/A";
            }
        }
        ]]>
  </rule>
  <policy name="MyPolicy">
    <ruleRef name="SetEpic" />
  </policy>

</AggregatorConfiguration>

Do you have any ideas how to solve the problem? Thank you all in advance

The error "HTTP status code InternalServerError" in Functions Bot

Hi!
I'm using Functions Bot (instead of App Bot) and meet a problem that there is no web.config file when I create the Function Bot with Azure Subscription.
Could you please advise me how and where can I put information about MicrosoftAppId, MicrosoftAppPassword, AzureWebJobsStorage, QnASubscriptionKey, QnAKnowledgeBaseId?

I need it because I want to add HeroCard into my bot and I'm using this insrution. In this instruction we should update web.config file. Without this my bot have the error "There was an error sending this message to your bot: HTTP status code InternalServerError"

TeamServices Authentication Error

Hello,

Firstly, thankyou for all the hard work porting this tool to run using web hooks, team services is currently very limited in it's customisation options and this tool would really help us.

We have setup the web hooks version of TFSAggregator on an Azure WebApp as per the documentation here .
Our initial goal is to have TFSAg carry out a rollup of effort scores on child work items to the parent whenever the children are updated.

Whilst we do have team services and the aggregator web app talking, it's appears from the TFSAg log that whenever TFSAg attempts to connect back to team services it is receiving an authentication error.
Error: TF30063: You are not authorized to access [OurVSTSAccountName].visualstudio.com

We have a PAT configured in the policy that is active and the PAT's team services account has project admin level permissions. The .visualstudio.com address TFSAg is connecting back to is correct.

Is there anything else we need to add to the policy/web.config in TFSAg to authenticate successfully with team services (that isn't listed in the documentation?
Any help would be greatly appreciated.

web.config, policy file and error snippets attached.

error
rollup policies
web config

Webhook Returns 500 internal Error

Hey there,

i followed the install Instructions and installed the Aggregator.
But whenever I try to send Testdata I always get an 500 Internal Error.

When I install it without SSL-Cartificate I always get the "Basic authentication requires secure Connection" error. I did bind the Website to https://

:9999 and set SSL to "not required" inside iis-manager.
I got it to work a few operations, yet without touching any Settings it eventually stopped working.

I Want to install it on a local TFS without internet Connection

Failed to communicate with TFS

I am trying to install TFS aggregator as a Web Service version 2.3.

I have setup the WebApplication on IIS. First I did it using HTTP. Then when trying to configure the service hook it told me to use HTTPS if using Basic Authentication. Then I set up SSL for TFS Aggregator., but using a self-made certificate.
Get the following error message: The remote certificate is invalid according to the validation procedure.
Is there any solution where I do not use Basic Authentication? Or do I have to use a trusted certificate?

Rules can be applied teamScope?

Hi,
I was wondering if we could specify policies on team level ? Is there any blocker you can think of to avoid this scenario?

Unable to Capture Errors in EventViewer

I am using WebHooks 2.3 Beta
I am unable to see any events from TFSAggregator in EventViewer when using an account that has permission to write to the event log, and when deployed in debug configuration. Nothing showing up on Dbgview as well. Nothing in C:\Log default log location either. Trying to troubleshoot the below error and unable to without anything in logging. This is installed on an on-prem server, not Azure.

Status Code: 500
Reason Phrase: Internal Server Error
HTTP Version: 1.1
Headers:
{
Cache-Control: private
Date: Wed, 19 Apr 2017 16:06:54 GMT
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Content-Length: 4715
Content-Type: text/html; charset=utf-8
}

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.