Skip to content

Commit b8ffe55

Browse files
committed
fix(queue): coalesce matching cross-route ingress
1 parent 3ecc41e commit b8ffe55

6 files changed

Lines changed: 1100 additions & 7 deletions

File tree

‎.github/workflows/sweep.yml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,19 @@ jobs:
271271
payload="$(TARGET_REPO="$target_repo" TARGET_BRANCH="$target_branch" node <<'NODE'
272272
const payload = JSON.parse(process.env.CLIENT_PAYLOAD || "{}");
273273
const itemKind = payload.item_kind === "pull_request" ? "pull_request" : "issue";
274-
const sourceEvent = payload.source_event === "pull_request" ? "pull_request" : "issues";
274+
const sourceEvent =
275+
payload.source_event === "pull_request" || payload.source_event === "pull_request_target"
276+
? "pull_request"
277+
: "issues";
275278
const dispatchKey = String(payload.dispatch_key || "").trim();
279+
const ingressFingerprint = String(payload.ingress_fingerprint || "").trim().toLowerCase();
280+
const ingress =
281+
payload.ingress_route === "target_dispatcher" &&
282+
itemKind === "pull_request" &&
283+
sourceEvent === "pull_request" &&
284+
/^[0-9a-f]{64}$/.test(ingressFingerprint)
285+
? { route: "target_dispatcher", fingerprint: ingressFingerprint }
286+
: undefined;
276287
process.stdout.write(
277288
JSON.stringify({
278289
delivery_id: dispatchKey
@@ -305,6 +316,7 @@ jobs:
305316
? { additionalPrompt: payload.additional_prompt }
306317
: {}),
307318
},
319+
...(ingress ? { ingress } : {}),
308320
}),
309321
);
310322
NODE

0 commit comments

Comments
 (0)