mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-30 01:32:00 +01:00
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:
4
.github/scripts/issue-version-triage.cjs
vendored
4
.github/scripts/issue-version-triage.cjs
vendored
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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"), {
|
||||
|
||||
Reference in New Issue
Block a user