Remove unnessary FileID attribute from CompositeActionExecutionData

This commit is contained in:
Ethan Chiu
2020-06-23 13:40:06 -04:00
parent 9c60f1a264
commit 368b6254ed
4 changed files with 5 additions and 10 deletions

View File

@@ -402,7 +402,6 @@ namespace GitHub.Runner.Worker
Trace.Verbose($"Details: {StringUtil.ConvertToJson(compositeAction.Steps)}"); Trace.Verbose($"Details: {StringUtil.ConvertToJson(compositeAction.Steps)}");
Trace.Info($"Load: {compositeAction.Environment} environment steps"); Trace.Info($"Load: {compositeAction.Environment} environment steps");
Trace.Info($"Details: {StringUtil.ConvertToJson(compositeAction.Environment)}"); Trace.Info($"Details: {StringUtil.ConvertToJson(compositeAction.Environment)}");
Trace.Info($"Composite Action File ID: {compositeAction.FileID.ToString()}");
} }
else else
{ {
@@ -1291,7 +1290,6 @@ namespace GitHub.Runner.Worker
public override bool HasPost => false; public override bool HasPost => false;
public List<Pipelines.ActionStep> Steps { get; set; } public List<Pipelines.ActionStep> Steps { get; set; }
public MappingToken Environment { get; set; } public MappingToken Environment { get; set; }
public Int32 FileID { get; set; }
} }
public abstract class ActionExecutionData public abstract class ActionExecutionData

View File

@@ -27,7 +27,7 @@ namespace GitHub.Runner.Worker
Dictionary<string, string> EvaluateContainerEnvironment(IExecutionContext executionContext, MappingToken token, IDictionary<string, PipelineContextData> extraExpressionValues); Dictionary<string, string> EvaluateContainerEnvironment(IExecutionContext executionContext, MappingToken token, IDictionary<string, PipelineContextData> extraExpressionValues);
public Dictionary<string, string> EvaluateCompositeActionEnvironment(IExecutionContext executionContext, MappingToken token, IDictionary<string, PipelineContextData> extraExpressionValues, Int32 fileID); public Dictionary<string, string> EvaluateCompositeActionEnvironment(IExecutionContext executionContext, MappingToken token, IDictionary<string, PipelineContextData> extraExpressionValues);
string EvaluateDefaultInput(IExecutionContext executionContext, string inputName, TemplateToken token); string EvaluateDefaultInput(IExecutionContext executionContext, string inputName, TemplateToken token);
} }
@@ -226,8 +226,7 @@ namespace GitHub.Runner.Worker
public Dictionary<string, string> EvaluateCompositeActionEnvironment( public Dictionary<string, string> EvaluateCompositeActionEnvironment(
IExecutionContext executionContext, IExecutionContext executionContext,
MappingToken token, MappingToken token,
IDictionary<string, PipelineContextData> extraExpressionValues, IDictionary<string, PipelineContextData> extraExpressionValues)
Int32 fileID)
{ {
var result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); var result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
@@ -236,7 +235,7 @@ namespace GitHub.Runner.Worker
var context = CreateContext(executionContext, extraExpressionValues); var context = CreateContext(executionContext, extraExpressionValues);
try try
{ {
var evaluateResult = TemplateEvaluator.Evaluate(context, "runs-env", token, 0, fileID, omitHeader: false); var evaluateResult = TemplateEvaluator.Evaluate(context, "runs-env", token, 0, null, omitHeader: false);
context.Errors.Check(); context.Errors.Check();
// Mapping // Mapping
@@ -484,8 +483,7 @@ namespace GitHub.Runner.Worker
return new CompositeActionExecutionData() return new CompositeActionExecutionData()
{ {
Steps = stepsLoaded, Steps = stepsLoaded,
Environment = envComposite, Environment = envComposite
FileID = fileID
}; };
} }
} }

View File

@@ -275,7 +275,6 @@ namespace GitHub.Runner.Worker
{ {
// TODO: For UI purposes, look at figuring out how to condense steps in one node => maybe use the same previous GUID // TODO: For UI purposes, look at figuring out how to condense steps in one node => maybe use the same previous GUID
var newGuid = Guid.NewGuid(); var newGuid = Guid.NewGuid();
// TODO: maybe have to use record id to figure out the right place to place the error message?
step.ExecutionContext = Root.CreateChild(newGuid, step.DisplayName, newGuid.ToString("N"), null, null); step.ExecutionContext = Root.CreateChild(newGuid, step.DisplayName, newGuid.ToString("N"), null, null);
step.ExecutionContext.ExpressionValues["inputs"] = inputsData; step.ExecutionContext.ExpressionValues["inputs"] = inputsData;

View File

@@ -54,7 +54,7 @@ namespace GitHub.Runner.Worker.Handlers
// Add the composite action environment variables to each step. // Add the composite action environment variables to each step.
// If the key already exists, we override it since the composite action env variables will have higher precedence // If the key already exists, we override it since the composite action env variables will have higher precedence
// Note that for each composite action step, it's environment variables will be set in the StepRunner automatically // Note that for each composite action step, it's environment variables will be set in the StepRunner automatically
var compositeEnvData = manifestManager.EvaluateCompositeActionEnvironment(ExecutionContext, Data.Environment, extraExpressionValues, Data.FileID); var compositeEnvData = manifestManager.EvaluateCompositeActionEnvironment(ExecutionContext, Data.Environment, extraExpressionValues);
var envData = new Dictionary<string, string>(); var envData = new Dictionary<string, string>();
// Copy over parent environment // Copy over parent environment