From 5bd6b9b93cd52da2075bc00a08cf7feca4b85d5c Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 7 Jan 2026 11:40:41 +0000 Subject: Add SyncContext trait and MockSyncContext for purgatory sync Implement the abstraction layer for purgatory sync operations: - SyncContext trait: defines interface for repository data fetching, OID existence checks, git fetch operations, and event processing - ProcessResult: captures outcomes when releasing events from purgatory - MockSyncContext: test mock with builder pattern for configuring: - Clone URLs and which OIDs each URL provides - Needed OIDs (simulates purgatory state) - URL failure simulation - Fetch logging for assertions The trait uses async_trait for async method support and requires Send + Sync for use in concurrent sync operations. This abstraction enables unit testing of sync logic without I/O, while the real implementation (to be added later) will connect to actual database, git, and relay systems. --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index eceebcb..82c2de7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,6 +55,9 @@ clap = { version = "4.5", features = ["derive", "env"] } anyhow = "1.0" thiserror = "1.0" +# Async traits +async-trait = "0.1" + # Git (for future use) # git-http-backend = "0.3" -- cgit v1.2.3