Skip to content

Commit

Permalink
do not trucate error message from template evaluation (actions#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsciple authored Apr 6, 2021
1 parent be96323 commit d14881b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Runner.Worker/ActionManifestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private TemplateContext CreateTemplateContext(
var result = new TemplateContext
{
CancellationToken = CancellationToken.None,
Errors = new TemplateValidationErrors(10, 500),
Errors = new TemplateValidationErrors(10, int.MaxValue), // Don't truncate error messages otherwise we might not scrub secrets correctly
Memory = new TemplateMemory(
maxDepth: 100,
maxEvents: 1000000,
Expand Down
5 changes: 4 additions & 1 deletion src/Runner.Worker/ExecutionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,10 @@ public static PipelineTemplateEvaluator ToPipelineTemplateEvaluator(this IExecut
traceWriter = context.ToTemplateTraceWriter();
}
var schema = PipelineTemplateSchemaFactory.GetSchema();
return new PipelineTemplateEvaluator(traceWriter, schema, context.Global.FileTable);
return new PipelineTemplateEvaluator(traceWriter, schema, context.Global.FileTable)
{
MaxErrorMessageLength = int.MaxValue, // Don't truncate error messages otherwise we might not scrub secrets correctly
};
}

public static ObjectTemplating.ITraceWriter ToTemplateTraceWriter(this IExecutionContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public PipelineTemplateEvaluator(
/// <summary>
/// Gets the maximum error message length before the message will be truncated.
/// </summary>
public Int32 MaxErrorMessageLength => 500;
public Int32 MaxErrorMessageLength { get; set; } = 500;

/// <summary>
/// Gets the maximum number of errors that can be recorded when parsing a pipeline.
Expand Down

0 comments on commit d14881b

Please sign in to comment.