Skip to content
Draft
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
2 changes: 1 addition & 1 deletion packages/loopover-mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ loopover-mcp notifications-read --login <github-login> [--id <delivery-id>]... [
loopover-mcp watch <list|add|remove> [owner/repo] [--labels a,b] [--login <github-login>] [--json]
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]
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]
loopover-mcp review-pr --login <github-login> [--repo owner/repo] [--base origin/main] [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]
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]
loopover-mcp lint-pr-text [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]
loopover-mcp validate-config --file <path> [--source repo_file|api_record|none] [--json]
loopover-mcp slop-risk [--description <text>] [--description-file <path>] [--changed-file <path[:additions:deletions]>]... [--test <command>]... [--test-file <path>]... [--json]
Expand Down
8 changes: 6 additions & 2 deletions packages/loopover-mcp/bin/loopover-mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ const CLI_COMMAND_SPEC = {
},
"review-pr": {
subcommands: [],
usage: ["review-pr --login <github-login> [--repo owner/repo] [--base origin/main] [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]"],
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]"],
},
"lint-pr-text": { subcommands: [], usage: ["lint-pr-text [--commit <message>]... [--body <text>] [--body-file <path>] [--linked-issue <number>] [--json]"] },
"validate-config": { subcommands: [], usage: ["validate-config --file <path> [--source repo_file|api_record|none] [--json]"] },
Expand Down Expand Up @@ -3194,12 +3194,16 @@ function writeBranchAnalysisTable(result: any, command: string) {
function printReviewPrHelp() {
process.stdout.write(
[
"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]",
"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]",
"",
"Compose the existing preflight + slop-risk + PR-text-lint checks into ONE pre-PR review report,",
"so a contributor's own local agent can see everything the loopover gate would flag before ever opening a PR.",
"Mirrors the loopover_review_pr_before_push MCP tool. Thin composition only — does not reimplement any check. No source upload.",
"",
"Repeat --label <name> to pass labels to the review request.",
"Repeat --issue <number> as an alternate way to provide linked issue numbers.",
"When both --linked-issue and --issue are provided, --linked-issue takes precedence and --issue is ignored.",
"",
"Pass --json for machine-readable output.",
].join("\n") + "\n",
);
Expand Down
26 changes: 26 additions & 0 deletions packages/loopover-mcp/test/review-pr-help.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { describe, expect, it, vi } from "vitest";

const BIN_MODULE = "../bin/loopover-mcp.ts";
type BinModule = { runCli: (args: readonly string[]) => Promise<number | void> };

describe("loopover-mcp review-pr help", () => {
it("documents the repeatable labels and issue flags and their precedence", async () => {
const { runCli } = (await import(BIN_MODULE)) as BinModule;
const chunks: string[] = [];
const stdout = vi.spyOn(process.stdout, "write").mockImplementation((chunk: string | Uint8Array): boolean => {
chunks.push(typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8"));
return true;
});

try {
await runCli(["review-pr", "--help"]);
} finally {
stdout.mockRestore();
}

const help = chunks.join("");
expect(help).toContain("[--label <name>]...");
expect(help).toContain("[--issue <number>]...");
expect(help).toContain("--linked-issue takes precedence and --issue is ignored");
});
});
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default defineConfig({
// Codecov, or that PR's own Codecov bot comment). No dashboard is wired up to surface it proactively,
// so check it deliberately if a retry shows up in CI output rather than assuming it's pure infra noise.
retry: 1,
include: ["test/**/*.test.ts"],
include: ["test/**/*.test.ts", "packages/loopover-mcp/test/**/*.test.ts"],
exclude: ["test/workers/**/*.test.ts"],
reporters: junitPath ? ["default", "junit"] : ["default"],
...(junitPath ? { outputFile: { junit: junitPath } } : {}),
Expand Down