fix(#2375): pr_is_open state check at submission + atomic fetched_sha INSERT
Two hardening items from argus's review of #2374: 1. PR state check at submission: - Add `pr_is_open(repo, pr)` to forge/pr_merge.rs using `repo_get_pull_request` + `StateType` — early error if the PR is already closed or merged instead of queuing a card that fails later - Call it in `submit_merge_config_pr` before fetching the head sha 2. Atomic fetched_sha INSERT: - Add `fetched_sha: Option<&str>` to `Approvals::submit_kind` so the sha can be included in the INSERT rather than a follow-up UPDATE - MergeConfigPr already knows the sha before inserting the row (pr_head_sha runs first) → pass `Some(&sha)`, drop the separate `set_fetched_sha` call → truly atomic - ApplyCommit still needs two writes (sha resolved by git_fetch_to_tag after the row exists) → pass `None`, `set_fetched_sha` unchanged - All other callers (InitConfig, Spawn, UpdateMetaInputs, SchedulePrompt) pass `None` — no behavioural change - Add `fetched_sha_in_insert_is_readable_via_get` test covering the MergeConfigPr path
This commit is contained in:
parent
d39d05b0b3
commit
96eda4ed6b
7 changed files with 102 additions and 15 deletions
|
|
@ -196,6 +196,7 @@ pub(super) async fn post_request_spawn(
|
|||
"",
|
||||
None,
|
||||
"operator",
|
||||
None,
|
||||
) {
|
||||
Ok(id) => {
|
||||
tracing::info!(%id, %name, "operator: spawn approval queued via dashboard");
|
||||
|
|
|
|||
Loading…
Reference in a new issue