From 655cb9d960a131cbca04cde103c2f4ae1341860b Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 17 Feb 2018 21:18:05 +0100 Subject: [PATCH] massrebuilder: add darwin label based on title --- ofborg/src/tasks/massrebuilder.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ofborg/src/tasks/massrebuilder.rs b/ofborg/src/tasks/massrebuilder.rs index 155143b..741ab07 100644 --- a/ofborg/src/tasks/massrebuilder.rs +++ b/ofborg/src/tasks/massrebuilder.rs @@ -58,6 +58,20 @@ impl MassRebuildWorker { return massrebuildjob::Actions {}; } + fn tag_from_title(&self, issue: &hubcaps::issues::IssueRef) { + let darwin = issue.get() + .map(|iss| iss.title.to_lowercase().contains("darwin")) + .unwrap_or(false); + + if darwin { + update_labels( + &issue, + vec![String::from("6.topic: darwin")], + vec![], + ); + } + } + fn tag_from_paths(&self, issue: &hubcaps::issues::IssueRef, paths: Vec) { let mut tagger = PathsTagger::new(self.tag_paths.clone()); @@ -135,6 +149,8 @@ impl worker::SimpleWorker for MassRebuildWorker { } } + self.tag_from_title(&issue); + let mut overall_status = CommitStatus::new( repo.statuses(), job.pr.head_sha.clone(),