Keep label-race recovery narrow and published guidance unchanged

Require every returned validation detail to be the label-name conflict, so a mixed validation failure cannot be hidden by readback. Keep unchanged intake guidance aligned with its shipped mirror; this internal metadata correction changes no reporting instructions or rendered surface.

Contract-Neutral: Existing classification and documentation contracts remain unchanged; tighten the same label-creation conflict recovery and preserve the published guide bytes.
Change-source: pulse-maintainer
This commit is contained in:
pulse-triage[bot]
2026-10-26 04:41:03 +00:00
parent b85e8fc5bb
commit d6bbbc64f3
3 changed files with 5 additions and 9 deletions

View File

@@ -381,8 +381,8 @@ async function ensureLabel(github, context, name, color, description) {
// Reconcile only GitHub's explicit name conflict, without replaying the
// write or treating other validation/access failures as success.
const errors = creationError.response?.data?.errors;
if (creationError.status !== 422 || !Array.isArray(errors) ||
!errors.some((item) => item?.resource === "Label" &&
if (creationError.status !== 422 || !Array.isArray(errors) || !errors.length ||
!errors.every((item) => item?.resource === "Label" &&
item.field === "name" && item.code === "already_exists")) {
throw creationError;
}

View File

@@ -2761,10 +2761,12 @@ test("label-creation reconciliation requires the exact current label", async ()
test("label-creation non-conflict failures are not retried or hidden", async () => {
for (const [status, errors] of [
[401], [403], [429], [500], [422], [422, "unavailable"],
[401], [403], [429], [500], [422], [422, "unavailable"], [422, []],
[422, [{ resource: "Label", field: "name", code: "invalid" }]],
[422, [{ resource: "Issue", field: "name", code: "already_exists" }]],
[422, [{ resource: "Label", field: "description", code: "already_exists" }]],
[422, [{ resource: "Label", field: "name", code: "already_exists" },
{ resource: "Label", field: "color", code: "invalid" }]],
]) {
const { github, calls } = createGithub();
const failure = Object.assign(new Error("Creation failed"), {