Expose typed validation reports
This commit is contained in:
@@ -471,11 +471,11 @@ func setTypedLaneManifestMetadata(output *RunOutput, laneID string, extractor, m
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Runner) validateTypedArtifact(ctx context.Context, codec artifactCodecEntry, target typedValidationTarget, chain preparedValidatorChain, attempt int, debug DebugRecorder) ([]contracts.Warning, *contracts.RejectedOutput, error) {
|
||||
func (r *Runner) validateTypedReport(ctx context.Context, codec artifactCodecEntry, target typedValidationTarget, chain preparedValidatorChain, attempt int, debug DebugRecorder) (validationReport, error) {
|
||||
if len(chain.validators) > 0 && target.candidate == nil {
|
||||
candidate, err := validationCandidateArtifact(codec, target)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("serialize %s candidate for validation: %w", target.stage, err)
|
||||
return validationReport{}, fmt.Errorf("serialize %s candidate for validation: %w", target.stage, err)
|
||||
}
|
||||
target.candidate = &candidate
|
||||
}
|
||||
@@ -537,6 +537,14 @@ func (r *Runner) validateTypedArtifact(ctx context.Context, codec artifactCodecE
|
||||
}
|
||||
return validationInvocation{result: result}, nil
|
||||
})
|
||||
if err != nil {
|
||||
return report, err
|
||||
}
|
||||
return report, nil
|
||||
}
|
||||
|
||||
func (r *Runner) validateTypedArtifact(ctx context.Context, codec artifactCodecEntry, target typedValidationTarget, chain preparedValidatorChain, attempt int, debug DebugRecorder) ([]contracts.Warning, *contracts.RejectedOutput, error) {
|
||||
report, err := r.validateTypedReport(ctx, codec, target, chain, attempt, debug)
|
||||
if err != nil {
|
||||
return report.Warnings(), nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user