Skip to content

v4: IPipelineValidator dual sync/async API forces sync-over-async — make validation async-only #3808

Description

@thomhurst

IPipelineValidator exposes both Validate(IServiceProvider) and ValidateAsync(IServiceProvider); ArtifactContractValidator.Validate implements the sync member by blocking on the genuinely async module-discovery path (GetRunnableModulesForArtifactValidationAsync(...).GetAwaiter().GetResult()), which duplicates the async implementation line-for-line and risks deadlocks if validation is ever invoked under a synchronization context. PipelineValidationService only ever calls ValidateAsync, so the sync member is dead weight that every validator must still implement.

For v4: drop the sync Validate from the interface (or give it a default implementation delegating to ValidateAsync), aligning with the codebase's otherwise consistent async-suffix convention.

Evidence: src/ModularPipelines/Validation/ArtifactContractValidator.cs:20-32, src/ModularPipelines/Validation/IPipelineValidator.cs, src/ModularPipelines/Validation/PipelineValidationService.cs:15-26


Raised by the v4 scoping audit round 3 — umbrella #3239.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: hygiene and nice-to-haves - wheneverbreakingBreaking API changeenhancementNew feature or requestin-progressPicked up by an agent

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions