Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/signals/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4977,8 +4977,9 @@ export function hasClearNoIssueRationale(pr: Pick<PullRequestRecord, "title" | "
// `docs? only` missed the hyphen, so a docs-only PR with no linked issue was wrongly denied a clear
// no-issue rationale and hard-blocked under `linkedIssueGateMode === "block"`.
// `tests?[\s-]+only` extends the same rule to test-only PRs (regression/coverage-only diffs) — parallel
// to the docs-only hyphenation fix merged in #1905.
return /\b(?:no issue\s*(?:because\b|:)|no linked issue\s*(?:because\b|:)|no ticket\s*(?:because\b|:)|(?:maintenance|docs?[\s-]+only|tests?[\s-]+only|typo|chore|cleanup)\b)/i.test([pr.title, pr.body ?? ""].join(" "));
// to the docs-only hyphenation fix merged in #1905 and the test-only follow-up in #1993.
// `ci[\s-]+only` covers CI/workflow-only PRs using the same Conventional Commits spelling.
return /\b(?:no issue\s*(?:because\b|:)|no linked issue\s*(?:because\b|:)|no ticket\s*(?:because\b|:)|(?:maintenance|docs?[\s-]+only|tests?[\s-]+only|ci[\s-]+only|typo|chore|cleanup)\b)/i.test([pr.title, pr.body ?? ""].join(" "));
}

function hasValidationNote(value: string): boolean {
Expand Down
13 changes: 13 additions & 0 deletions test/unit/signals-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,19 @@ describe("hasClearNoIssueRationale test-only spelling", () => {
});
});

describe("hasClearNoIssueRationale ci-only spelling", () => {
it("recognizes hyphenated and spaced ci-only rationales", () => {
expect(hasClearNoIssueRationale({ title: "ci only: tighten workflow cache", body: "" })).toBe(true);
expect(hasClearNoIssueRationale({ title: "ci-only: tighten workflow cache", body: "" })).toBe(true);
expect(hasClearNoIssueRationale({ title: "Tune deploy gate", body: "This is a ci only workflow tweak." })).toBe(true);
});

it("still rejects unrelated PR text that mentions CI without a rationale", () => {
expect(hasClearNoIssueRationale({ title: "Fix CI flake in queue tests", body: "Stabilizes a failing job." })).toBe(false);
expect(hasClearNoIssueRationale({ title: "Improve GitHub Actions setup", body: "" })).toBe(false);
});
});

function snapshot(
id: string,
repositories: Array<{
Expand Down
Loading