tfsaggregator / aggregator-cli

A new version of Aggregator aiming at Azure DevOps (ex Visual Studio Team Services)
https://tfsaggregator.github.io/
Apache License 2.0
73 stars 32 forks source link

The type 'WebHookEvent' is defined in an assembly that is not referenced. #193

Closed digitalanalogue9 closed 3 years ago

digitalanalogue9 commented 3 years ago

Steps to reproduce

In order to test the update process, I created an older version 0.91+3, create a simple rule and applied to a test AzD instance. The plan is to update to 1.0.0.0 as soon as I have a working old version.

When I run the rule it fails with an internal server error.

I copied the request content from AzD and in the Azure Function, tested it and get the exception below.

Expected behavior

The rule executes

Actual behavior

The rule does not run because of the exception

Diagnostic logs

2020-10-21T11:15:21.250 [Information] Executing 'Functions.update_parent_effort_fields' (Reason='This function was programmatically called via the host APIs.', Id=f359c484-138e-4672-a7ac-3ed079042b39) 2020-10-21T11:15:21.294 [Error] Function compilation errorMicrosoft.CodeAnalysis.Scripting.CompilationErrorException : Script compilation failed.at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.CreateFunctionTarget(CancellationToken cancellationToken) at D:\a\1\s\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 322at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.WebJobs.Script.Description.FunctionLoader`1.GetFunctionTargetAsync[T](Int32 attemptCount) at D:\a\1\s\src\WebJobs.Script\Description\FunctionLoader.cs : 55at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.GetFunctionTargetAsync(Boolean isInvocation) at D:\a\1\s\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 191 2020-10-21T11:15:21.450 [Error] run.csx(10,23): error CS7036: There is no argument given that corresponds to the required formal parameter 'httpContext' of 'AzureFunctionHandler.AzureFunctionHandler(ILogger, ExecutionContext, HttpContext)' 2020-10-21T11:15:21.502 [Error] run.csx(11,24): error CS0012: The type 'WebHookEvent' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.VisualStudio.Services.ServiceHooks.WebApi, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 2020-10-21T11:15:21.550 [Error] Executed 'Functions.update_parent_effort_fields' (Failed, Id=f359c484-138e-4672-a7ac-3ed079042b39, Duration=275ms)Script compilation failed.

Environment

Version - Aggregator CLI 0.9.1+3.Branch.master.Sha.8437ff414ecfd46da66ef5d3161f58818d9ab308

giuliov commented 3 years ago

0.9.01 is an old version still using .NET Core 2.1 and Azure Function Runtime v2, so I do not think the upgrade process will work. I suggest to create new Aggregator Instances with the same rules, then delete and recreate the webhooks subscriptions. I might implement some helper command for the last action.

digitalanalogue9 commented 3 years ago

Thank you for the update 👍 I think we can query AzD API to get the projects we have applied the webhooks to and then do as you say and recreate it all in the new version.