From eb120ff74c155c990b4f0987649cf4b541d7a17b Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Sat, 20 Jan 2024 17:24:59 -0800 Subject: [PATCH] build: send Ack if HEAD failed to fetch Nothing we can do. --- ofborg/src/tasks/build.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index 60569a11..6284124e 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -92,6 +92,10 @@ impl<'a, 'b> JobActions<'a, 'b> { self.snippet_log.clone().into() } + pub fn pr_head_missing(&mut self) { + self.tell(worker::Action::Ack); + } + pub fn commit_missing(&mut self) { self.tell(worker::Action::Ack); } @@ -311,7 +315,12 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { }; let refpath = co.checkout_origin_ref(target_branch.as_ref()).unwrap(); - co.fetch_pr(job.pr.number).unwrap(); + + if co.fetch_pr(job.pr.number).is_err() { + info!("Failed to fetch {}", job.pr.number); + actions.pr_head_missing(); + return; + } if !co.commit_exists(job.pr.head_sha.as_ref()) { info!("Commit {} doesn't exist", job.pr.head_sha);