tfsaggregator / tfsaggregator-webhooks

WARNING: the team is no more maintaing this version. See aggreggator-cli instead.
https://github.com/tfsaggregator/aggregator-cli
19 stars 22 forks source link

TFS 2018 - collectionScope #17

Closed maluht closed 5 years ago

maluht commented 6 years ago

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

giuliov commented 6 years ago

Maybe you sanitized this message, so I cannot be much of help. If you want to share some logs privately use tfsaggregator (at) outlook.com.

maluht commented 6 years ago

Hi @giuliov - Thanks for the reply.

There really is not much in my logs, here it is, nothing secret since its on a test env.

[Verbose]     00.209 pre-request-parsing User 'user1' authenticated
w3wp.exe Information: 0 : [Information] 00.004 5d59274b-ef95-41aa-926e-099ecdd4d452 Aggregator.Core started, version: 2.3.0-RC.1+Branch.release/2.3.Sha.5480c185c5051f4442bdc96d001db524cd8a02cb, build: 2.3.0.0, configuration: Release [TFS 2017.0 WebHooks]
w3wp.exe Information: 0 : [Information] 00.010 5d59274b-ef95-41aa-926e-099ecdd4d452 Configuration loaded successfully from 'C:\inetpub\wwwroot\TfsAggregator\App_Data\APPS.policies'
[Verbose]     00.019 5d59274b-ef95-41aa-926e-099ecdd4d452 Connecting to https://source.company.com/tfs/APPS/ impersonating PersonalAuthenticationToken, running as TfsAggregator
[Diagnostic]  00.626 5d59274b-ef95-41aa-926e-099ecdd4d452 Built a new Work Item Repository for https://source.company.com/tfs/APPS/ using a PersonalAuthenticationToken
[Verbose]     00.626 5d59274b-ef95-41aa-926e-099ecdd4d452 Building Script Engine for C#
w3wp.exe Information: 0 : [Information] 00.910 5d59274b-ef95-41aa-926e-099ecdd4d452 Starting processing on workitem #2058
[Diagnostic]  00.910 5d59274b-ef95-41aa-926e-099ecdd4d452 Policy scope Collections(APPS) does not match tfs
[Verbose]     00.910 5d59274b-ef95-41aa-926e-099ecdd4d452 No polices apply
w3wp.exe Information: 0 : [Information] 00.910 5d59274b-ef95-41aa-926e-099ecdd4d452 Processing completed: No operation
giuliov commented 6 years ago

Looks like a bug to me due to limited testing: honestly, I only checked with VSTS or TFS using new-style URL (dropping the /tfs/), a practice that I used in all migrations. You can patch this line https://github.com/tfsaggregator/tfsaggregator-webhooks/blob/6e60f96641c16638ec1069db36125b095cd094c1/Aggregator.WebHooks/Models/RequestContext.cs#L40 probably using 2 instead of 1. A Pull Request will be appreciated.

maluht commented 6 years ago

@giuliov if your assumption is correct, wouldn't the suggested change brake it for users using the new-style URLs?

giuliov commented 6 years ago

Yes, the hint to use 2 as index is only for your specific solution, something that you build for yourself while waiting for a better solution.