massrebuilder: add darwin label based on title

This commit is contained in:
Daiderd Jordan 2018-02-17 21:18:05 +01:00
parent 6d215f3332
commit 655cb9d960
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -58,6 +58,20 @@ impl<E: stats::SysEvents> MassRebuildWorker<E> {
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<String>) {
let mut tagger = PathsTagger::new(self.tag_paths.clone());
@ -135,6 +149,8 @@ impl<E: stats::SysEvents> worker::SimpleWorker for MassRebuildWorker<E> {
}
}
self.tag_from_title(&issue);
let mut overall_status = CommitStatus::new(
repo.statuses(),
job.pr.head_sha.clone(),