address argus: 422 from migrate is a validation error, not 'exists'
ensure_mirror_repo treated 409|422 as success (copied from ensure_org, where 422 *does* mean 'org exists'). For the migrate endpoint 422 is a validation error (bad clone_addr/service); the GET-first check is the real idempotency guard, so 409 stays as a race guard but 422 now falls through to the bail arm (→ caller warns) instead of silently dropping a misconfigured mirror.
This commit is contained in:
parent
53df2c9598
commit
64e51fe3bf
1 changed files with 6 additions and 2 deletions
|
|
@ -991,8 +991,12 @@ async fn ensure_mirror_repo(
|
|||
tracing::info!(%owner, %repo, %upstream, "forge: created pull-mirror");
|
||||
Ok(())
|
||||
}
|
||||
409 | 422 => {
|
||||
tracing::debug!(%owner, %repo, "forge: pull-mirror already exists");
|
||||
// 409 = a race created it between our GET check and here (the GET
|
||||
// is the real idempotency guard). NOT 422: for the migrate endpoint
|
||||
// 422 is a validation error (bad clone_addr / service), so it must
|
||||
// surface via the bail arm, not be swallowed as "already exists".
|
||||
409 => {
|
||||
tracing::debug!(%owner, %repo, "forge: pull-mirror already exists (race)");
|
||||
Ok(())
|
||||
}
|
||||
other => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue