@@ -15,7 +15,7 @@ namespace aggregator.Engine
15
15
{
16
16
internal interface IRuleEngine
17
17
{
18
- Task < string > RunAsync ( IRule rule , Guid projectId , WorkItemData workItemPayload , IClientsContext clients , CancellationToken cancellationToken = default ) ;
18
+ Task < string > RunAsync ( IRule rule , Guid projectId , WorkItemData workItemPayload , string eventType , IClientsContext clients , CancellationToken cancellationToken = default ) ;
19
19
}
20
20
21
21
public abstract class RuleEngineBase : IRuleEngine
@@ -34,9 +34,9 @@ protected RuleEngineBase(IAggregatorLogger logger, SaveMode saveMode, bool dryRu
34
34
this . dryRun = dryRun ;
35
35
}
36
36
37
- public async Task < string > RunAsync ( IRule rule , Guid projectId , WorkItemData workItemPayload , IClientsContext clients , CancellationToken cancellationToken = default )
37
+ public async Task < string > RunAsync ( IRule rule , Guid projectId , WorkItemData workItemPayload , string eventType , IClientsContext clients , CancellationToken cancellationToken = default )
38
38
{
39
- var executionContext = CreateRuleExecutionContext ( projectId , workItemPayload , clients , rule . Settings ) ;
39
+ var executionContext = CreateRuleExecutionContext ( projectId , workItemPayload , eventType , clients , rule . Settings ) ;
40
40
41
41
var result = await ExecuteRuleAsync ( rule , executionContext , cancellationToken ) ;
42
42
@@ -45,7 +45,7 @@ public async Task<string> RunAsync(IRule rule, Guid projectId, WorkItemData work
45
45
46
46
protected abstract Task < string > ExecuteRuleAsync ( IRule rule , RuleExecutionContext executionContext , CancellationToken cancellationToken = default ) ;
47
47
48
- protected RuleExecutionContext CreateRuleExecutionContext ( Guid projectId , WorkItemData workItemPayload , IClientsContext clients , IRuleSettings ruleSettings )
48
+ protected RuleExecutionContext CreateRuleExecutionContext ( Guid projectId , WorkItemData workItemPayload , string eventType , IClientsContext clients , IRuleSettings ruleSettings )
49
49
{
50
50
var workItem = workItemPayload . WorkItem ;
51
51
var context = new EngineContext ( clients , projectId , workItem . GetTeamProject ( ) , logger , ruleSettings ) ;
@@ -59,7 +59,8 @@ protected RuleExecutionContext CreateRuleExecutionContext(Guid projectId, WorkIt
59
59
self = self ,
60
60
selfChanges = selfChanges ,
61
61
store = store ,
62
- logger = logger
62
+ logger = logger ,
63
+ eventType = eventType
63
64
} ;
64
65
return globals ;
65
66
}
0 commit comments