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
74 stars 32 forks source link

Impersonate directive stops changes from saving #286

Open AugustSvensson opened 1 year ago

AugustSvensson commented 1 year ago

Steps to reproduce

Use .impersonate=onBehalfOfInitiator directive and do any field change in a rule. Run with aggregator 1.2

Expected behavior

Aggregator should save the changes.

Actual behavior

The impersonate directive clears the ChangedBy field then set it back to the original value again thus resetting the IsDirty flag for the workitem so nothing is saved.

IsDirty flag should probably be set to Changes.Any()

Diagnostic logs

Environment

Custom wrapper around the aggregator engine code.

AugustSvensson commented 1 year ago

Noticed that this unwanted feature is two fold:

  1. Impersonate will always set a value to it's original value, thus removing the change entirely.
  2. If the last change you do is set a value back to the original value it will flag the workitem as not IsDirty and not save anything regardless if other values should be changed.

Impersonate happens after the rule execution and thus will make 2 happen.