@@ -60,10 +60,12 @@ public interface IExecutionContext : IRunnerService
6060
6161 bool EchoOnActionCommand { get ; set ; }
6262
63+ bool IsComposite { get ; }
64+
6365 // Initialize
6466 void InitializeJob ( Pipelines . AgentJobRequestMessage message , CancellationToken token ) ;
6567 void CancelToken ( ) ;
66- IExecutionContext CreateChild ( Guid recordId , string displayName , string refName , string scopeName , string contextName , Dictionary < string , string > intraActionState = null , int ? recordOrder = null , IPagingLogger logger = null ) ;
68+ IExecutionContext CreateChild ( Guid recordId , string displayName , string refName , string scopeName , string contextName , Dictionary < string , string > intraActionState = null , int ? recordOrder = null , IPagingLogger logger = null , bool isComposite = false ) ;
6769
6870 // logging
6971 long Write ( string tag , string message ) ;
@@ -126,6 +128,7 @@ public sealed class ExecutionContext : RunnerService, IExecutionContext
126128 // only job level ExecutionContext will track throttling delay.
127129 private long _totalThrottlingDelayInMilliseconds = 0 ;
128130
131+
129132 public Guid Id => _record . Id ;
130133 public string ScopeName { get ; private set ; }
131134 public string ContextName { get ; private set ; }
@@ -148,6 +151,8 @@ public sealed class ExecutionContext : RunnerService, IExecutionContext
148151 // Only job level ExecutionContext has StepsWithPostRegistered
149152 public HashSet < Guid > StepsWithPostRegistered { get ; private set ; }
150153
154+ public bool IsComposite { get ; private set ; }
155+
151156 public bool EchoOnActionCommand { get ; set ; }
152157
153158 public TaskResult ? Result
@@ -254,7 +259,7 @@ public IStep CreateCompositeStep(
254259 DictionaryContextData inputsData ,
255260 Dictionary < string , string > envData )
256261 {
257- step . ExecutionContext = Root . CreateChild ( _record . Id , step . DisplayName , _record . Id . ToString ( "N" ) , scopeName , step . Action . ContextName , logger : _logger ) ;
262+ step . ExecutionContext = Root . CreateChild ( _record . Id , step . DisplayName , _record . Id . ToString ( "N" ) , scopeName , step . Action . ContextName , logger : _logger , isComposite : true ) ;
258263 step . ExecutionContext . ExpressionValues [ "inputs" ] = inputsData ;
259264 step . ExecutionContext . ExpressionValues [ "steps" ] = Global . StepsContext . GetScope ( step . ExecutionContext . GetFullyQualifiedContextName ( ) ) ;
260265
@@ -273,7 +278,7 @@ public IStep CreateCompositeStep(
273278 return step ;
274279 }
275280
276- public IExecutionContext CreateChild ( Guid recordId , string displayName , string refName , string scopeName , string contextName , Dictionary < string , string > intraActionState = null , int ? recordOrder = null , IPagingLogger logger = null )
281+ public IExecutionContext CreateChild ( Guid recordId , string displayName , string refName , string scopeName , string contextName , Dictionary < string , string > intraActionState = null , int ? recordOrder = null , IPagingLogger logger = null , bool isComposite = false )
277282 {
278283 Trace . Entering ( ) ;
279284
@@ -320,6 +325,8 @@ public IExecutionContext CreateChild(Guid recordId, string displayName, string r
320325 child . _logger . Setup ( _mainTimelineId , recordId ) ;
321326 }
322327
328+ child . IsComposite = isComposite ;
329+
323330 return child ;
324331 }
325332
0 commit comments