PEP-212: «Принять» при идущих проверках — один повтор запроса состояния PR (нестабильный тест accept-pending)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9d48bd9047
commit
071aac4bef
@ -149,7 +149,8 @@ export type AcceptResult = TaskRef & { pending?: boolean };
|
|||||||
* False — mergeable now (or no PR, or Gitea can't be asked): accept the usual way.
|
* False — mergeable now (or no PR, or Gitea can't be asked): accept the usual way.
|
||||||
*/
|
*/
|
||||||
async function deferAccept(db: Db, ref: TaskRef, via: string): Promise<boolean> {
|
async function deferAccept(db: Db, ref: TaskRef, via: string): Promise<boolean> {
|
||||||
const gate = await prGate(ref).catch(() => null);
|
// One retry: a transient Gitea hiccup must not turn «Принять» into a refusal while checks are running.
|
||||||
|
const gate = await prGate(ref).catch(() => prGate(ref).catch(() => null));
|
||||||
const pull = gate?.pull;
|
const pull = gate?.pull;
|
||||||
if (!gate || gate.ok || !pull || pull.merged || pull.state !== "open") return false;
|
if (!gate || gate.ok || !pull || pull.merged || pull.state !== "open") return false;
|
||||||
// Red checks are refused with the reason, as before (spec delivery-pipeline): the agent fixes them first.
|
// Red checks are refused with the reason, as before (spec delivery-pipeline): the agent fixes them first.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user