@aligndottech/connector-core 0.4.0 → 0.5.0

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.
@@ -1,8 +1,20 @@
1
1
  import type { ConnectorFetcher, ConnectorFetcherOptions, FetcherItem } from '../types/fetcher.js';
2
2
  /**
3
- * Read-only personal GitHub fetcher: the caller's merged PRs and issues they
4
- * commented on. Author = the PR/issue user ("who to talk to"). Paginates up to
5
- * `limit` across both searches.
3
+ * Read-only personal GitHub fetcher.
4
+ *
5
+ * ALI-805: the old two queries (`author:+is:merged`, `commenter:`) missed
6
+ * self-filed issues (`commenter:` never matches the original post), every
7
+ * open or reverted PR (`is:merged` drops both - and a reversal is one of the
8
+ * most decision-dense things in a repo), and anything only assigned or
9
+ * mentioned. `involves:` is GitHub's own union of author/assignee/mentions/
10
+ * commenter, so it replaces both narrow queries - but it does NOT cover code
11
+ * review (confirmed against GitHub's search-qualifiers docs), so a PR the
12
+ * user only reviewed needs its own `reviewed-by:` query.
13
+ *
14
+ * And per item, this now fetches the discussion - issue/PR comments, PR
15
+ * review bodies, and inline review comments - not just the title and body.
16
+ * That is where the "why" usually lives: the body says what changed, the
17
+ * thread is where someone objects and the author agrees or pushes back.
6
18
  */
7
19
  export declare class GitHubFetcher implements ConnectorFetcher {
8
20
  fetch(opts: ConnectorFetcherOptions): Promise<FetcherItem[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/fetchers/github.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AA+BlG;;;;GAIG;AACH,qBAAa,aAAc,YAAW,gBAAgB;IAC9C,KAAK,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAmDnE"}
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/fetchers/github.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmLlG;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,YAAW,gBAAgB;IAC9C,KAAK,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAiCnE"}
@@ -2,6 +2,16 @@ import { fetch } from 'undici';
2
2
  // GitHub's Search API returns at most 100 results/page and 1000 total (10 pages).
3
3
  const GH_PER_PAGE_MAX = 100;
4
4
  const GH_SEARCH_MAX_PAGES = 10;
5
+ // How many items may have their discussion (comments/reviews) in flight at
6
+ // once. Each item costs up to 3 extra requests (issue comments, PR reviews,
7
+ // PR review comments) - bounding this keeps a large personal history from
8
+ // blasting past GitHub's rate limit. Lower than the gateway's hosted scan
9
+ // (20, services/gateway/src/discover/githubHistorical.ts) because this runs
10
+ // unattended on a personal token with no retry/backoff around it.
11
+ const PARALLEL_DISCUSSION_FETCHES = 5;
12
+ // A single comment/review section is capped so one pathological thread (a
13
+ // bot dump, a copy-pasted log) can't blow the whole item's extraction budget.
14
+ const MAX_SECTION_CHARS = 4000;
5
15
  /** Page through a GitHub search query until `target` items are collected (or the
6
16
  * results run out / the 1000-result ceiling is hit). */
7
17
  async function searchAll(query, headers, target) {
@@ -19,10 +29,127 @@ async function searchAll(query, headers, target) {
19
29
  }
20
30
  return out.slice(0, target);
21
31
  }
32
+ /** Alternate between two ordered lists (PRs, issues) so neither can crowd the
33
+ * other out once the combined total is trimmed to `limit`. A plain
34
+ * concat-then-slice would let a prolific PR history exhaust the limit before
35
+ * a single issue is considered. */
36
+ function interleave(a, b, limit) {
37
+ const out = [];
38
+ let i = 0;
39
+ let j = 0;
40
+ while (out.length < limit && (i < a.length || j < b.length)) {
41
+ if (i < a.length)
42
+ out.push({ kind: 'pr', row: a[i++] });
43
+ if (out.length < limit && j < b.length)
44
+ out.push({ kind: 'issue', row: b[j++] });
45
+ }
46
+ return out;
47
+ }
48
+ /** Bounded-concurrency map that preserves input order in the output, so a
49
+ * fast item never jumps ahead of a slow one in the returned list. */
50
+ async function mapWithConcurrency(items, concurrency, fn) {
51
+ const results = new Array(items.length);
52
+ let next = 0;
53
+ async function worker() {
54
+ for (;;) {
55
+ const i = next++;
56
+ if (i >= items.length)
57
+ return;
58
+ results[i] = await fn(items[i]);
59
+ }
60
+ }
61
+ await Promise.all(Array.from({ length: Math.max(1, Math.min(concurrency, items.length)) }, () => worker()));
62
+ return results;
63
+ }
64
+ function capSection(heading, entries) {
65
+ if (entries.length === 0)
66
+ return '';
67
+ let body = entries.join('\n\n');
68
+ if (body.length > MAX_SECTION_CHARS) {
69
+ body = `${body.slice(0, MAX_SECTION_CHARS)}\n[discussion truncated]`;
70
+ }
71
+ return `\n\n## ${heading}\n${body}`;
72
+ }
73
+ function formatEntries(entries, withState) {
74
+ return entries
75
+ .filter((e) => e.body?.trim())
76
+ .map((e) => {
77
+ const who = e.user?.login ?? 'Unknown';
78
+ const when = e.submitted_at ?? e.created_at ?? '';
79
+ const state = withState && e.state ? ` [${e.state}]` : '';
80
+ return `[${who}] (${when})${state}:\n${e.body}`;
81
+ });
82
+ }
83
+ /** Fetch one discussion endpoint, tolerating a failed or throwing request so
84
+ * one bad section never drops an otherwise-good item (ALI-805: the argument
85
+ * is a bonus on top of the announcement, not a requirement for it). */
86
+ async function fetchSection(url, headers, heading, withState) {
87
+ try {
88
+ const res = await fetch(url, { headers });
89
+ if (!res.ok)
90
+ return '';
91
+ const entries = (await res.json());
92
+ return capSection(heading, formatEntries(entries, withState));
93
+ }
94
+ catch {
95
+ return '';
96
+ }
97
+ }
98
+ function repoOf(item) {
99
+ return (item.repository_url ?? '').replace('https://api.github.com/repos/', '');
100
+ }
101
+ async function buildPrItem(pr, headers) {
102
+ const repo = repoOf(pr);
103
+ const status = pr.pull_request?.merged_at ? 'merged' : pr.state;
104
+ let rawText = `${pr.title}\n\n${pr.body ?? ''}\n\nStatus: ${status}\nRepo: ${repo}`.trim();
105
+ if (repo && pr.number != null) {
106
+ // Sequential, not Promise.all: GitHub's own best-practices guidance is
107
+ // to make requests serially rather than concurrently to avoid secondary
108
+ // rate limiting. PARALLEL_DISCUSSION_FETCHES already bounds how many
109
+ // ITEMS run at once - firing 3 more requests concurrently per item would
110
+ // undo that bound (5 items x 3 requests = 15 requests in flight).
111
+ rawText += await fetchSection(`https://api.github.com/repos/${repo}/issues/${pr.number}/comments?per_page=20`, headers, 'Comments', false);
112
+ rawText += await fetchSection(`https://api.github.com/repos/${repo}/pulls/${pr.number}/reviews?per_page=20`, headers, 'Code Reviews', true);
113
+ rawText += await fetchSection(`https://api.github.com/repos/${repo}/pulls/${pr.number}/comments?per_page=20`, headers, 'Review Comments', false);
114
+ }
115
+ return {
116
+ source_url: pr.html_url,
117
+ platform: 'github',
118
+ raw_text: rawText,
119
+ title: pr.title,
120
+ ...(pr.user ? { author: { name: pr.user.login, handle: pr.user.login, url: pr.user.html_url } } : {}),
121
+ };
122
+ }
123
+ async function buildIssueItem(issue, headers) {
124
+ const repo = repoOf(issue);
125
+ let rawText = `${issue.title}\n\n${issue.body ?? ''}\n\nStatus: ${issue.state}`.trim();
126
+ if (repo && issue.number != null) {
127
+ rawText += await fetchSection(`https://api.github.com/repos/${repo}/issues/${issue.number}/comments?per_page=20`, headers, 'Comments', false);
128
+ }
129
+ return {
130
+ source_url: issue.html_url,
131
+ platform: 'github',
132
+ raw_text: rawText,
133
+ title: issue.title,
134
+ ...(issue.user ? { author: { name: issue.user.login, handle: issue.user.login, url: issue.user.html_url } } : {}),
135
+ };
136
+ }
22
137
  /**
23
- * Read-only personal GitHub fetcher: the caller's merged PRs and issues they
24
- * commented on. Author = the PR/issue user ("who to talk to"). Paginates up to
25
- * `limit` across both searches.
138
+ * Read-only personal GitHub fetcher.
139
+ *
140
+ * ALI-805: the old two queries (`author:+is:merged`, `commenter:`) missed
141
+ * self-filed issues (`commenter:` never matches the original post), every
142
+ * open or reverted PR (`is:merged` drops both - and a reversal is one of the
143
+ * most decision-dense things in a repo), and anything only assigned or
144
+ * mentioned. `involves:` is GitHub's own union of author/assignee/mentions/
145
+ * commenter, so it replaces both narrow queries - but it does NOT cover code
146
+ * review (confirmed against GitHub's search-qualifiers docs), so a PR the
147
+ * user only reviewed needs its own `reviewed-by:` query.
148
+ *
149
+ * And per item, this now fetches the discussion - issue/PR comments, PR
150
+ * review bodies, and inline review comments - not just the title and body.
151
+ * That is where the "why" usually lives: the body says what changed, the
152
+ * thread is where someone objects and the author agrees or pushes back.
26
153
  */
27
154
  export class GitHubFetcher {
28
155
  async fetch(opts) {
@@ -37,31 +164,19 @@ export class GitHubFetcher {
37
164
  }
38
165
  const user = (await userRes.json());
39
166
  const limit = opts.limit ?? 100;
40
- const items = [];
41
- const prs = await searchAll(`https://api.github.com/search/issues?q=author:${user.login}+type:pr+is:merged`, headers, limit);
42
- for (const pr of prs) {
43
- const repo = (pr.repository_url ?? '').replace('https://api.github.com/repos/', '');
44
- items.push({
45
- source_url: pr.html_url,
46
- platform: 'github',
47
- raw_text: `${pr.title}\n\n${pr.body ?? ''}\n\nStatus: ${pr.state}\nRepo: ${repo}`.trim(),
48
- title: pr.title,
49
- ...(pr.user ? { author: { name: pr.user.login, handle: pr.user.login, url: pr.user.html_url } } : {}),
50
- });
51
- }
52
- if (items.length < limit) {
53
- const issues = await searchAll(`https://api.github.com/search/issues?q=commenter:${user.login}+type:issue`, headers, limit - items.length);
54
- for (const issue of issues) {
55
- items.push({
56
- source_url: issue.html_url,
57
- platform: 'github',
58
- raw_text: `${issue.title}\n\n${issue.body ?? ''}\n\nStatus: ${issue.state}`.trim(),
59
- title: issue.title,
60
- ...(issue.user ? { author: { name: issue.user.login, handle: issue.user.login, url: issue.user.html_url } } : {}),
61
- });
62
- }
63
- }
64
- return items.slice(0, limit);
167
+ const [involvesPrs, reviewedPrs, issues] = await Promise.all([
168
+ searchAll(`https://api.github.com/search/issues?q=involves:${user.login}+type:pr`, headers, limit),
169
+ searchAll(`https://api.github.com/search/issues?q=reviewed-by:${user.login}+type:pr`, headers, limit),
170
+ searchAll(`https://api.github.com/search/issues?q=involves:${user.login}+type:issue`, headers, limit),
171
+ ]);
172
+ // involves: and reviewed-by: can both return the same PR (e.g. you
173
+ // authored it AND someone else reviewed you on it too) - dedupe before
174
+ // the item ever reaches the discussion-fetch stage.
175
+ const prByUrl = new Map();
176
+ for (const pr of [...involvesPrs, ...reviewedPrs])
177
+ prByUrl.set(pr.html_url, pr);
178
+ const rows = interleave([...prByUrl.values()], issues, limit);
179
+ return mapWithConcurrency(rows, PARALLEL_DISCUSSION_FETCHES, (r) => r.kind === 'pr' ? buildPrItem(r.row, headers) : buildIssueItem(r.row, headers));
65
180
  }
66
181
  }
67
182
  //# sourceMappingURL=github.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"github.js","sourceRoot":"","sources":["../../src/fetchers/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAY/B,kFAAkF;AAClF,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B;yDACyD;AACzD,KAAK,UAAU,SAAS,CAAC,KAAa,EAAE,OAA+B,EAAE,MAAc;IACrF,MAAM,GAAG,GAAuB,EAAE,CAAC;IACnC,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,IAAI,mBAAmB,EAAE,IAAI,EAAE,EAAE,CAAC;QAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAC/D,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,KAAK,0BAA0B,OAAO,SAAS,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAC/F,IAAI,CAAC,GAAG,CAAC,EAA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AW,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC3D,SAAS,CAAC,mDAAmD,IAAI,CAAC,KAAK,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC;YAClG,SAAS,CAAC,sDAAsD,IAAI,CAAC,KAAK,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC;YACrG,SAAS,CAAC,mDAAmD,IAAI,CAAC,KAAK,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC;SACtG,CAAC,CAAC;QAEH,mEAAmE;QACnE,uEAAuE;QACvE,oDAAoD;QACpD,MAAM,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;QACpD,KAAK,MAAM,EAAE,IAAI,CAAC,GAAG,WAAW,EAAE,GAAG,WAAW,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAEhF,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAE9D,OAAO,kBAAkB,CAAC,IAAI,EAAE,2BAA2B,EAAE,CAAC,CAAC,EAAE,EAAE,CACjE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAC/E,CAAC;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aligndottech/connector-core",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Align connector core: the ConnectorFetcher contract, read-only fetchers, gateway client, and tier definitions. Lightweight (no server deps) - safe for the Align CLI.",