ira-review 3.1.3 → 3.1.4

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 CHANGED
@@ -1634,17 +1634,23 @@ var CommentTracker = class {
1634
1634
  return keys;
1635
1635
  }
1636
1636
  async getBitbucketServerIraComments(pullRequestId) {
1637
+ const visit = (node, sink) => {
1638
+ if (!node) return;
1639
+ if (typeof node.text === "string" && isIraComment(node.text)) {
1640
+ const meta = node.text.match(IRA_META_RE);
1641
+ if (meta) sink.add(`${meta[1]}:${meta[2]}:${meta[3]}`);
1642
+ }
1643
+ if (Array.isArray(node.comments)) {
1644
+ for (const child of node.comments) visit(child, sink);
1645
+ }
1646
+ };
1637
1647
  const keys = /* @__PURE__ */ new Set();
1638
1648
  let start = 0;
1639
1649
  while (true) {
1640
- const url = `${this.baseUrl}/rest/api/1.0/projects/${this.project}/repos/${this.bbServerRepoSlug}/pull-requests/${pullRequestId}/comments?start=${start}&limit=100`;
1650
+ const url = `${this.baseUrl}/rest/api/1.0/projects/${this.project}/repos/${this.bbServerRepoSlug}/pull-requests/${pullRequestId}/activities?start=${start}&limit=100`;
1641
1651
  const data = await this.fetchBitbucketServerPage(url);
1642
- for (const comment of data.values) {
1643
- if (!isIraComment(comment.text)) continue;
1644
- const meta = comment.text.match(IRA_META_RE);
1645
- if (meta) {
1646
- keys.add(`${meta[1]}:${meta[2]}:${meta[3]}`);
1647
- }
1652
+ for (const activity of data.values) {
1653
+ if (activity.action === "COMMENTED") visit(activity.comment, keys);
1648
1654
  }
1649
1655
  if (data.isLastPage) break;
1650
1656
  start = data.nextPageStart ?? start + 100;
package/dist/index.cjs CHANGED
@@ -2429,17 +2429,23 @@ var CommentTracker = class {
2429
2429
  return keys;
2430
2430
  }
2431
2431
  async getBitbucketServerIraComments(pullRequestId) {
2432
+ const visit = (node, sink) => {
2433
+ if (!node) return;
2434
+ if (typeof node.text === "string" && isIraComment(node.text)) {
2435
+ const meta = node.text.match(IRA_META_RE);
2436
+ if (meta) sink.add(`${meta[1]}:${meta[2]}:${meta[3]}`);
2437
+ }
2438
+ if (Array.isArray(node.comments)) {
2439
+ for (const child of node.comments) visit(child, sink);
2440
+ }
2441
+ };
2432
2442
  const keys = /* @__PURE__ */ new Set();
2433
2443
  let start = 0;
2434
2444
  while (true) {
2435
- const url = `${this.baseUrl}/rest/api/1.0/projects/${this.project}/repos/${this.bbServerRepoSlug}/pull-requests/${pullRequestId}/comments?start=${start}&limit=100`;
2445
+ const url = `${this.baseUrl}/rest/api/1.0/projects/${this.project}/repos/${this.bbServerRepoSlug}/pull-requests/${pullRequestId}/activities?start=${start}&limit=100`;
2436
2446
  const data = await this.fetchBitbucketServerPage(url);
2437
- for (const comment of data.values) {
2438
- if (!isIraComment(comment.text)) continue;
2439
- const meta = comment.text.match(IRA_META_RE);
2440
- if (meta) {
2441
- keys.add(`${meta[1]}:${meta[2]}:${meta[3]}`);
2442
- }
2447
+ for (const activity of data.values) {
2448
+ if (activity.action === "COMMENTED") visit(activity.comment, keys);
2443
2449
  }
2444
2450
  if (data.isLastPage) break;
2445
2451
  start = data.nextPageStart ?? start + 100;