From 645ba099b9d1a90c3924875d8678965728b9a995 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Mon, 20 Jul 2020 17:41:57 -0400 Subject: [PATCH 01/12] Explicitly define what is allowed for an action --- src/Runner.Worker/action_yaml.json | 53 ++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/src/Runner.Worker/action_yaml.json b/src/Runner.Worker/action_yaml.json index 82b24a695..c80b2032b 100644 --- a/src/Runner.Worker/action_yaml.json +++ b/src/Runner.Worker/action_yaml.json @@ -8,7 +8,8 @@ "description": "string", "inputs": "inputs", "runs": "runs", - "outputs": "outputs" + "outputs": "outputs", + "defaults": "action-defaults" }, "loose-key-type": "non-empty-string", "loose-value-type": "any" @@ -51,6 +52,24 @@ "composite-runs" ] }, + "action-defaults": { + "mapping": { + "properties": { + "run": "action-defaults-run" + } + } + }, + "action-defaults-run": { + "mapping": { + "properties": { + "shell": { + "type": "non-empty-string", + "required": true + }, + "working-directory": "non-empty-string" + } + } + }, "container-runs": { "mapping": { "properties": { @@ -120,7 +139,22 @@ "hashFiles(1,255)" ], "sequence": { - "item-type": "any" + "item-type": "composite-step" + } + }, + "composite-step": { + "mapping": { + "properties": { + "name": "string-steps-context", + "id": "non-empty-string", + "run": { + "type": "string-steps-context", + "required": true + }, + "env": "step-env", + "working-directory": "string-steps-context", + "shell": "string-steps-context" + } } }, "container-runs-context": { @@ -157,6 +191,21 @@ "string": { "require-non-empty": true } + }, + "string-steps-context": { + "context": [ + "github", + "needs", + "strategy", + "matrix", + "secrets", + "steps", + "job", + "runner", + "env", + "hashFiles(1,255)" + ], + "string": {} } } } \ No newline at end of file From 220793d4e9a8af0819eaf284d1ad73f1e0a2e807 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Mon, 20 Jul 2020 17:46:02 -0400 Subject: [PATCH 02/12] Add step-env --- src/Runner.Worker/action_yaml.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Runner.Worker/action_yaml.json b/src/Runner.Worker/action_yaml.json index c80b2032b..3e94b0c6e 100644 --- a/src/Runner.Worker/action_yaml.json +++ b/src/Runner.Worker/action_yaml.json @@ -206,6 +206,24 @@ "hashFiles(1,255)" ], "string": {} + }, + "step-env": { + "context": [ + "github", + "needs", + "strategy", + "matrix", + "secrets", + "steps", + "job", + "runner", + "env", + "hashFiles(1,255)" + ], + "mapping": { + "loose-key-type": "non-empty-string", + "loose-value-type": "string" + } } } } \ No newline at end of file From 89412f35bfe111dd3ea7274c6d87919818a49401 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 11:23:25 -0400 Subject: [PATCH 03/12] Remove secrets + defaults --- src/Runner.Worker/action_yaml.json | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/Runner.Worker/action_yaml.json b/src/Runner.Worker/action_yaml.json index 3e94b0c6e..38da02dc8 100644 --- a/src/Runner.Worker/action_yaml.json +++ b/src/Runner.Worker/action_yaml.json @@ -8,8 +8,7 @@ "description": "string", "inputs": "inputs", "runs": "runs", - "outputs": "outputs", - "defaults": "action-defaults" + "outputs": "outputs" }, "loose-key-type": "non-empty-string", "loose-value-type": "any" @@ -52,24 +51,6 @@ "composite-runs" ] }, - "action-defaults": { - "mapping": { - "properties": { - "run": "action-defaults-run" - } - } - }, - "action-defaults-run": { - "mapping": { - "properties": { - "shell": { - "type": "non-empty-string", - "required": true - }, - "working-directory": "non-empty-string" - } - } - }, "container-runs": { "mapping": { "properties": { @@ -195,10 +176,8 @@ "string-steps-context": { "context": [ "github", - "needs", "strategy", "matrix", - "secrets", "steps", "job", "runner", @@ -213,7 +192,6 @@ "needs", "strategy", "matrix", - "secrets", "steps", "job", "runner", From 6602117989712512cbc852d9d62542495c55426d Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 13:11:46 -0400 Subject: [PATCH 04/12] new line --- src/Runner.Worker/action_yaml.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runner.Worker/action_yaml.json b/src/Runner.Worker/action_yaml.json index 38da02dc8..407d28c21 100644 --- a/src/Runner.Worker/action_yaml.json +++ b/src/Runner.Worker/action_yaml.json @@ -204,4 +204,4 @@ } } } -} \ No newline at end of file +} From aeae15de7b621fcc500f44442c09f395d2aa39ac Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 14:33:58 -0400 Subject: [PATCH 05/12] Add safety check to prevent from checking defaults in ScriptHandler for composite action --- src/Runner.Worker/ExecutionContext.cs | 13 ++++++++++--- src/Runner.Worker/Handlers/ScriptHandler.cs | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 6f6279c6b..029680366 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -60,10 +60,12 @@ 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); + IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, Dictionary intraActionState = null, int? recordOrder = null, IPagingLogger logger = null, bool isComposite = false); // logging long Write(string tag, string message); @@ -126,6 +128,7 @@ 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; } @@ -148,6 +151,8 @@ 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 @@ -254,7 +259,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); + step.ExecutionContext = Root.CreateChild(_record.Id, step.DisplayName, _record.Id.ToString("N"), scopeName, step.Action.ContextName, logger: _logger, isComposite: true); step.ExecutionContext.ExpressionValues["inputs"] = inputsData; step.ExecutionContext.ExpressionValues["steps"] = Global.StepsContext.GetScope(step.ExecutionContext.GetFullyQualifiedContextName()); @@ -273,7 +278,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) + 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) { Trace.Entering(); @@ -320,6 +325,8 @@ namespace GitHub.Runner.Worker child._logger.Setup(_mainTimelineId, recordId); } + child.IsComposite = isComposite; + return child; } diff --git a/src/Runner.Worker/Handlers/ScriptHandler.cs b/src/Runner.Worker/Handlers/ScriptHandler.cs index f7d90dc45..f1e98054b 100644 --- a/src/Runner.Worker/Handlers/ScriptHandler.cs +++ b/src/Runner.Worker/Handlers/ScriptHandler.cs @@ -153,7 +153,7 @@ namespace GitHub.Runner.Worker.Handlers { // TODO: figure out how defaults interact with template later // for now, we won't check job.defaults if we are inside a template. - if (string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) + if (!ExecutionContext.IsComposite && string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) { if (runDefaults.TryGetValue("working-directory", out workingDirectory)) { @@ -169,7 +169,7 @@ namespace GitHub.Runner.Worker.Handlers { // TODO: figure out how defaults interact with template later // for now, we won't check job.defaults if we are inside a template. - if (string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) + if (!ExecutionContext.IsComposite && string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) { if (runDefaults.TryGetValue("shell", out shell)) { From a22fcbc03638bc5f4db601588cc633b8b680d586 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 14:45:58 -0400 Subject: [PATCH 06/12] Revert "Add safety check to prevent from checking defaults in ScriptHandler for composite action" This reverts commit aeae15de7b621fcc500f44442c09f395d2aa39ac. --- src/Runner.Worker/ExecutionContext.cs | 13 +++---------- src/Runner.Worker/Handlers/ScriptHandler.cs | 4 ++-- 2 files changed, 5 insertions(+), 12 deletions(-) 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/Runner.Worker/Handlers/ScriptHandler.cs b/src/Runner.Worker/Handlers/ScriptHandler.cs index f1e98054b..f7d90dc45 100644 --- a/src/Runner.Worker/Handlers/ScriptHandler.cs +++ b/src/Runner.Worker/Handlers/ScriptHandler.cs @@ -153,7 +153,7 @@ namespace GitHub.Runner.Worker.Handlers { // TODO: figure out how defaults interact with template later // for now, we won't check job.defaults if we are inside a template. - if (!ExecutionContext.IsComposite && string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) + if (string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) { if (runDefaults.TryGetValue("working-directory", out workingDirectory)) { @@ -169,7 +169,7 @@ namespace GitHub.Runner.Worker.Handlers { // TODO: figure out how defaults interact with template later // for now, we won't check job.defaults if we are inside a template. - if (!ExecutionContext.IsComposite && string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) + if (string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) { if (runDefaults.TryGetValue("shell", out shell)) { From 3381b951a0d2a754d67314993845767c556b04fe Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 17:36:40 -0400 Subject: [PATCH 07/12] Need to explictly use ActionStep type since we need the .Inputs attribute which is only found in the ActionStep not IStep --- .../Pipelines/ObjectTemplating/PipelineTemplateConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sdk/DTPipelines/Pipelines/ObjectTemplating/PipelineTemplateConverter.cs b/src/Sdk/DTPipelines/Pipelines/ObjectTemplating/PipelineTemplateConverter.cs index 5a9bc11b9..d680a8f8c 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) { From 2bfa135739e23963e8316bbc6327147fd8a69072 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 17:46:09 -0400 Subject: [PATCH 08/12] Fix ActionManifestManager --- src/Runner.Worker/ActionManifestManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Runner.Worker/ActionManifestManager.cs b/src/Runner.Worker/ActionManifestManager.cs index 5be77c174..6e9f75c26 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.Cast().ToList(), + Steps = steps, Outputs = outputs }; } From 522fbd0546e310ddf8a3d52f42cde49025adab35 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 17:46:51 -0400 Subject: [PATCH 09/12] Remove todos --- src/Runner.Worker/Handlers/ScriptHandler.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Runner.Worker/Handlers/ScriptHandler.cs b/src/Runner.Worker/Handlers/ScriptHandler.cs index f7d90dc45..d4bc492a2 100644 --- a/src/Runner.Worker/Handlers/ScriptHandler.cs +++ b/src/Runner.Worker/Handlers/ScriptHandler.cs @@ -151,8 +151,6 @@ namespace GitHub.Runner.Worker.Handlers string workingDirectory = null; if (!Inputs.TryGetValue("workingDirectory", out workingDirectory)) { - // TODO: figure out how defaults interact with template later - // for now, we won't check job.defaults if we are inside a template. if (string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) { if (runDefaults.TryGetValue("working-directory", out workingDirectory)) @@ -167,8 +165,6 @@ namespace GitHub.Runner.Worker.Handlers string shell = null; if (!Inputs.TryGetValue("shell", out shell) || string.IsNullOrEmpty(shell)) { - // TODO: figure out how defaults interact with template later - // for now, we won't check job.defaults if we are inside a template. if (string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults)) { if (runDefaults.TryGetValue("shell", out shell)) From 143266bc9610974812b18ca528d143a80136de55 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 17:53:29 -0400 Subject: [PATCH 10/12] Revert "Revert "Add safety check to prevent from checking defaults in ScriptHandler for composite action"" This reverts commit a22fcbc03638bc5f4db601588cc633b8b680d586. --- src/Runner.Worker/ExecutionContext.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 6f6279c6b..029680366 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -60,10 +60,12 @@ 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); + IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, Dictionary intraActionState = null, int? recordOrder = null, IPagingLogger logger = null, bool isComposite = false); // logging long Write(string tag, string message); @@ -126,6 +128,7 @@ 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; } @@ -148,6 +151,8 @@ 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 @@ -254,7 +259,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); + step.ExecutionContext = Root.CreateChild(_record.Id, step.DisplayName, _record.Id.ToString("N"), scopeName, step.Action.ContextName, logger: _logger, isComposite: true); step.ExecutionContext.ExpressionValues["inputs"] = inputsData; step.ExecutionContext.ExpressionValues["steps"] = Global.StepsContext.GetScope(step.ExecutionContext.GetFullyQualifiedContextName()); @@ -273,7 +278,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) + 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) { Trace.Entering(); @@ -320,6 +325,8 @@ namespace GitHub.Runner.Worker child._logger.Setup(_mainTimelineId, recordId); } + child.IsComposite = isComposite; + return child; } From 5dfb2cc55236488eec19ac152f1a8548a262385f Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 21 Jul 2020 17:55:34 -0400 Subject: [PATCH 11/12] 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) { From a24e33bbccfc79b1750f1e6668e5e5a5ef30a0e6 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Wed, 22 Jul 2020 12:48:52 -0400 Subject: [PATCH 12/12] Remove needs in env --- src/Runner.Worker/action_yaml.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Runner.Worker/action_yaml.json b/src/Runner.Worker/action_yaml.json index 407d28c21..a36a900bc 100644 --- a/src/Runner.Worker/action_yaml.json +++ b/src/Runner.Worker/action_yaml.json @@ -189,7 +189,6 @@ "step-env": { "context": [ "github", - "needs", "strategy", "matrix", "steps",