From c31a313ccf781e54fa15942bc882c1b113d3f590 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 24 Feb 2026 11:36:39 +0000 Subject: rename: fetch_repository_data -> fetch_repository_data_{excluding,with}_purgatory The old name was ambiguous - it wasn't clear whether purgatory was included or not. The two variants are now explicitly named: - fetch_repository_data_excluding_purgatory: DB only - fetch_repository_data_with_purgatory: DB + purgatory overlay SyncContext trait method also renamed to fetch_repository_data_with_purgatory to match the free function it delegates to. --- src/purgatory/sync/context.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/purgatory/sync/context.rs') diff --git a/src/purgatory/sync/context.rs b/src/purgatory/sync/context.rs index 8297515..1bba961 100644 --- a/src/purgatory/sync/context.rs +++ b/src/purgatory/sync/context.rs @@ -87,7 +87,10 @@ pub trait SyncContext: Send + Sync { /// /// # Returns /// Repository data including announcements and state events - async fn fetch_repository_data(&self, identifier: &str) -> Result; + async fn fetch_repository_data_with_purgatory( + &self, + identifier: &str, + ) -> Result; /// Get all OIDs needed for purgatory events with this identifier. /// @@ -283,7 +286,10 @@ impl SyncContext for RealSyncContext { urls } - async fn fetch_repository_data(&self, identifier: &str) -> Result { + async fn fetch_repository_data_with_purgatory( + &self, + identifier: &str, + ) -> Result { // Use the purgatory-aware variant so that clone URLs from announcements still // in purgatory (not yet promoted) are available. Without this, the sync loop // would find no URLs to fetch from and the announcement could never be promoted @@ -585,7 +591,7 @@ pub mod mock { /// assert_eq!(mock.fetch_log(), vec!["https://github.com/foo/bar.git"]); /// ``` pub struct MockSyncContext { - /// Repository data to return from fetch_repository_data + /// Repository data to return from fetch_repository_data_with_purgatory repo_data: RwLock>, /// Clone URLs available for the repository (from announcements) @@ -732,7 +738,10 @@ pub mod mock { self.pr_clone_urls.clone() } - async fn fetch_repository_data(&self, _identifier: &str) -> Result { + async fn fetch_repository_data_with_purgatory( + &self, + _identifier: &str, + ) -> Result { // Return stored repo_data or create a minimal one with clone URLs if let Some(data) = self.repo_data.read().unwrap().as_ref() { // Clone the data - this is a test mock so efficiency isn't critical -- cgit v1.2.3