ira-review 3.1.3 → 3.1.5
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 +18 -9
- package/dist/index.cjs +18 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1032,7 +1032,8 @@ var CopilotCliProvider = class {
|
|
|
1032
1032
|
const env2 = { ...process.env };
|
|
1033
1033
|
const args = [
|
|
1034
1034
|
"-p",
|
|
1035
|
-
|
|
1035
|
+
"",
|
|
1036
|
+
// empty -p triggers stdin read on copilot CLI 1.x
|
|
1036
1037
|
"-s",
|
|
1037
1038
|
// silent — only the response, no stats lines
|
|
1038
1039
|
"--allow-all-tools",
|
|
@@ -1043,10 +1044,12 @@ var CopilotCliProvider = class {
|
|
|
1043
1044
|
];
|
|
1044
1045
|
const useShell = process.platform === "win32";
|
|
1045
1046
|
const child = spawn("copilot", args, {
|
|
1046
|
-
stdio: ["
|
|
1047
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
1047
1048
|
env: env2,
|
|
1048
1049
|
shell: useShell
|
|
1049
1050
|
});
|
|
1051
|
+
child.stdin.write(prompt);
|
|
1052
|
+
child.stdin.end();
|
|
1050
1053
|
let stdout = "";
|
|
1051
1054
|
let stderr = "";
|
|
1052
1055
|
child.stdout.on("data", (chunk) => {
|
|
@@ -1634,17 +1637,23 @@ var CommentTracker = class {
|
|
|
1634
1637
|
return keys;
|
|
1635
1638
|
}
|
|
1636
1639
|
async getBitbucketServerIraComments(pullRequestId) {
|
|
1640
|
+
const visit = (node, sink) => {
|
|
1641
|
+
if (!node) return;
|
|
1642
|
+
if (typeof node.text === "string" && isIraComment(node.text)) {
|
|
1643
|
+
const meta = node.text.match(IRA_META_RE);
|
|
1644
|
+
if (meta) sink.add(`${meta[1]}:${meta[2]}:${meta[3]}`);
|
|
1645
|
+
}
|
|
1646
|
+
if (Array.isArray(node.comments)) {
|
|
1647
|
+
for (const child of node.comments) visit(child, sink);
|
|
1648
|
+
}
|
|
1649
|
+
};
|
|
1637
1650
|
const keys = /* @__PURE__ */ new Set();
|
|
1638
1651
|
let start = 0;
|
|
1639
1652
|
while (true) {
|
|
1640
|
-
const url = `${this.baseUrl}/rest/api/1.0/projects/${this.project}/repos/${this.bbServerRepoSlug}/pull-requests/${pullRequestId}/
|
|
1653
|
+
const url = `${this.baseUrl}/rest/api/1.0/projects/${this.project}/repos/${this.bbServerRepoSlug}/pull-requests/${pullRequestId}/activities?start=${start}&limit=100`;
|
|
1641
1654
|
const data = await this.fetchBitbucketServerPage(url);
|
|
1642
|
-
for (const
|
|
1643
|
-
if (
|
|
1644
|
-
const meta = comment.text.match(IRA_META_RE);
|
|
1645
|
-
if (meta) {
|
|
1646
|
-
keys.add(`${meta[1]}:${meta[2]}:${meta[3]}`);
|
|
1647
|
-
}
|
|
1655
|
+
for (const activity of data.values) {
|
|
1656
|
+
if (activity.action === "COMMENTED") visit(activity.comment, keys);
|
|
1648
1657
|
}
|
|
1649
1658
|
if (data.isLastPage) break;
|
|
1650
1659
|
start = data.nextPageStart ?? start + 100;
|
package/dist/index.cjs
CHANGED
|
@@ -1279,7 +1279,8 @@ var CopilotCliProvider = class {
|
|
|
1279
1279
|
const env2 = { ...process.env };
|
|
1280
1280
|
const args = [
|
|
1281
1281
|
"-p",
|
|
1282
|
-
|
|
1282
|
+
"",
|
|
1283
|
+
// empty -p triggers stdin read on copilot CLI 1.x
|
|
1283
1284
|
"-s",
|
|
1284
1285
|
// silent — only the response, no stats lines
|
|
1285
1286
|
"--allow-all-tools",
|
|
@@ -1290,10 +1291,12 @@ var CopilotCliProvider = class {
|
|
|
1290
1291
|
];
|
|
1291
1292
|
const useShell = process.platform === "win32";
|
|
1292
1293
|
const child = (0, import_node_child_process.spawn)("copilot", args, {
|
|
1293
|
-
stdio: ["
|
|
1294
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
1294
1295
|
env: env2,
|
|
1295
1296
|
shell: useShell
|
|
1296
1297
|
});
|
|
1298
|
+
child.stdin.write(prompt);
|
|
1299
|
+
child.stdin.end();
|
|
1297
1300
|
let stdout = "";
|
|
1298
1301
|
let stderr = "";
|
|
1299
1302
|
child.stdout.on("data", (chunk) => {
|
|
@@ -2429,17 +2432,23 @@ var CommentTracker = class {
|
|
|
2429
2432
|
return keys;
|
|
2430
2433
|
}
|
|
2431
2434
|
async getBitbucketServerIraComments(pullRequestId) {
|
|
2435
|
+
const visit = (node, sink) => {
|
|
2436
|
+
if (!node) return;
|
|
2437
|
+
if (typeof node.text === "string" && isIraComment(node.text)) {
|
|
2438
|
+
const meta = node.text.match(IRA_META_RE);
|
|
2439
|
+
if (meta) sink.add(`${meta[1]}:${meta[2]}:${meta[3]}`);
|
|
2440
|
+
}
|
|
2441
|
+
if (Array.isArray(node.comments)) {
|
|
2442
|
+
for (const child of node.comments) visit(child, sink);
|
|
2443
|
+
}
|
|
2444
|
+
};
|
|
2432
2445
|
const keys = /* @__PURE__ */ new Set();
|
|
2433
2446
|
let start = 0;
|
|
2434
2447
|
while (true) {
|
|
2435
|
-
const url = `${this.baseUrl}/rest/api/1.0/projects/${this.project}/repos/${this.bbServerRepoSlug}/pull-requests/${pullRequestId}/
|
|
2448
|
+
const url = `${this.baseUrl}/rest/api/1.0/projects/${this.project}/repos/${this.bbServerRepoSlug}/pull-requests/${pullRequestId}/activities?start=${start}&limit=100`;
|
|
2436
2449
|
const data = await this.fetchBitbucketServerPage(url);
|
|
2437
|
-
for (const
|
|
2438
|
-
if (
|
|
2439
|
-
const meta = comment.text.match(IRA_META_RE);
|
|
2440
|
-
if (meta) {
|
|
2441
|
-
keys.add(`${meta[1]}:${meta[2]}:${meta[3]}`);
|
|
2442
|
-
}
|
|
2450
|
+
for (const activity of data.values) {
|
|
2451
|
+
if (activity.action === "COMMENTED") visit(activity.comment, keys);
|
|
2443
2452
|
}
|
|
2444
2453
|
if (data.isLastPage) break;
|
|
2445
2454
|
start = data.nextPageStart ?? start + 100;
|