Giter VIP home page Giter VIP logo

tfsaggregator / aggregator-cli Goto Github PK

View Code? Open in Web Editor NEW
73.0 73.0 32.0 1.52 MB

A new version of Aggregator aiming at Azure DevOps (ex Visual Studio Team Services)

Home Page: https://tfsaggregator.github.io/

License: Apache License 2.0

C# 94.99% HCL 2.59% Dockerfile 0.82% PowerShell 1.02% Shell 0.49% Batchfile 0.09%
aggregator-cli azure-devops azure-devops-extension azure-functions rule-language tfs tfs-aggregator vsts vsts-integration

aggregator-cli's Introduction

Develop Build status

Deprecation notice

Azure DevOps Server is deprecating the old work item APIs. They are likely not going to be removed any time soon, but we can't keep supporting this plugin version forever.

Our recomendation is to migrate to aggregator-cli which can now be hosted on Azure Functions or in Docker.

We won't do any major investment in this Plugin version and our bandwidth for support is limited.

This server side plugin, for TFS 2013 update 2 up to TFS 2018.3 and Azure DevOps Server 2019, 2020, 2022 up to 2022.0.1 and 2022.1 enables running custom script when Work Items change, allowing dynamic calculation of field values in TFS and more. (For example: Dev work + Test Work = Total Work).

Documentation

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

Changelog

What's new in v2.7

  • Adds support for Azure DevOps Server 2022 RC1, RC2, and RTW, 2022.0.1 RC, 2022.0.1.

What's new in v2.6

  • Adds support for Azure DevOps Server 2020 beta, RC and RTW, 2020.1, 2020.1.1, 2020.0.1.
  • Adds support for Azure DevOps Server 2022.1 RC1

What's new in v2.5

  • Adds support for Azure DevOps Server 2019.0, 2019.0.1, 2019.1RC1, 2019.1RC1, 2019.1
  • Adds support for TFS 2018.2 and 2018.3

What's new in v2.4

  • Added support for TFS 2015.4.1
  • Added support for TFS 2017.0.1
  • Added support for TFS 2017.1
  • Added support for TFS 2017.2
  • Added support for TFS 2017.3
  • Added support for TFS 2017.3.1
  • Added support for TFS 2018
  • Added support for TFS 2018.1 RC
  • Added support for TFS 2018.1
  • Added support for TFS 2018.2
  • Fixes TemplateScope in TFS 2017 update 2 and higher
  • Added text to installer explaining the 2017u2 version works with 2017u3 as well
  • Added text to installer explaining the 2018 version works with 2018u1 as well
  • Reading and removal of Work item Links self.WorkItemLinks self.RemoveWorkItemLink
  • Global List editing with AddItemToGlobalList and RemoveItemFromGlobalList
  • Startup logging controlled by configuration file
  • New code layout, contributors are urged to read Source Code
  • Support for work-item-deleted event

What's new in v2.2

  • Support for TFS 2017
  • Macro snippets and Functions for Rules and make code more modular
  • Ability to specify server URL
  • Support for multiple workitem Ids in Console application (issue #178)
  • Ability to Send email from Rules
  • Migrated CI build from AppVeyor to VSTS
  • Use of GitVersion to manage Semantic Versioning

What's new in v2.1.1

  • Fixes important bug causing very high CPU usage (see #160).

What's new in v2.1

  • Support for TFS 2015.2, TFS 2015.2.1 and TFS 2015.3
  • Extended logging in debug version
  • Ability to override base Uri of the aggregator
  • Improvements in the setup
  • Adds PreviousRevision/NextRevision properties to Work Items to navigate history
  • Adds Uri field to Work Items
  • Removed policyscope on Workitem template GUID and revision (didn't work anyway)

What's new in v2

  • A 'real' Scripting language (C#, VB, Powershell)
  • Scoping allows select which rules apply to which Team Project
  • Enhanced filtering to trigger rules when conditions are met
  • Console application to quickly test new rules
  • Richer logging
  • Test harness and modularity to ease adding new features
  • Create new Work Items and Links using rules
  • and more...

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

Contributing to the Project

Please read the Contributing document.

aggregator-cli's People

Contributors

andersforsgren avatar aok-foss avatar bobsilent avatar diegotrsl avatar giuliov avatar jawn avatar jdshkolnik avatar manne avatar mmuresan avatar pswetz avatar turibbio 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aggregator-cli's Issues

TFS Aggregator deployment failed on Devops

Please find attached images - we are unable to deploy TFS Aggregator extension on Devops. Please help us to troubleshoot it.

Error message is -
Deployment Error: The resource operation completed with terminal provisioning state 'Failed'!

Also, checked with Microsoft support (https://developercommunity.visualstudio.com/content/problem/656535/change-states-and-add-rules-for-inheritence-work-i.html?childToView=661455#comment-661455). They having same issue so referred to raise issue here,

Thank you!
Jolly Patel

Confusing CLI command requirements for resource group and location

The resource group parameter is not required, but the location parameter is required. As such, one would expect to be able to use any existing resource group and provide any location they desire. However, the supplied location argument is only used for new resource group creation, not the resources within (ex: app plan).

If a necessary resource is not available in the region of the resource group, the instance installation fails regardless of the input location.

In our case, all our resource groups are in WestUS. The deployment kept failing for Application Insights because the product is not available in the WestUS region. We had to dig through the code to figure out why - despite setting the instance location to WestUS2 - the CLI kept trying to use WestUS as the location for all the resources.

Let me specify a different region for Application Insights

Application Insights is automatically provisioned as part of the creation of an instance. However, Application Insights is not available in all Azure datacenters, eventually leading to a failed deployment when deploying to e.g. Brazil South.

I want to be able to deploy my Aggregator instance closer to my Azure DevOps instance (e.g. deploying to Brazil South when connecting to Azure DevOps orgs hosted in Brazil), while at the same time deploying App Insights wherever it's available.

Manage throttling

Are we using a Durable Function to ensure eventual delivery of notifications, even if the account trips a circuit breaker?
When we invoke a REST api we should get a requests header that tells us we're throttled or that the account is temporarily unavailable. If we use a durable function then we could sleep for a short while or we could also tell the function runtime to call again in a couple seconds to improve reliability of rule execution.

From https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rate-limits?view=azure-devops

When an individual user's requests are blocked, responses with HTTP code 429 (too many requests) will be received, with a message similar to the following:
TF400733: The request has been canceled: Request was blocked due to exceeding usage of resource <resource name> in namespace <namespace ID>.

IdentifyRef field type: Unable to cast object of type 'Microsoft.VisualStudio.Services.WebApi.IdentityRef' to type 'System.String'.

Unable to cast object of type 'Microsoft.VisualStudio.Services.WebApi.IdentityRef' to type 'System.String'. at aggregator.Engine.WorkItemWrapper.GetFieldValue[T](String field) in D:\Repos\aggregator-cli\src\aggregator-ruleng\WorkItemWrapper.cs:line 412at aggregator.Engine.WorkItemWrapper.get_AssignedTo()

Then when trying to case like
string assigned = ((Microsoft.VisualStudio.Services.WebApi.IdentityRef)self["AssignedTo"])?.DisplayName ?? "";

throws
type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft'

Need update
public IdentityRef AssignedTo

    {

        get { return GetFieldValue<IdentityRef>(CoreFieldRefNames.AssignedTo); }

        set { SetFieldValue(CoreFieldRefNames.AssignedTo, value); }

    }

and also Roslyn reference updates for types.

Verify rule before uploading

Given a rule containing (only a parentheses)

(

When adding the rule
and mapping the rule
Then no errors occurs

Actual

Upload

No error occurs

Runtime

When the rule is invoked
then following error occurs

 [Warning] Rule 'Invalid' failed: (1,2): error CS1733: Expected expression

Expected

The CLI should not allow to upload invalid rules (according to the rule language), an error should be produced

Issue with rollup type rules when PBI/bug only has 1 child task

I added a simple rollup rule to calculate Completed Work / Original Estimate on PBI/bug. This works for PBI's and bugs which have multiple child tasks but when there's only 1 child it fails. Failures return 501 Not Implemented with error "The given key 'False' was not present in the dictionary.". I think the Children relation is the issue.

Here's my rule for Original Estimate:
if (self.Parent != null)
{
var parent = self.Parent;
parent["Microsoft.VSTS.Scheduling.OriginalEstimate"] = parent.Children.Sum(task => Convert.ToDouble(task["Microsoft.VSTS.Scheduling.OriginalEstimate"]));
}

Aggregator fail with not implemeted 501 statuscode - on premise Azure DevOps 2019

I have setup a function instance in Azure with one simple rule. In my script i also add webhooks on my on premise Azure Devops 2019 instance.

Everything works when i run a test webhook call but when i run a real hook on for example workitem.update i get this error.

I changed the CLI code to give me more information on error.

ฮป  dotnet $aggregatorCli stream.logs --instance $aggregatorName --resourceGroup $resourceGroup --verbose
[2019-08-19 10:35:00Z] Aggregator CLI v0.9.0+local.development (build: 0.9.0.0 Debug) (c) TFS Aggregator Team
[2019-08-19 10:35:00Z] Authenticating to Azure...
[2019-08-19 10:35:01Z] Connected to subscription 20bba462-f2a0-435e-adb7-4d0f8d775e23
[2019-08-19 10:35:01Z] Connecting to FunctionWI6...
[2019-08-19 10:35:06Z] Connected to FunctionWI6 logs
[2019-08-19 10:35:18Z] Streaming FunctionWI6 logs...
2019-08-19T08:35:18  Welcome, you are now connected to log-streaming service.
2019-08-19T08:35:19.038 [Information] Executing 'Functions.writeworkitemtypeandtitle' (Reason='This function was programmatically called via the host APIs.', Id=ea3e2242-0905-4da4-959b-738146178263)
2019-08-19T08:35:19.038 [Information] Executing 'Functions.writeworkitemtypeandtitle' (Reason='This function was programmatically called via the host APIs.', Id=ea3e2242-0905-4da4-959b-738146178263)
2019-08-19T08:35:19.920 [Information] Aggregator v0.9.1+local.development executing rule 'writeworkitemtypeandtitle'
2019-08-19T08:35:20.092 [Warning] collectionUrl https://tfs-test.xxx.com/tfs/Test_XXXCareCollection/
2019-08-19T08:35:20.093 [Information] teamProjectId b328f48c-4979-4d71-9090-bae5966771bf
2019-08-19T08:35:20.093 [Information] workItem Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem
2019-08-19T08:35:19.920 [Information] Aggregator v0.9.1+local.development executing rule 'writeworkitemtypeandtitle'
2019-08-19T08:35:20.092 [Warning] collectionUrl https://tfs-test.raysearchlabs.com/tfs/Test_xxxCareCollection/
2019-08-19T08:35:20.093 [Information] teamProjectId b328f48c-4979-4d71-9090-bae5966771bf
2019-08-19T08:35:20.093 [Information] workItem Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem
2019-08-19T08:35:21.047 [Warning] Rule 'writeworkitemtypeandtitle' failed:    at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState)
   at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken)
   at aggregator.RuleWrapper.ExecuteAsync(Uri collectionUri, Guid teamProjectId, WorkItem workItem, CancellationToken cancellationToken) in C:\git\aggregatorazuredevops\aggregator-cli\src\aggregator-function\RuleWrapper.cs:line 51
   at aggregator.AzureFunctionHandler.RunAsync(HttpRequestMessage req, CancellationToken cancellationToken) in C:\git\aggregatorazuredevops\aggregator-cli\src\aggregator-function\AzureFunctionHandler.cs:line 116
2019-08-19T08:35:21.088 [Information] Executed 'Functions.writeworkitemtypeandtitle' (Succeeded, Id=ea3e2242-0905-4da4-959b-738146178263)
2019-08-19T08:35:21.047 [Warning] Rule 'writeworkitemtypeandtitle' failed:    at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState)
   at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken)
   at aggregator.RuleWrapper.ExecuteAsync(Uri collectionUri, Guid teamProjectId, WorkItem workItem, CancellationToken cancellationToken) in C:\git\aggregatorazuredevops\aggregator-cli\src\aggregator-function\RuleWrapper.cs:line 51
   at aggregator.AzureFunctionHandler.RunAsync(HttpRequestMessage req, CancellationToken cancellationToken) in C:\git\aggregatorazuredevops\aggregator-cli\src\aggregator-function\AzureFunctionHandler.cs:line 116
2019-08-19T08:35:21.088 [Information] Executed 'Functions.writeworkitemtypeandtitle' (Succeeded, Id=ea3e2242-0905-4da4-959b-738146178263)
2019-08-19T08:35:22.829 [Information] Host lock lease acquired by instance ID 'bec43f7473ffa1a31147948b5c1b6b8e'.

Here is the test call that works
image

Here is the call from a real workitem
image

Here is the error in code in AzureFunctionHandler.cs
image

I also found on Azure function that Aggregator_VstsToken value is empty - isnt it here PAT token should be? I tried to put in my PAT token manually but it doesnt work either.
image

I tried to debug the code and see why is this happening but cannot fix it. :( Can you please give me some advice.

New task: Code in documentation does not work

This code throws exception, taken from documentation.

var parent = self;
var newChild = store.NewWorkItem("Task");
newChild.Title = "Brand new child";
parent.Relations.AddChild(newChild);

return parent.Title;

Feature : possibility to apply filter on webhook

Hello,

To limit traffic, it would be nice to be able to specify filters with the "map.rules" command.
For example :
dotnet .\aggregator-cli.dll map.rule --rule xxx --project "xxx" --event workitem.updated --resourceGroup xxx --instance xxx

--filtertype "Task" --filterfield "Microsoft.VSTS.Scheduling.OriginalEstimate"

And in Azure DevOps :

image

The application should be published as release

Expected
The solution should be build with the release configuration.

Actual
The solution is built with the debug configuration.

image

[command]"C:\Program Files\dotnet\dotnet.exe" build D:\a\1\s\src\aggregator-cli.sln
Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Link

Explanation
the default value of dotnet build for the option configuration is Debug. See Docs dotnet build

Implementation
Append the option --configuration Release to the .NET Core build task named dotnet build in Azure Pipelines

Hint
If the YAML Azure Pipelines file is present in this repo, then I could create a PR for this matter. See Create your first pipeline

Edit: added link to build log

Allow casting of IdentityRef type

We need to be able to cast the IdentityRef field in rule code in order to interact with custom work item fields beyond the standard ones.

Custom fields

SImilar to #58 which has been closed. It would be great if you could share how to get values from a custom field.

.lang=C#
var value = self['customField'];
return value;

Returns the following:

One or more errors occurred. ((4,8): error CS0266: Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?))

Propose - Allow multiple App Function Instances per Resource Group

As is the application assumes the 'name' param of the instance.install command is both the resource group AND function application name. The proposal is to separate out the two params (Resource Group name and Function App Name) with app name being optional, if second param not provided then default to same value as RG name.

If the function app name param is used then install/update the function application under that name inside the provided resource group name.

Support for ApplicationInsights

Permit logging on AI as alternative to built-in logging.

Reason

The built-in logging is useful for testing with light workloads but is not intended for high-load production use. For production monitoring, Application Insights is recommended. If built-in logging is used in production, the logging record may be incomplete due to throttling on Azure Storage.
https://docs.microsoft.com/en-us/azure/azure-functions/functions-monitoring#disable-built-in-logging

Foreseeable changes
ARM template creates AI resource
Configuration command to switch between modes by removing adding these keys:

  • AzureWebJobsDashboard connection string to storage created by template
  • APPINSIGHTS_INSTRUMENTATIONKEY key of AI
    Do not forget to expose logging to rules

Open issues
One AI resource per Instance or one per RG or what?

Consider cancellation capability

Each asynchronous operation on the CLI and function stack should support cancellation.

  • The entry points have to provide a CancellationToken
  • Each synchronously called asynchronous method has to be awaited, therefore the public API changes

Advantages

  • less resource allocations

Interesting PR commandlineparser/commandline#390

How to get values of Parent task in Child task...

Hi,
I want to get field values (e.g. DueDate of Parent task) into Child task, it is like when a child task will be created its DueDate will be Auto filled to same as Parent task dueDate is.
I am using following code for this but it is not working, it is giving me following error under Service Hook:

  • 503 - Not Implemented
    Sample Code:

.lang=C#
using System;
using System.Collections;
using System.Collections.Generic;

string message = "";
var parent = self.Parent;
if (parent != null)
{
var children = parent.Children;
self["System.DueDate"] = parent["System.DueDate"];
}

Help Needed (No action is triggered)

I have done all the steps and Getting no errors in Azure log streaming.
I have uploaded below test rule in azure functions.
When i close the child work item types eventually the parent has to get closed or show message. Nothing is happening. I am not getting any messages in Azure devops portal If Close parent or child. The states are also not getting transitioned automatically when I close child work items.
Please help

string message = "";
var parent = self.Parent;
if (parent != null)
{
var children = parent.Children;
if (children.All(c => c.State == "Closed"))
{
parent.State = "Closed";
message = "Parent was closed";
}
else
{
message = "Parent was not closed";
}
parent.Description = parent.Description + " aggregator was here.";
}
return message;

Rule for customfield

I have new custom field created by name TestMethodID and when I am trying to push some values to it by creating simple rule like below I am getting error. Please help

Rule:
.language=Csharp
if (self.WorkItemType == "Test Case")
{
self.TestMethodID =1234;
}
return "Nothing to do";
Error:

'WorkItemWrapper' does not contain a definition for 'TestMethodID' and no accessible extension method 'TestMethodID' accepting a first argument of type 'WorkItemWrapper' could be found (are you missing a using directive or an assembly reference?)

Random Error: Log is being used by another process

Not consistent error, mostly seems to happen after an initial function app warmup but is inconsistent.

[Warning] Rule '[RuleName]' failed: An error occurred while writing to logger(s). (The process cannot access the file 'D:\home\LogFiles\Application\Functions\Function[RuleName]\2018-11-19T20-41-00Z-60d3d534f7.log' because it is being used by another process.)

Apply some generic rules at organization level to all projects

Hi,
Is there any way we can apply a common rule at organization level to all projects under that organization and also when any new project created under that organization then that rule by default applies to the new project too. Following is example:

  • Whenever a work item created, it's CreateDate field should be auto filled to currentdate. This rule should be default to each project under an organization and also when a new project created this rule should be auto apply so that I do not have to run:
    aggregator-cli map.rule
    command against each project in the organization.
    The above example is simple, it is just to make my question simple. I want some rules to apply at organization level and whenever user creates project they should auto apply to those projects. Is it possible?

Error when mapping rule - AzureWebJobsSecretStorageType does not support blob in functions v2

Error thrown when trying to run map.rule

Failed to retrieve function key: {"Message":"An error has occurred.","ExceptionMessage":"Runtime keys are stored on blob storage. This API doesn't support this configuration. Please change Environment variable AzureWebJobsSecretStorageType value to 'Files'. For more info, visit https://aka.ms/funcsecrets","ExceptionType":"System.InvalidOperationException","StackTrace":" at Kudu.Core.Functions.FunctionManager.<GetKeyObjectFromFile>d__91.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Functions\FunctionManager.cs:line 141\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Kudu.Core.Functions.FunctionManager.d__12.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Functions\FunctionManager.cs:line 220\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Kudu.Services.Functions.FunctionController.d__12.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Services\Functions\FunctionController.cs:line 141"}`

The type 'TraceWriter' is defined in an assembly that is not referenced.

During rule execution.

2018-10-23T15:22:26.674 [Error] Function compilation error

Microsoft.CodeAnalysis.Scripting.CompilationErrorException : Script compilation failed.

at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.CreateFunctionTarget(CancellationToken cancellationToken) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 314

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at async Microsoft.Azure.WebJobs.Script.Description.FunctionLoader`1.GetFunctionTargetAsync[T](Int32 attemptCount) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\FunctionLoader.cs : 55

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.GetFunctionTargetAsync(Boolean isInvocation) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 183
2018-10-23T15:22:26.325 [Information] Executing 'Functions.testrule' (Reason='This function was programmatically called via the host APIs.', Id=ede53413-f440-4479-a8d6-fd90c1d1bfee)
2018-10-23T15:22:26.827 [Warning] run.csx(6,62): warning CS0618: 'TraceWriter' is obsolete: 'Will be removed in an upcoming version. Use Microsoft.Extensions.Logging.ILogger instead.'
2018-10-23T15:22:26.854 [Error] run.csx(8,23): error CS0012: The type 'TraceWriter' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.

Permit choosing plan, Consumption or App Service and which of the latter

Current template uses free App Service plan, so one has to manually change using Azure Portal, CLI or Powershell for other options.

We should allow additional options on Microsoft.Web/serverfarms, in particular the Consumption plan, that is

"sku": {
    "name": "Y1",
    "tier": "Dynamic",
    "size": "Y1",
    "family": "Y",
    "capacity": 0
},

Update frequency to minimize

Hi,
I want to ask is there a way we can reduce the time it took to run the aggregator-cli script against an event, e.g. I have written a code to update the field (Notes) of a task to a standard value when any work item will be created. This is something like whenever a work item will be created its Notes field will have a default/pre-defined value.

I noticed that when I create work item it took between 10-25 seconds to update the field value.
I want to ask is there any configuration setting where we can reduce this time to something like 5 seconds?

Thanks,
Kamran

Change item status in another organization

I tried to change Azure DevOps item status in an organization A that has no Azure directory assigned. The used Azure directory belongs to a Microsoft user which is a user in organization A. I was able to setup an Aggregator instance and an Aggregator Rule in Azure. I was also able to setup an Aggregator mapping via cli in Azure DevOps. When triggered the Azure DevOps Service Hook invokes the Aggregator Rule with the following output: [Warning] Rule 'itemstatus' failed: VS30063: You are not authorized to access https://xxx... (organization A).
Is this scenario simply not supported or do I miss anything?

unmap.rule fails with "given key 'url' was not present in the dictionary

Hi,
I'm able to add rules to a TFS project but unable to delete them. Could you point me in the right direction for this issue ? I can't see where/why I add url to the args

This adds the rule successfully
dotnet c:\dev\tools\aggregator\aggregator-cli\aggregator-cli.dll map.rule --verbose --project "Test Failures Count Test" --event workitem.created --instance Aggregator --resourceGroup Azure-DevOps-Aggregator --rule update_effort_fields

But I'm unable to delete the rule
dotnet c:\dev\tools\aggregator\aggregator-cli\aggregator-cli.dll unmap.rule --verbose --project "Test Failures Count Test" --event workitem.created --instance Aggregator --resourceGroup Azure-DevOps-Aggregator --rule update_effort_fields

returns

[2019-04-23 15:44:31Z] Reading Azure DevOps project data...
[2019-04-23 15:44:31Z] Project Test Failures Count Test data read.
[2019-04-23 15:44:31Z] One or more errors occurred. (The given key 'url' was not present in the dictionary.)

Thanks in advance !
Dan

RuleEngine.ExecuteAsync() always sets State to Success

Is the behavior of always succeeding regarding to RuleEngine.State on purpose? See line 114

if (result.Exception != null)
{
logger.WriteError($"Rule failed with {result.Exception}");
State = EngineState.Error;
}
else if (result.ReturnValue != null)
{
logger.WriteInfo($"Rule succeeded with {result.ReturnValue}");
}
else
{
logger.WriteInfo($"Rule succeeded, no return value");
}
State = EngineState.Success;

Consider fail fast in CLI commands

in many commands the options are checked after connecting to Azure/Azure DevOps. If the check fails both connections were being made unnecessarily. It is beneficial to check them before accessing a different system.

List.instances produces an error

When calling list.instances --resourceGroup XYZ --verbose an error is produced

One or more errors occurred. (Invalid version.
Parameter name: version)

image

Possible reason

Invoking xyz.scm.azurewebsites.net/api/vfs/site/wwwroot/aggregator-manifest.ini results in

version=0.4.5-RC

Manually invoking

	SemVersion.Parse(@"0.4.5-RC
").Dump();

in LINQPad results in an ArgumentException with the message

Invalid version.Parameter name: version

However manually invoking (pay attention to the missing last empty line)

	SemVersion.Parse(@"0.4.5-RC").Dump();

results in a correctly parsed version number

Analysis

The file src/aggregator-function/aggregator-manifest.ini only contains one line.
The file aggregator-manifest.ini in the deployment file FunctionRuntime.zip contains an empty last line

Possible Solutions

First

Update the PowerShell build task Set version in aggregator-manifest.ini to the last empty line is not produced

Second

Make the implementation of parsing the aggregator-manifest.ini file more robust

Reason Phrase: Not Implemented

Hello,
I tried to create a simple test rule. And from Service hook Azure devops I am getting below error when I created new Bug.
Reason Phrase: Not Implemented
I just added a simple rule from examples and mapped that rule from azure to ADO.Rule I uploaded is $"Hello { self.WorkItemType } #{ self.Id } - { self.Title }!".
Please help. I am ready to provide more details in case.

Accessing Azure DevOps Web API/non exposed functionality

Rational

For a rule I have to know the category of a work item's state. This information is currently not exposed.
E.g. the category of the state Done of the work item type Bug of the process template Scrum

To get this information I can

a) write a constant mapping in the source code. Then I have to type a lot and customized process templates are not supported.
b) query the web/Rest API. Then customized process templates are supported.

I favor a).

Question

How can accessing the web/Rest API achieved?
Answer: Something has to be implemented ๐Ÿ˜‰

Possible Implementations

a) Write a wrapper and expose it via WorkItemStore

public class WorkItemStore
{
    public async Task<string[]> GetWorkItemStatesAsync(string workItemType) { /* ..*/ }
}

b) Write a wrapper calls and expose it global type
c) Provide the possibility to extend the functionality (of a rule) without adjusting Aggregator. Directly access the Web API from the rule

One or more errors occurred. (Operation returned an invalid status code 'Forbidden')

Hi everyone,

I succeed my authentication with logon.azure and logon.ado, but on install.instance
with a custom name, location and a new resourcegroup name as i understabd the latter is going to be standing beside my rg for my organisation and project.

While debugging i get this:

Exception thrown: 'Microsoft.Rest.Azure.CloudException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Rest.Azure.CloudException' in System.Private.CoreLib.dll
Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll

here

image

image

Could anyone suggest what I am doing wrong with this?

Thank you,

Tino

Support for TFS 2017 update 3 on prem - Non beta version

Hi,

It seems like the previous recommended version for TFS 2017 update 3 on prem is the web service version of the TFS Aggregator, and now it is the Aggregator-cli.
As we need to examine the aggregation solution for our organization, and prefer not using a beta version, can you please recommend which version we should try for POC?
Is the Release version of Aggregator-cli expected soon?

Thanks,
Sharon.

How to get values of Successor and Predecessor task's fields...

Hi,
How do I get successor and predecessor field values? Following is an example which I used to get Parent and Child tasks field values, but when I use Successor or Predecessor then it gives error.

var parent = self.Parent;
var child = self.Children;
child["Microsoft.VSTS.Scheduling.TargetDate"] =self["Microsoft.VSTS.Scheduling.TargetDate"];

As in above code assigning value of parent field to child field, how can I do the same for successor and predecessor task fields.
var successor = self.Successor; ---> This gives error
var successor = self.Successors; ---> This gives error
Error CS1061: 'WorkItemWrapper' does not contain a definition for 'Successor'

Thanks,
Kamran

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.