summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-10-23 18:42:05 +0200
committerpennae <github@quasiparticle.net>2022-10-23 18:42:05 +0200
commitfc4112d756e4976d82f01edbeb6ff8711a5713b4 (patch)
treec784cc23001fe18344c30028692e92f9325e9516
parent3de7d62a33d772cb5ae4fbc19fb91b632b2be667 (diff)
downloadlabel-tracker-fc4112d756e4976d82f01edbeb6ff8711a5713b4.tar.gz
label-tracker-fc4112d756e4976d82f01edbeb6ff8711a5713b4.tar.xz
label-tracker-fc4112d756e4976d82f01edbeb6ff8711a5713b4.zip
fix landedness checks on non-updated prs
`id` is only valid if the pr was updated in the same check, otherwise it must be pulled from the map key.
-rw-r--r--src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 1d09d86..50d0f4e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -278,7 +278,7 @@ fn sync_prs(
.filter(|(_, cs)| !cs.is_empty())
.collect::<BTreeMap<_, _>>();
- for pr in state.pull_requests.values_mut() {
+ for (id, pr) in state.pull_requests.iter_mut() {
let merge = match pr.merge_commit.as_ref() {
Some(m) => m,
None => continue,
@@ -301,7 +301,7 @@ fn sync_prs(
} else {
bail!(
"failed to check landing status of {}: {}, {}",
- pr.id,
+ id,
landed.status,
String::from_utf8_lossy(&landed.stderr));
};
@@ -309,7 +309,7 @@ fn sync_prs(
continue;
}
pr.landed_in.extend(landed.iter().cloned());
- new_history.push((Utc::now(), pr.id.clone(), PullAction::Landed(landed)));
+ new_history.push((Utc::now(), id.clone(), PullAction::Landed(landed)));
}
new_history.sort_by(|a, b| (a.0, &a.1, &a.2).cmp(&(b.0, &b.1, &b.2)));