Skip to content

Commit 7d56334

Browse files
committed
fix(mcp): document review-pr label and issue flags
1 parent f665d94 commit 7d56334

4 files changed

Lines changed: 34 additions & 4 deletions

File tree

packages/loopover-mcp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ loopover-mcp notifications-read --login <github-login> [--id <delivery-id>]... [
5252
loopover-mcp watch <list|add|remove> [owner/repo] [--labels a,b] [--login <github-login>] [--json]
5353
loopover-mcp analyze-branch --login <github-login> [--repo owner/repo] [--base origin/main] [--branch-eligibility eligible|ineligible|unknown] [--pending-merged-prs 3] [--expected-open-prs 0] [--projected-credibility 0.8] [--scenario-note "..."] [--validation "passed|npm test|summary"] [--format table] [--json]
5454
loopover-mcp preflight --login <github-login> [--repo owner/repo] [--base origin/main] [--branch-eligibility eligible|ineligible|unknown] [--pending-merged-prs 3] [--expected-open-prs 0] [--projected-credibility 0.8] [--validation "passed|npm test|summary"] [--format table] [--json]
55-
loopover-mcp review-pr --login <github-login> [--repo owner/repo] [--base origin/main] [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]
55+
loopover-mcp review-pr --login <github-login> [--repo owner/repo] [--base origin/main] [--commit <message>]... [--body <text>] [--body-file <path>] [--label <name>]... [--linked-issue <number>] [--issue <number>]... [--json]
5656
loopover-mcp lint-pr-text [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]
5757
loopover-mcp validate-config --file <path> [--source repo_file|api_record|none] [--json]
5858
loopover-mcp slop-risk [--description <text>] [--description-file <path>] [--changed-file <path[:additions:deletions]>]... [--test <command>]... [--test-file <path>]... [--json]

packages/loopover-mcp/bin/loopover-mcp.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ const CLI_COMMAND_SPEC = {
302302
},
303303
"review-pr": {
304304
subcommands: [],
305-
usage: ["review-pr --login <github-login> [--repo owner/repo] [--base origin/main] [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]"],
305+
usage: ["review-pr --login <github-login> [--repo owner/repo] [--base origin/main] [--commit <message>]... [--body <text>] [--body-file <path>] [--label <name>]... [--linked-issue <number>] [--issue <number>]... [--json]"],
306306
},
307307
"lint-pr-text": { subcommands: [], usage: ["lint-pr-text [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]"] },
308308
"validate-config": { subcommands: [], usage: ["validate-config --file <path> [--source repo_file|api_record|none] [--json]"] },
@@ -3194,12 +3194,16 @@ function writeBranchAnalysisTable(result: any, command: string) {
31943194
function printReviewPrHelp() {
31953195
process.stdout.write(
31963196
[
3197-
"Usage: loopover-mcp review-pr --login <github-login> [--repo owner/repo] [--base origin/main] [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]",
3197+
"Usage: loopover-mcp review-pr --login <github-login> [--repo owner/repo] [--base origin/main] [--commit <message>]... [--body <text>] [--body-file <path>] [--label <name>]... [--linked-issue <number>] [--issue <number>]... [--json]",
31983198
"",
31993199
"Compose the existing preflight + slop-risk + PR-text-lint checks into ONE pre-PR review report,",
32003200
"so a contributor's own local agent can see everything the loopover gate would flag before ever opening a PR.",
32013201
"Mirrors the loopover_review_pr_before_push MCP tool. Thin composition only — does not reimplement any check. No source upload.",
32023202
"",
3203+
"Repeat --label <name> to pass labels to the review request.",
3204+
"Repeat --issue <number> as an alternate way to provide linked issue numbers.",
3205+
"When both --linked-issue and --issue are provided, --linked-issue takes precedence and --issue is ignored.",
3206+
"",
32033207
"Pass --json for machine-readable output.",
32043208
].join("\n") + "\n",
32053209
);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { describe, expect, it, vi } from "vitest";
2+
3+
const BIN_MODULE = "../bin/loopover-mcp.ts";
4+
type BinModule = { runCli: (args: readonly string[]) => Promise<number | void> };
5+
6+
describe("loopover-mcp review-pr help", () => {
7+
it("documents the repeatable labels and issue flags and their precedence", async () => {
8+
const { runCli } = (await import(BIN_MODULE)) as BinModule;
9+
const chunks: string[] = [];
10+
const stdout = vi.spyOn(process.stdout, "write").mockImplementation((chunk: string | Uint8Array): boolean => {
11+
chunks.push(typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8"));
12+
return true;
13+
});
14+
15+
try {
16+
await runCli(["review-pr", "--help"]);
17+
} finally {
18+
stdout.mockRestore();
19+
}
20+
21+
const help = chunks.join("");
22+
expect(help).toContain("[--label <name>]...");
23+
expect(help).toContain("[--issue <number>]...");
24+
expect(help).toContain("--linked-issue takes precedence and --issue is ignored");
25+
});
26+
});

vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default defineConfig({
6868
// Codecov, or that PR's own Codecov bot comment). No dashboard is wired up to surface it proactively,
6969
// so check it deliberately if a retry shows up in CI output rather than assuming it's pure infra noise.
7070
retry: 1,
71-
include: ["test/**/*.test.ts"],
71+
include: ["test/**/*.test.ts", "packages/loopover-mcp/test/**/*.test.ts"],
7272
exclude: ["test/workers/**/*.test.ts"],
7373
reporters: junitPath ? ["default", "junit"] : ["default"],
7474
...(junitPath ? { outputFile: { junit: junitPath } } : {}),

0 commit comments

Comments
 (0)