@makerx/yoke 0.17.2 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +31 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Command } from "commander";
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@makerx/yoke",
|
|
10
|
-
version: "0.17.
|
|
10
|
+
version: "0.17.3",
|
|
11
11
|
description: "Lean, user-invoked Claude Code skills for MakerX AI-assisted delivery, plus the CLI they call.",
|
|
12
12
|
license: "MIT",
|
|
13
13
|
author: "MakerX",
|
|
@@ -463,12 +463,38 @@ async function fetchPr(number, exec2 = run) {
|
|
|
463
463
|
if (!isPullRequest(pr2)) throw new ReviewError("`gh pr view` returned an unexpected response");
|
|
464
464
|
return pr2;
|
|
465
465
|
}
|
|
466
|
+
var diffArgsIgnoringGitConfig = [
|
|
467
|
+
"-c",
|
|
468
|
+
"diff.suppressBlankEmpty=false",
|
|
469
|
+
"diff",
|
|
470
|
+
"--no-color",
|
|
471
|
+
"--no-ext-diff",
|
|
472
|
+
"--no-textconv",
|
|
473
|
+
"--submodule=short",
|
|
474
|
+
"--no-relative",
|
|
475
|
+
"--find-renames",
|
|
476
|
+
"--unified=3",
|
|
477
|
+
"--diff-algorithm=myers",
|
|
478
|
+
"--src-prefix=a/",
|
|
479
|
+
"--dst-prefix=b/"
|
|
480
|
+
];
|
|
481
|
+
async function requireMergeBase(pr2, root, exec2) {
|
|
482
|
+
try {
|
|
483
|
+
await exec2("git", ["merge-base", pr2.baseRefOid, pr2.headRefOid], root);
|
|
484
|
+
} catch {
|
|
485
|
+
throw new ReviewError(
|
|
486
|
+
`#${pr2.number} has no merge base in this checkout, which is likely a shallow clone; fetch full history (e.g. \`git fetch --unshallow\` or \`fetch-depth: 0\`) and run the review again`
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
466
490
|
async function fetchDiff(pr2, exec2 = run) {
|
|
467
|
-
const
|
|
491
|
+
const root = (await exec2("git", ["rev-parse", "--show-toplevel"])).trim();
|
|
492
|
+
await exec2("git", ["fetch", "--quiet", await prRemote(pr2, root, exec2), `pull/${pr2.number}/head`, pr2.baseRefOid], root);
|
|
468
493
|
const current = await fetchPr(String(pr2.number), exec2);
|
|
469
494
|
if (current.headRefOid !== pr2.headRefOid || current.baseRefOid !== pr2.baseRefOid)
|
|
470
495
|
throw new ReviewError(`#${pr2.number} changed while its diff was being fetched; run the review again`);
|
|
471
|
-
|
|
496
|
+
await requireMergeBase(pr2, root, exec2);
|
|
497
|
+
return exec2("git", [...diffArgsIgnoringGitConfig, `${pr2.baseRefOid}...${pr2.headRefOid}`], root);
|
|
472
498
|
}
|
|
473
499
|
var commentFields = '{path, line: (.line // .original_line), author: (.user.login // "ghost"), body}';
|
|
474
500
|
var reviewFields = '{path: null, line: null, author: (.user.login // "ghost"), body}';
|
|
@@ -1716,6 +1742,8 @@ var reviewerPrompt = `You are acting as a reviewer for a proposed code change ma
|
|
|
1716
1742
|
|
|
1717
1743
|
Your working directory is the repository under review at the PR's head, so you can read any file in it for context beyond the diff. Do not modify any file.
|
|
1718
1744
|
|
|
1745
|
+
The base and head commits named in the request, and their merge base, are available in the checkout. You may run read-only git commands such as \`git log\`, \`git blame\`, \`git show\` and \`git diff <base>...<head>\` to understand the surrounding code and its recent changes. Do not run any git command that changes the repository, its refs, index or working tree (no checkout, commit, reset, fetch, stash or similar).
|
|
1746
|
+
|
|
1719
1747
|
Read the request file, then produce a thorough code review in Markdown.
|
|
1720
1748
|
|
|
1721
1749
|
## When to flag a finding
|