From 96e41c807d43641cfc1a1417e33606799c13e6b1 Mon Sep 17 00:00:00 2001 From: damocles Date: Tue, 23 Jun 2026 13:42:20 +0200 Subject: [PATCH] fix(#1838): extract dispatch_rebuild_approval so dispatch stays under the clippy line cap --- hive-c0re/src/rebuild_queue.rs | 41 ++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/hive-c0re/src/rebuild_queue.rs b/hive-c0re/src/rebuild_queue.rs index 28b2e727..55bd76f5 100644 --- a/hive-c0re/src/rebuild_queue.rs +++ b/hive-c0re/src/rebuild_queue.rs @@ -852,29 +852,36 @@ pub async fn run_fast_worker(coord: std::sync::Arc, + entry: &QueueEntry, + approval_id: i64, +) -> anyhow::Result<()> { + let kind = coord + .approvals + .get(approval_id) + .ok() + .flatten() + .map(|a| a.kind); + if kind == Some(hive_sh4re::ApprovalKind::MergeConfigPr) { + crate::actions::run_approval_merge_config_pr(coord, Some(entry.id), approval_id).await + } else { + crate::actions::run_approval_apply_commit(coord, Some(entry.id), approval_id).await + } +} + async fn dispatch( coord: &std::sync::Arc, entry: &QueueEntry, ) -> anyhow::Result<()> { match (entry.kind, entry.approval_id) { (QueueKind::Rebuild, Some(approval_id)) => { - // Both ApplyCommit and MergeConfigPr approvals enqueue a Rebuild - // entry (they both end in a container rebuild); branch on the - // approval kind to pick the right pipeline. Fall back to the - // apply-commit path if the row can't be read — it re-fetches + - // surfaces a clean error itself. - let kind = coord - .approvals - .get(approval_id) - .ok() - .flatten() - .map(|a| a.kind); - if kind == Some(hive_sh4re::ApprovalKind::MergeConfigPr) { - crate::actions::run_approval_merge_config_pr(coord, Some(entry.id), approval_id) - .await - } else { - crate::actions::run_approval_apply_commit(coord, Some(entry.id), approval_id).await - } + dispatch_rebuild_approval(coord, entry, approval_id).await } (QueueKind::Rebuild, None) => { let current_rev =