Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,19 @@ impl GitHub {
Ok(assets)
}

fn milestone(&self, title: &str) -> Result<u64> {
self.milestones
.get(title)
.copied()
.ok_or_else(|| anyhow::anyhow!("Milestone '{}' not found", title))
}

pub async fn report(&self, report: Report) -> Result<()> {
let report = Report {
title: report.title,
body: report.body,
labels: report.labels,
assignees: report.assignees,
milestone: report.milestone.map(|t| self.milestone(&t)).transpose()?,

// We make a best-effort attempt to add the milestone. But if the
// milestone isn't found on the repo, we still file an issue so
// that we don't lose the results of the test run.
milestone: report
.milestone
.and_then(|t| self.milestones.get(&t).copied()),
};

let url = format!(
Expand Down