Merge pull request #79 from LnL7/label-darwin

massrebuilder: add darwin label based on title
This commit is contained in:
Graham Christensen 2018-02-18 17:55:46 -05:00 committed by GitHub
commit d0012532ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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(),