Skip to content

Commit d14881b

Browse files
authored
do not trucate error message from template evaluation (#1038)
1 parent be96323 commit d14881b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/Runner.Worker/ActionManifestManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private TemplateContext CreateTemplateContext(
311311
var result = new TemplateContext
312312
{
313313
CancellationToken = CancellationToken.None,
314-
Errors = new TemplateValidationErrors(10, 500),
314+
Errors = new TemplateValidationErrors(10, int.MaxValue), // Don't truncate error messages otherwise we might not scrub secrets correctly
315315
Memory = new TemplateMemory(
316316
maxDepth: 100,
317317
maxEvents: 1000000,

src/Runner.Worker/ExecutionContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,10 @@ public static PipelineTemplateEvaluator ToPipelineTemplateEvaluator(this IExecut
979979
traceWriter = context.ToTemplateTraceWriter();
980980
}
981981
var schema = PipelineTemplateSchemaFactory.GetSchema();
982-
return new PipelineTemplateEvaluator(traceWriter, schema, context.Global.FileTable);
982+
return new PipelineTemplateEvaluator(traceWriter, schema, context.Global.FileTable)
983+
{
984+
MaxErrorMessageLength = int.MaxValue, // Don't truncate error messages otherwise we might not scrub secrets correctly
985+
};
983986
}
984987

985988
public static ObjectTemplating.ITraceWriter ToTemplateTraceWriter(this IExecutionContext context)

src/Sdk/DTPipelines/Pipelines/ObjectTemplating/PipelineTemplateEvaluator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public PipelineTemplateEvaluator(
4040
/// <summary>
4141
/// Gets the maximum error message length before the message will be truncated.
4242
/// </summary>
43-
public Int32 MaxErrorMessageLength => 500;
43+
public Int32 MaxErrorMessageLength { get; set; } = 500;
4444

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

0 commit comments

Comments
 (0)