From 5dfb2cc55236488eec19ac152f1a8548a262385f Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 17:55:34 -0400 Subject: [PATCH] revert --- src/Runner.Worker/ActionManifestManager.cs | 4 ++-- src/Runner.Worker/ExecutionContext.cs | 13 +++---------- .../ObjectTemplating/PipelineTemplateConverter.cs | 4 ++-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Runner.Worker/ActionManifestManager.cs b/src/Runner.Worker/ActionManifestManager.cs index 6e9f75c26..5be77c174 100644 --- a/src/Runner.Worker/ActionManifestManager.cs +++ b/src/Runner.Worker/ActionManifestManager.cs @@ -375,7 +375,7 @@ namespace GitHub.Runner.Worker var postToken = default(StringToken); var postEntrypointToken = default(StringToken); var postIfToken = default(StringToken); - var steps = default(List); + var steps = default(List); foreach (var run in runsMapping) { @@ -488,7 +488,7 @@ namespace GitHub.Runner.Worker { return new CompositeActionExecutionData() { - Steps = steps, + Steps = steps.Cast().ToList(), Outputs = outputs }; } diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 029680366..6f6279c6b 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -60,12 +60,10 @@ namespace GitHub.Runner.Worker bool EchoOnActionCommand { get; set; } - bool IsComposite { get; } - // Initialize void InitializeJob(Pipelines.AgentJobRequestMessage message, CancellationToken token); void CancelToken(); - IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, Dictionary intraActionState = null, int? recordOrder = null, IPagingLogger logger = null, bool isComposite = false); + IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, Dictionary intraActionState = null, int? recordOrder = null, IPagingLogger logger = null); // logging long Write(string tag, string message); @@ -128,7 +126,6 @@ namespace GitHub.Runner.Worker // only job level ExecutionContext will track throttling delay. private long _totalThrottlingDelayInMilliseconds = 0; - public Guid Id => _record.Id; public string ScopeName { get; private set; } public string ContextName { get; private set; } @@ -151,8 +148,6 @@ namespace GitHub.Runner.Worker // Only job level ExecutionContext has StepsWithPostRegistered public HashSet StepsWithPostRegistered { get; private set; } - public bool IsComposite { get; private set; } - public bool EchoOnActionCommand { get; set; } public TaskResult? Result @@ -259,7 +254,7 @@ namespace GitHub.Runner.Worker DictionaryContextData inputsData, Dictionary envData) { - step.ExecutionContext = Root.CreateChild(_record.Id, step.DisplayName, _record.Id.ToString("N"), scopeName, step.Action.ContextName, logger: _logger, isComposite: true); + step.ExecutionContext = Root.CreateChild(_record.Id, step.DisplayName, _record.Id.ToString("N"), scopeName, step.Action.ContextName, logger: _logger); step.ExecutionContext.ExpressionValues["inputs"] = inputsData; step.ExecutionContext.ExpressionValues["steps"] = Global.StepsContext.GetScope(step.ExecutionContext.GetFullyQualifiedContextName()); @@ -278,7 +273,7 @@ namespace GitHub.Runner.Worker return step; } - public IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, Dictionary intraActionState = null, int? recordOrder = null, IPagingLogger logger = null, bool isComposite = false) + public IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, Dictionary intraActionState = null, int? recordOrder = null, IPagingLogger logger = null) { Trace.Entering(); @@ -325,8 +320,6 @@ namespace GitHub.Runner.Worker child._logger.Setup(_mainTimelineId, recordId); } - child.IsComposite = isComposite; - return child; } diff --git a/src/Sdk/DTPipelines/Pipelines/ObjectTemplating/PipelineTemplateConverter.cs b/src/Sdk/DTPipelines/Pipelines/ObjectTemplating/PipelineTemplateConverter.cs index d680a8f8c..5a9bc11b9 100644 --- a/src/Sdk/DTPipelines/Pipelines/ObjectTemplating/PipelineTemplateConverter.cs +++ b/src/Sdk/DTPipelines/Pipelines/ObjectTemplating/PipelineTemplateConverter.cs @@ -17,13 +17,13 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating [EditorBrowsable(EditorBrowsableState.Never)] public static class PipelineTemplateConverter { - public static List ConvertToSteps( + public static List ConvertToSteps( TemplateContext context, TemplateToken steps) { var stepsSequence = steps.AssertSequence($"job {PipelineTemplateConstants.Steps}"); - var result = new List(); + var result = new List(); var nameBuilder = new ReferenceNameBuilder(); foreach (var stepsItem in stepsSequence) {