mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-16 23:43:10 +00:00
Require store persistence for pull request records
This commit is contained in:
parent
664aa1d6d6
commit
9bf9db6fa0
2 changed files with 11 additions and 5 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue