Require store persistence for pull request records

This commit is contained in:
Bryan Helmkamp 2026-04-01 21:36:15 -04:00
parent 664aa1d6d6
commit 9bf9db6fa0
No known key found for this signature in database
2 changed files with 11 additions and 5 deletions

View file

@ -131,9 +131,6 @@ async fn create_from(
match record {
Some(record) => {
info!(pr_url = %record.html_url, "Pull request created");
if let Err(err) = run_store.put_pull_request(&record).await {
tracing::warn!(error = %err, "Failed to persist pull request in run store");
}
if let Err(err) = record.save(&run_dir.join("pull_request.json")) {
tracing::warn!(error = %err, "Failed to save pull_request.json");
}

View file

@ -500,7 +500,7 @@ pub async fn maybe_open_pull_request(
}
}
Ok(Some(PullRequestRecord {
let record = PullRequestRecord {
html_url: created.html_url,
number: created.number,
owner,
@ -508,7 +508,16 @@ pub async fn maybe_open_pull_request(
base_branch: base_branch.to_string(),
head_branch: head_branch.to_string(),
title,
}))
};
if let Some(run_store) = run_store {
run_store
.put_pull_request(&record)
.await
.map_err(|err| format!("failed to persist pull request in run store: {err}"))?;
}
Ok(Some(record))
}
/// PULL_REQUEST phase: optionally create a pull request after finalize.