From e631adda22ae56a1c3a1cc1c9856007c7410ec4b Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Wed, 15 Oct 2025 17:18:07 -0400 Subject: [PATCH] fix: file an issue when the milestone isn't found If the repo doesn't contain the milestone, we still need to create the issue. This prevents losing the results of the test run. It also may handle the case where the repo is forked and the milestone is missing from the fork. This means that we make a best-effort attempt to attach a milestone to the issue. But if we cannot find one, we file the issue with no milestone linkage. --- src/github.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/github.rs b/src/github.rs index 88f21ea..1235278 100644 --- a/src/github.rs +++ b/src/github.rs @@ -251,20 +251,19 @@ impl GitHub { Ok(assets) } - fn milestone(&self, title: &str) -> Result { - 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!(