From 0d5e84b18355ba74086ee391b03389040c474f55 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 23 Jun 2020 12:20:12 -0400 Subject: [PATCH 1/4] Sort usings in Composite Action Handler --- .../Handlers/CompositeActionHandler.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Runner.Worker/Handlers/CompositeActionHandler.cs b/src/Runner.Worker/Handlers/CompositeActionHandler.cs index 74c3d4c7e..7c5b25ed5 100644 --- a/src/Runner.Worker/Handlers/CompositeActionHandler.cs +++ b/src/Runner.Worker/Handlers/CompositeActionHandler.cs @@ -1,15 +1,16 @@ +using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using System.Threading.Tasks; +using GitHub.DistributedTask.ObjectTemplating.Tokens; +using GitHub.DistributedTask.Pipelines.ContextData; +using GitHub.DistributedTask.WebApi; using GitHub.Runner.Common; using GitHub.Runner.Sdk; -using GitHub.DistributedTask.WebApi; using Pipelines = GitHub.DistributedTask.Pipelines; -using System; -using System.Linq; -using GitHub.DistributedTask.ObjectTemplating.Tokens; -using System.Collections.Generic; -using GitHub.DistributedTask.Pipelines.ContextData; + namespace GitHub.Runner.Worker.Handlers { From 9ec704744117868c967fedb9ca28dcffcaf994bb Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 23 Jun 2020 12:20:39 -0400 Subject: [PATCH 2/4] Change 0 to location --- src/Runner.Worker/ExecutionContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 67ef66cb7..cea1e2fd4 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -277,7 +277,7 @@ namespace GitHub.Runner.Worker step.ExecutionContext = Root.CreateChild(newGuid, step.DisplayName, newGuid.ToString("N"), null, null); step.ExecutionContext.ExpressionValues["inputs"] = inputsData; // TODO: confirm whether not copying message contexts is safe - Root.JobSteps.Insert(0, step); + Root.JobSteps.Insert(location, step); } public IExecutionContext CreateChild(Guid recordId, string displayName, string refName, string scopeName, string contextName, Dictionary intraActionState = null, int? recordOrder = null) From 8aadbbdb8ea93a77cd5c77c6d894f916e812cc5a Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 23 Jun 2020 12:21:34 -0400 Subject: [PATCH 3/4] Update context variables in composite action yaml --- src/Runner.Worker/action_yaml.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Runner.Worker/action_yaml.json b/src/Runner.Worker/action_yaml.json index da8fb79a9..cb1d90b2e 100644 --- a/src/Runner.Worker/action_yaml.json +++ b/src/Runner.Worker/action_yaml.json @@ -104,6 +104,10 @@ "job", "runner", "env", + "always(0,0)", + "failure(0,0)", + "cancelled(0,0)", + "success(0,0)", "hashFiles(1,255)" ], "sequence": { From f9b28c7210a833d76f70c98f87f1655fedbcbdf3 Mon Sep 17 00:00:00 2001 From: Ethan Chiu Date: Tue, 23 Jun 2020 12:23:02 -0400 Subject: [PATCH 4/4] Add helpful error message for null steps --- src/Runner.Worker/ActionManifestManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Runner.Worker/ActionManifestManager.cs b/src/Runner.Worker/ActionManifestManager.cs index 1dbf35ace..9095f498d 100644 --- a/src/Runner.Worker/ActionManifestManager.cs +++ b/src/Runner.Worker/ActionManifestManager.cs @@ -419,6 +419,7 @@ namespace GitHub.Runner.Worker { if (stepsLoaded == null) { + // TODO: Add a more helpful error message + including file name, etc. to show user that it's because of their yaml file throw new ArgumentNullException($"No steps provided."); } else