Skip to content

Commit 76f30bc

Browse files
committed
fix(ci): reject unknown Version and vague bug reproductions
Close the #624 gap where Version like Unknown/모름 and title-like Reproduction still passed the new bug form.
1 parent 8d6e1fa commit 76f30bc

2 files changed

Lines changed: 217 additions & 8 deletions

File tree

‎.github/scripts/issue-quality.cjs‎

Lines changed: 77 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,26 @@ function isPlaceholder(text) {
398398
return isPlaceholderOnlyValue(text);
399399
}
400400

401+
/**
402+
* True when Version is an "I don't know" stand-in rather than an install id.
403+
* Kept separate from PLACEHOLDER_ONLY_RE so legacy N/A / No response soft-pass
404+
* behaviour is unchanged.
405+
*/
406+
const UNUSABLE_VERSION_RE =
407+
/^[\s_*~`]*(?:unknown|unkown|uknown|don'?t\s+know|do\s+not\s+know|idk|dunno|not\s+sure|unsure|\?+|모름|잘\s*모름|모르겠(?:습니다|음)?|不明|わからない|分からない|不知道|不清楚|keine\s+ahnung|wei[sß]{1,2}\s+nicht)[\s_*~`]*[.!?]*$/i;
408+
409+
function isUnusableVersion(raw) {
410+
if (typeof raw !== "string") return false;
411+
let value = raw.replace(/<!--[\s\S]*?-->/g, "").trim();
412+
if (!value) return false;
413+
const unwrapped = unwrapSingleEnclosingFence(value);
414+
if (unwrapped !== null) {
415+
value = unwrapped.trim();
416+
if (!value) return false;
417+
}
418+
return UNUSABLE_VERSION_RE.test(value);
419+
}
420+
401421
const CJK_RE =
402422
/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu;
403423

@@ -433,6 +453,16 @@ function isTooTerseFeatureSection(text) {
433453
return true;
434454
}
435455

456+
/**
457+
* Bug Reproduction needs steps or concrete signals. A title-like phrase with
458+
* no commands, paths, digits, or product keywords is not actionable.
459+
*/
460+
function isTooTerseBugReproduction(text) {
461+
if (isEmpty(text) || isPlaceholder(text)) return false;
462+
if (hasConcreteDetail(text)) return false;
463+
return countWords(text) < 12;
464+
}
465+
436466
/**
437467
* Check if raw section text is a placeholder-only variant without relying on
438468
* clean() first. Used to distinguish intentionally blank optional fields
@@ -628,6 +658,8 @@ function validateIssue(issue) {
628658
const repro = extractSection(body, "Reproduction");
629659
const version = extractSection(body, "Version");
630660
const os = extractSection(body, "Operating system") ?? extractSection(body, "OS");
661+
// New Bug report template always includes Client or integration.
662+
const isNewBugForm = extractSection(body, "Client or integration") !== null;
631663

632664
if (isEmpty(summary) && isEmpty(repro)) {
633665
// Soft-pass substantial non-English / freeform structured reports once
@@ -655,17 +687,53 @@ function validateIssue(issue) {
655687
if (isEmpty(repro)) {
656688
reasons.push("Reproduction is empty.");
657689
guidance.push("List the exact steps to reproduce the problem.");
690+
} else if (!softPass && isTooTerseBugReproduction(repro)) {
691+
reasons.push("Reproduction is too vague to act on.");
692+
guidance.push("List exact steps, commands, and the observed failure — not only a short phrase.");
658693
}
659694
}
660695

661-
// Required environment fields removed after submission.
662-
// Only fire when the headings exist in the body (new form). Legacy bug
663-
// reports never had Version or OS fields, so null means absent, not removed.
664-
// Skip when the raw value is a "No response" placeholder -- the old form had
665-
// both fields as optional, so legacy issues legitimately contain those headings
666-
// with the GitHub placeholder. Only close when the field was actively cleared.
667-
if (!softPass && version !== null && os !== null && isEmpty(version) && isEmpty(os) &&
668-
!isRawPlaceholder(version) && !isRawPlaceholder(os)) {
696+
// Version "Unknown" / "모름" / "idk" is never actionable, on any form.
697+
if (!softPass && version !== null && isUnusableVersion(version)) {
698+
reasons.push("Version is missing or unknown.");
699+
guidance.push("Report the installed `@bitkyc08/opencodex` version (for example `2.7.42`) or a commit SHA from `ocx --version`.");
700+
} else if (
701+
!softPass &&
702+
isNewBugForm &&
703+
version !== null &&
704+
(isEmpty(version) || isRawPlaceholder(version))
705+
) {
706+
// New form requires Version. Legacy N/A / No response soft-pass stays
707+
// only for bodies without Client or integration.
708+
reasons.push("Version is missing.");
709+
guidance.push("Add your OpenCodex version so we can reproduce the environment.");
710+
}
711+
712+
if (
713+
!softPass &&
714+
isNewBugForm &&
715+
os !== null &&
716+
(isEmpty(os) || isRawPlaceholder(os))
717+
) {
718+
reasons.push("Operating system is missing.");
719+
guidance.push("Add your OS name and version (for example Windows 11 24H2).");
720+
}
721+
722+
// Required environment fields removed after submission on bodies that are
723+
// not the new form (no Client or integration). Legacy reports never had
724+
// Version or OS fields, so null means absent, not removed. Skip when the
725+
// raw value is a "No response" placeholder — the old form had both fields
726+
// as optional. Only close when the field was actively cleared.
727+
if (
728+
!softPass &&
729+
!isNewBugForm &&
730+
version !== null &&
731+
os !== null &&
732+
isEmpty(version) &&
733+
isEmpty(os) &&
734+
!isRawPlaceholder(version) &&
735+
!isRawPlaceholder(os)
736+
) {
669737
reasons.push("Version and Operating system are both missing.");
670738
guidance.push("Add your OpenCodex version and OS so we can reproduce the environment.");
671739
}
@@ -873,6 +941,7 @@ module.exports = {
873941
isPlaceholderOnlyValue,
874942
isPlaceholder,
875943
isRawPlaceholder,
944+
isUnusableVersion,
876945
countWords,
877946
hasConcreteDetail,
878947
labelForKind,

‎.github/scripts/issue-quality.test.cjs‎

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const {
1616
isPlaceholderOnlyValue,
1717
isPlaceholder,
1818
isRawPlaceholder,
19+
isUnusableVersion,
1920
countWords,
2021
hasConcreteDetail,
2122
rejectsWorkflowDispatchPullRequest,
@@ -693,6 +694,135 @@ describe("validateIssue - bug", () => {
693694
assert.equal(result.valid, false);
694695
assert.ok(result.reasons.some((r) => r.includes("Version")));
695696
});
697+
698+
it("rejects unknown / don't-know Version values (#624)", () => {
699+
const versions = [
700+
"Unknown",
701+
"Uknown",
702+
"unkown",
703+
"Don't know",
704+
"dont know",
705+
"idk",
706+
"모름",
707+
"잘 모름",
708+
"?",
709+
"???",
710+
];
711+
for (const version of versions) {
712+
const body = [
713+
"### Client or integration",
714+
"Codex CLI",
715+
"### Area",
716+
"CLI",
717+
"### Summary",
718+
"The OpenCodex proxy keeps dropping the Codex CLI connection mid-request.",
719+
"### Reproduction",
720+
"1. ocx start --port 10100",
721+
"2. Send any Codex CLI request through the proxy",
722+
"3. Observe the connection drop",
723+
"### Version",
724+
version,
725+
"### Operating system",
726+
"Windows 11",
727+
].join("\n");
728+
const result = validateIssue({
729+
title: "Unexpected interruption continues to occur",
730+
body,
731+
labels: ["bug"],
732+
});
733+
assert.equal(result.kind, "bug");
734+
assert.equal(
735+
result.valid,
736+
false,
737+
`Expected unusable Version "${version}" to be invalid, got: ${result.reasons.join("; ")}`,
738+
);
739+
assert.ok(
740+
result.reasons.some((r) => /Version/i.test(r) && /unknown|missing/i.test(r)),
741+
`Expected Version unknown/missing reason for "${version}", got: ${result.reasons.join("; ")}`,
742+
);
743+
}
744+
});
745+
746+
it("rejects issue #624-style low-effort new-form bug", () => {
747+
const body = [
748+
"### Client or integration",
749+
"Codex CLI",
750+
"### Area",
751+
"CLI",
752+
"### Summary",
753+
"CLI로 확인해봤는데 오픈코덱스 프록시가 중간에 자꾸 연결이 끊어져서 그런거라고 합니다.",
754+
"",
755+
"수정 바랍니다.",
756+
"### Reproduction",
757+
"예기치않게중단됨",
758+
"### Version",
759+
"모름",
760+
"### Operating system",
761+
"윈11",
762+
"### Provider and model",
763+
"_No response_",
764+
"### Logs or error output",
765+
"```shell",
766+
"",
767+
"```",
768+
].join("\n");
769+
const result = validateIssue({
770+
title: "Unexpected interruption continues to occur",
771+
body,
772+
labels: ["bug"],
773+
});
774+
assert.equal(result.kind, "bug");
775+
assert.equal(result.valid, false);
776+
assert.ok(result.reasons.some((r) => /Version/i.test(r)));
777+
assert.ok(result.reasons.some((r) => /Reproduction/i.test(r) && /vague|empty/i.test(r)));
778+
});
779+
780+
it("rejects a new-form bug with a usable Version but placeholder OS", () => {
781+
const body = [
782+
"### Client or integration",
783+
"Codex CLI",
784+
"### Area",
785+
"CLI",
786+
"### Summary",
787+
"Proxy returns 502 when streaming is enabled on Windows.",
788+
"### Reproduction",
789+
"1. ocx start",
790+
"2. Send a streaming /v1/responses request",
791+
"### Version",
792+
"2.7.42",
793+
"### Operating system",
794+
"No response",
795+
].join("\n");
796+
const result = validateIssue({ title: "Streaming 502", body, labels: ["bug"] });
797+
assert.equal(result.kind, "bug");
798+
assert.equal(result.valid, false);
799+
assert.ok(result.reasons.some((r) => /Operating system/i.test(r)));
800+
});
801+
802+
it("rejects a new-form bug whose Reproduction is only a vague phrase", () => {
803+
const body = [
804+
"### Client or integration",
805+
"Codex CLI",
806+
"### Area",
807+
"CLI",
808+
"### Summary",
809+
"The OpenCodex proxy keeps dropping the Codex CLI connection mid-request.",
810+
"### Reproduction",
811+
"Unexpected interruption",
812+
"### Version",
813+
"2.7.42",
814+
"### Operating system",
815+
"Windows 11",
816+
].join("\n");
817+
const result = validateIssue({
818+
title: "Unexpected interruption continues to occur",
819+
body,
820+
labels: ["bug"],
821+
});
822+
assert.equal(result.kind, "bug");
823+
assert.equal(result.valid, false);
824+
assert.ok(result.reasons.some((r) => /Reproduction/i.test(r) && /vague/i.test(r)));
825+
});
696826
});
697827

698828
// ---------------------------------------------------------------------------
@@ -839,6 +969,16 @@ describe("normalisation", () => {
839969
assert.equal(clean("Not available!"), "");
840970
});
841971

972+
it("detects unusable Version stand-ins without treating them as generic placeholders", () => {
973+
for (const value of ["Unknown", "Uknown", "모름", "idk", "don't know"]) {
974+
assert.equal(isUnusableVersion(value), true, value);
975+
assert.equal(isPlaceholderOnlyValue(value), false, value);
976+
}
977+
for (const value of ["2.7.42", "N/A", "No response", "main@abc1234"]) {
978+
assert.equal(isUnusableVersion(value), false, value);
979+
}
980+
});
981+
842982
it("does not treat sentences containing placeholder phrases as empty", () => {
843983
assert.equal(clean("This is N/A for voice mode today."), "This is N/A for voice mode today.");
844984
assert.equal(clean("Not applicable to Claude Code."), "Not applicable to Claude Code.");

0 commit comments

Comments
 (0)