{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "github", "type": "registry:item", "title": "GitHub", "description": "Editable GitHub ingestion with independent issue, pull-request, discussion, review, commit, and stargazer streams and raw ClickHouse tables.", "dependencies": [ "@chkit/core@^0.2.0-beta.10", "@chkit/plugin-ingest@^0.2.0-beta.10" ], "devDependencies": [ "@types/bun@^1.2.0" ], "files": [ { "path": "github/README.md", "type": "registry:file", "target": "src/integrations/github/README.md", "content": "# GitHub raw ingestion\n\nThis editable integration syncs eight GitHub resource collections into separate raw ClickHouse tables. One installation pipeline groups the streams; each resource owns its selection and journal progress.\n\n## First run\n\nSet `GITHUB_TOKEN` in the runtime environment and configure a direct ClickHouse connection. For private repositories, the supported setup grants repository access with **Issues: read**, **Pull requests: read**, and **Contents: read** permissions, including GraphQL commit reads. These permissions describe the supported setup; field-level minimum permissions depend on the selected endpoints and GraphQL fields. Requests read credentials at execution time; schema imports do not call GitHub. Native JSON requires ClickHouse 25.3 or later.\n\nEdit `githubConfig.repositories`, `sourceId`, timestamp settings, and `pageSize` in `config.ts`. Raw table names and database are declared in their `sources/` modules; edit those definitions before the first migration. `createGitHubPipeline(config, deps)` snapshots reader settings and binds an injectable fetch/token reader. Destination schemas remain setup-time module exports.\n\n```sh\nbunx chkit check\nbunx chkit generate --name add_github\n# Review the migration before applying it.\nbunx chkit migrate --apply\nbunx chkit ingest run --tag provider:github\n```\n\n## Pipeline and resources\n\nEach configured repository contributes eight independently selectable streams to `githubPipeline`:\n\n| Resource tag | Raw destination | Selection |\n| --- | --- | --- |\n| `resource:issues` | `github_issues_raw` | Updated-time window; excludes pull requests |\n| `resource:issue_comments` | `github_issue_comments_raw` | Comment updated-time window, with its own issue discovery |\n| `resource:pull_requests` | `github_pull_requests_raw` | Full pull-request collection |\n| `resource:pull_request_comments` | `github_pull_request_comments_raw` | Conversation-comment updated-time window, with its own PR discovery |\n| `resource:pull_request_review_comments` | `github_pull_request_review_comments_raw` | Repository-wide diff-comment updated-time window |\n| `resource:pull_request_reviews` | `github_pull_request_reviews_raw` | Full reviews collection, with its own PR discovery |\n| `resource:pull_request_commits` | `github_pull_request_commits_raw` | Full PR commit connections, with its own PR discovery |\n| `resource:stargazers` | `github_stargazers_raw` | Full stargazer collection |\n\nThe default repository is `obsessiondb/chkit`, so its stream IDs use `github..obsessiondb.chkit`. Existing issues and stargazers stream IDs remain unchanged. Another repository gets independent stream identities and checkpoints. Keep `sourceId` stable for one installation; changing it creates new stream identities.\n\nSelect a resource without running any other stream:\n\n```sh\nbunx chkit ingest run --tag provider:github --tag repository:obsessiondb/chkit --tag resource:pull_request_commits\nbunx chkit ingest run --tag provider:github --tag repository:obsessiondb/chkit --tag resource:pull_request_comments\n```\n\nRepeated tags use AND matching. The default `maxStreams: 1` executes selected streams sequentially; filtered runs give resources separate schedules and execution budgets. Stream order does not establish dependencies. A child reader discovers its own accessible parents through GitHub, even when the issues or pull-requests stream has never run. Individual issues and PRs are records inside their resource stream.\n\n## Stored data and joins\n\nEvery raw payload has the envelope `{ repository, data }`. Issue comments add `issue_number`; PR conversation comments, review comments, reviews, and commits add `pull_number`. Provider response fields remain under `data`. Issues and PRs contain their own metadata, while comments and reviews occupy individual rows in their respective tables.\n\nPR commits retain exactly `data.sha` and `data.message`, plus the repository and PR join keys. The reader requests the paginated [GraphQL PR commit connection](https://docs.github.com/en/graphql/reference/pulls#pullrequest) and maps the provider commit object ID to `sha`. Repeated SHAs, changes in `totalCount`, or a mismatched distinct terminal count fail the commit stream rather than completing a truncated collection. It does not request changed files or patches.\n\nJoin resources later in ClickHouse using `repository` plus `data.number` on issues/PRs and `issue_number` or `pull_number` on child rows. Review comments also retain their provider review ID for joining to reviews. A commit's SHA is scoped to its repository/PR membership, so a commit appearing in several PRs remains joinable to each one.\n\nRaw IDs retain provider identities and parent context. Existing issue and stargazer ID formats stay `[repository, issue.number]` and `[repository, user.id]`. The tables retain the latest observed payload per identity, with ingestion metadata added by chkit.\n\n## Sync and recovery\n\nIssues use `since`, update-time ordering, and a fixed local upper cutoff. Issue comments and PR conversation comments use their own `since` filters; their parent discovery reads the entire accessible issue or PR collection without restricting parent modification times. A recent comment on an old issue or PR stays eligible. Repository-wide review comments use their own update-time filter and recover the PR number from `pull_request_url`. See [issue comments](https://docs.github.com/en/rest/issues/comments#list-issue-comments) and [review comments](https://docs.github.com/en/rest/pulls/comments#list-review-comments-in-a-repository).\n\nThe initial timestamp window starts at `2008-01-01`; later windows replay five minutes before the committed watermark. GitHub has no server-side upper timestamp filter for these REST reads, so each timestamp reader discards observations newer than the fixed execution cutoff. A stream advances its watermark only after its complete window and destination writes succeed, including empty windows. Failed or interrupted windows replay from their lower bound.\n\nPull-request metadata, reviews, PR commits, and stargazers use the library's `fullSync()` strategy. Every run reads that selected resource again; the journal records successful completion, including empty reads. Interrupted reads start the selected collection from its beginning. There are no saved mutable page offsets or per-parent scan ledgers. REST `Link` URLs and GraphQL cursors are request continuations within the read; `paginate()` owns retryable requests and rejects cycles.\n\nDeleted records, removed stars, and commits no longer present after force-pushes remain stored. Pagination over live results is not a source snapshot; periodic historical replay refreshes older timestamp-selected observations and changes beyond overlap:\n\n```sh\nbunx chkit ingest run --tag provider:github --tag resource:issue_comments --backfill reconcile-2026-10-05 --from 2008-01-01\nbunx chkit ingest status --tag provider:github --json\n```\n\nUse a new backfill ID for each reconciliation. Historical replay reads current observations rather than reconstructing old versions. Full-sync resources ignore date bounds. A failed stream can have published some rows without completing its journal progress; it does not move another stream's checkpoint. Run one ingestion process per ClickHouse target at a time.\n\n## Upgrading existing data\n\nVersion `0.2.0` adds six raw destinations and separates issues from pull requests. The raw envelope changes to `{ repository, data }` while existing issue/stargazer row IDs stay stable. Previously stored flat payloads may coexist with new envelopes until their IDs are observed again or migrated explicitly.\n\nCombined-reader installations may also have PR rows in `github_issues_raw` and child arrays embedded in parent JSON. Those observations remain stored; running the new streams does not remove or move them. Keep the previous dataset as an archive, or deliberately migrate issue/PR classifications and child payloads into their separate destinations. In particular, old PR rows remain in the issues table until an explicit data migration or reconciliation removes them. Application queries need to account for both retained legacy shapes and the new envelope during that transition.\n\n## Fixture tests\n\n```sh\nbunx chkit add github --with-tests\nbun test src/integrations/github/tests/basic.test.ts\n```\n\nPortable fixtures verify resource selection and failure isolation, raw payloads and join keys, commit field selection, old-parent child updates, pagination continuations, source/sink failure recovery, configuration snapshots, and empty completion without live credentials.\n" }, { "path": "github/index.ts", "type": "registry:file", "target": "src/integrations/github/index.ts", "content": "export { githubPipeline, createGitHubPipeline } from './pipeline.js'\nexport { github_issuesRaw } from './sources/issues.js'\nexport { github_issueCommentsRaw } from './sources/issue-comments.js'\nexport { github_pullRequestsRaw } from './sources/pull-requests.js'\nexport { github_pullRequestCommentsRaw } from './sources/pull-request-comments.js'\nexport { github_pullRequestReviewCommentsRaw } from './sources/pull-request-review-comments.js'\nexport { github_pullRequestReviewsRaw } from './sources/pull-request-reviews.js'\nexport { github_pullRequestCommitsRaw } from './sources/pull-request-commits.js'\nexport { github_stargazersRaw } from './sources/stargazers.js'\n" }, { "path": "github/config.ts", "type": "registry:file", "target": "src/integrations/github/config.ts", "content": "export interface GitHubConfig {\n /** Stable, non-secret stream prefix for this installation. */\n sourceId: string\n /** Each repository creates eight independent resource streams with separate raw tables. */\n repositories: readonly string[]\n start: Date\n overlapMs: number\n pageSize: number\n}\n\n// Set source selection here; raw destinations are declared in sources/.\nexport const githubConfig: GitHubConfig = {\n sourceId: 'github',\n repositories: ['obsessiondb/chkit'],\n start: new Date('2008-01-01T00:00:00Z'),\n overlapMs: 5 * 60 * 1000,\n pageSize: 100,\n}\n" }, { "path": "github/client.ts", "type": "registry:file", "target": "src/integrations/github/client.ts", "content": "import { HttpError, IngestConfigError, paginate, rawRows, type ErrorClassifier, type FetchContext, type RawRow, type TimestampRange } from '@chkit/plugin-ingest'\n\nimport type { GitHubConfig } from './config.js'\n\nexport type GitHubObject = Record\n\nexport interface GitHubClientDeps {\n fetch: (url: string, init: RequestInit) => Promise\n token: () => string | undefined\n}\n\nexport const defaultGitHubClientDeps: GitHubClientDeps = {\n fetch: (url, init) => fetch(url, init),\n token: () => process.env.GITHUB_TOKEN,\n}\n\n/** Each page has one executor-owned request attempt; cursors remain local to this read. */\nexport function readGitHubPages(\n context: FetchContext,\n input: { path: string; accept?: string; params?: Record },\n config: GitHubConfig,\n deps: GitHubClientDeps,\n) {\n const first = new URL(`https://api.github.com${input.path}`)\n for (const [key, value] of Object.entries({ ...input.params, per_page: String(config.pageSize) })) first.searchParams.set(key, value)\n return paginate({\n context, initial: first.toString(), label: `GET ${input.path}`,\n fetchPage: async (cursor = first.toString(), signal) => {\n const response = await requestGitHub(cursor, input.accept, signal, deps)\n const payload: unknown = await response.json()\n if (!Array.isArray(payload)) throw new IngestConfigError(`GitHub ${input.path} response is not an array.`)\n const items = payload.map((item: unknown) => requireGitHubObject(item, input.path))\n const next = nextLink(response.headers.get('link'), cursor)\n return { items, next }\n },\n })\n}\n\n/** An omitted window means complete parent discovery, independent of another stream's progress. */\nexport async function* readIssuePages(context: FetchContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps, window?: TimestampRange) {\n for await (const page of readGitHubPages(context, { path: `/repos/${repo}/issues`, params: {\n state: 'all', sort: 'updated', direction: 'asc', ...(window ? { since: window.from.toISOString() } : {}),\n } }, config, deps)) {\n const issues = page.items.filter((item) => {\n githubNumber(item, 'number')\n if (item.pull_request !== undefined) return false\n return window === undefined || updatedItems([item], window).length > 0\n })\n yield { ...page, items: issues }\n }\n}\n\n/** GitHub has no since filter for PR metadata: list the current collection in full. */\nexport async function* readPullPages(context: FetchContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n for await (const page of readGitHubPages(context, { path: `/repos/${repo}/pulls`, params: { state: 'all', sort: 'updated', direction: 'asc' } }, config, deps)) {\n for (const pull of page.items) githubNumber(pull, 'number')\n yield page\n }\n}\n\n/** Provider data stays intact; repository and parent keys live outside it for warehouse joins. */\nexport function toGitHubRows(\n items: readonly T[], repo: string, identify: (item: T) => string | number,\n parent?: { issue_number: number } | { pull_number: number },\n): RawRow[] {\n const number = parent && ('pull_number' in parent ? parent.pull_number : parent.issue_number)\n return rawRows(items.map((data) => ({ repository: repo, ...parent, data })), ({ data }) =>\n JSON.stringify([repo, ...(number === undefined ? [] : [number]), identify(data)]))\n}\n\nexport function updatedItems(items: readonly GitHubObject[], window: TimestampRange): GitHubObject[] {\n return items.filter((item) => {\n if (typeof item.updated_at !== 'string' || !Number.isFinite(Date.parse(item.updated_at))) throw new IngestConfigError('GitHub object has no valid updated_at.')\n const updated = Date.parse(item.updated_at)\n return updated >= window.from.getTime() && updated <= window.to.getTime()\n })\n}\n\nexport function githubNumber(item: GitHubObject, field: string): number {\n const value = item[field]\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value <= 0) throw new IngestConfigError(`GitHub object has no valid ${field}.`)\n return value\n}\n\nexport function pullNumber(item: GitHubObject, repo: string): number {\n if (typeof item.pull_request_url !== 'string') throw new IngestConfigError('GitHub review comment has no pull_request_url.')\n if (!URL.canParse(item.pull_request_url)) throw new IngestConfigError('GitHub review comment has an invalid pull_request_url.')\n const url = new URL(item.pull_request_url)\n const prefix = `/repos/${repo}/pulls/`\n const value = url.pathname.slice(prefix.length)\n if (url.origin !== 'https://api.github.com' || !url.pathname.toLowerCase().startsWith(prefix.toLowerCase()) || !/^[1-9]\\d*$/.test(value)) {\n throw new IngestConfigError('GitHub review comment belongs to an unexpected repository or pull request.')\n }\n return githubNumber({ number: Number(value) }, 'number')\n}\n\nexport function requireGitHubObject(value: unknown, label: string): GitHubObject {\n if (!isGitHubObject(value)) throw new IngestConfigError(`GitHub ${label} is not an object.`)\n return value\n}\n\n/** paginate wraps each GraphQL page; never nest another executor attempt here. */\nexport async function requestGitHubGraphql(query: string, variables: Record, signal: AbortSignal, deps: GitHubClientDeps): Promise {\n const response = await deps.fetch('https://api.github.com/graphql', {\n method: 'POST', headers: { ...authorization(deps), 'Content-Type': 'application/json' },\n body: JSON.stringify({ query, variables }),\n signal: AbortSignal.any([signal, AbortSignal.timeout(30_000)]), redirect: 'error',\n })\n if (!response.ok) throw await HttpError.fromResponse(response)\n const body = requireGitHubObject(await response.clone().json(), 'GraphQL response')\n if (Array.isArray(body.errors) && body.errors.length > 0) {\n const rateLimited = response.headers.get('x-ratelimit-remaining') === '0' || response.headers.has('retry-after') ||\n body.errors.some((error: unknown) => isGitHubObject(error) &&\n (error.type === 'RATE_LIMITED' || (typeof error.message === 'string' && /secondary rate limit/i.test(error.message))))\n if (rateLimited) throw await HttpError.fromResponse(response)\n throw new IngestConfigError(`GitHub GraphQL returned errors: ${JSON.stringify(body.errors)}`)\n }\n if (body.errors !== undefined && !Array.isArray(body.errors)) throw new IngestConfigError('GitHub GraphQL errors is not an array.')\n return requireGitHubObject(body.data, 'GraphQL data')\n}\n\n/** REST 403 and GraphQL 200 can both signal rate exhaustion. */\nexport function classifyGitHubError(cause: unknown): ReturnType {\n if (cause instanceof SyntaxError) return { kind: 'permanent' }\n if (!(cause instanceof HttpError) || ![200, 403, 429].includes(cause.status)) return undefined\n const headers = cause.response.headers\n const reportedRateLimit = /secondary rate limit/i.test(cause.body) ||\n (cause.status === 200 && /\"type\"\\s*:\\s*\"RATE_LIMITED\"/.test(cause.body))\n if (headers.get('x-ratelimit-remaining') !== '0' && !headers.has('retry-after') && !reportedRateLimit) return undefined\n const resetSeconds = Number(headers.get('x-ratelimit-reset'))\n const untilReset = Number.isFinite(resetSeconds) && resetSeconds > 0 ? Math.max(0, resetSeconds * 1000 - Date.now()) : undefined\n return { kind: 'rate_limited', retryAfterMs: cause.retryAfterMs ?? untilReset ?? 60_000 }\n}\n\nasync function requestGitHub(url: string, accept = 'application/vnd.github+json', signal: AbortSignal, deps: GitHubClientDeps): Promise {\n const response = await deps.fetch(url, { signal: AbortSignal.any([signal, AbortSignal.timeout(30_000)]), redirect: 'error',\n headers: { ...authorization(deps), Accept: accept, 'X-GitHub-Api-Version': '2022-11-28' } })\n if (!response.ok) throw await HttpError.fromResponse(response)\n return response\n}\n\nfunction authorization(deps: GitHubClientDeps): { Authorization: string } {\n const token = deps.token()?.trim()\n if (!token) throw new IngestConfigError('Set GITHUB_TOKEN.')\n return { Authorization: `Bearer ${token}` }\n}\n\nfunction isGitHubObject(value: unknown): value is GitHubObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction nextLink(header: string | null, current: string): string | undefined {\n const value = header?.split(',').map((part) => /<([^>]+)>\\s*;.*rel=\"?next\"?/.exec(part)?.[1]).find(Boolean)\n if (!value) return undefined\n const next = new URL(value, current)\n if (next.origin !== 'https://api.github.com') throw new IngestConfigError('GitHub next page has an unexpected origin.')\n return next.toString()\n}\n" }, { "path": "github/pipeline.ts", "type": "registry:file", "target": "src/integrations/github/pipeline.ts", "content": "import { definePipeline, defineStream, IngestConfigError, timestampWindow } from '@chkit/plugin-ingest'\n\nimport { classifyGitHubError, defaultGitHubClientDeps, type GitHubClientDeps } from './client.js'\nimport { githubConfig, type GitHubConfig } from './config.js'\nimport { github_issuesRaw, readIssues } from './sources/issues.js'\nimport { github_issueCommentsRaw, readIssueComments } from './sources/issue-comments.js'\nimport { github_pullRequestsRaw, readPullRequests } from './sources/pull-requests.js'\nimport { github_pullRequestCommentsRaw, readPullRequestComments } from './sources/pull-request-comments.js'\nimport { github_pullRequestReviewCommentsRaw, readPullRequestReviewComments } from './sources/pull-request-review-comments.js'\nimport { github_pullRequestReviewsRaw, readPullRequestReviews } from './sources/pull-request-reviews.js'\nimport { github_pullRequestCommitsRaw, readPullRequestCommits } from './sources/pull-request-commits.js'\nimport { github_stargazersRaw, readStargazers } from './sources/stargazers.js'\n\nexport function createGitHubPipeline(config: GitHubConfig = githubConfig, deps: GitHubClientDeps = defaultGitHubClientDeps) {\n const source = { ...config, repositories: [...config.repositories], start: new Date(config.start) }\n if (!Number.isSafeInteger(config.pageSize) || config.pageSize < 1 || config.pageSize > 100) {\n throw new IngestConfigError('GitHub pageSize must be an integer between 1 and 100.')\n }\n if (config.repositories.some((repo) => !/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$/.test(repo))) {\n throw new IngestConfigError('GitHub repositories must use owner/repository names.')\n }\n return definePipeline({\n id: source.sourceId, tags: ['provider:github'], maxStreams: 1, maxFetches: 1,\n streams: source.repositories.flatMap((repo) => {\n const suffix = repo.replace('/', '.')\n const options = { classifyError: classifyGitHubError, tags: [`repository:${repo}`] }\n return [\n defineStream({\n ...options, id: `${source.sourceId}.issues.${suffix}`, tags: [...options.tags, 'resource:issues'], destination: github_issuesRaw,\n incremental: timestampWindow({ start: source.start, overlapMs: source.overlapMs }),\n read: (context) => readIssues(context, repo, source, deps),\n }),\n defineStream({\n ...options, id: `${source.sourceId}.issue_comments.${suffix}`, tags: [...options.tags, 'resource:issue_comments'], destination: github_issueCommentsRaw,\n incremental: timestampWindow({ start: source.start, overlapMs: source.overlapMs }),\n read: (context) => readIssueComments(context, repo, source, deps),\n }),\n defineStream({\n ...options, id: `${source.sourceId}.pull_requests.${suffix}`, tags: [...options.tags, 'resource:pull_requests'], destination: github_pullRequestsRaw,\n read: (context) => readPullRequests(context, repo, source, deps),\n }),\n defineStream({\n ...options, id: `${source.sourceId}.pull_request_comments.${suffix}`, tags: [...options.tags, 'resource:pull_request_comments'], destination: github_pullRequestCommentsRaw,\n incremental: timestampWindow({ start: source.start, overlapMs: source.overlapMs }),\n read: (context) => readPullRequestComments(context, repo, source, deps),\n }),\n defineStream({\n ...options, id: `${source.sourceId}.pull_request_review_comments.${suffix}`, tags: [...options.tags, 'resource:pull_request_review_comments'], destination: github_pullRequestReviewCommentsRaw,\n incremental: timestampWindow({ start: source.start, overlapMs: source.overlapMs }),\n read: (context) => readPullRequestReviewComments(context, repo, source, deps),\n }),\n defineStream({\n ...options, id: `${source.sourceId}.pull_request_reviews.${suffix}`, tags: [...options.tags, 'resource:pull_request_reviews'], destination: github_pullRequestReviewsRaw,\n read: (context) => readPullRequestReviews(context, repo, source, deps),\n }),\n defineStream({\n ...options, id: `${source.sourceId}.pull_request_commits.${suffix}`, tags: [...options.tags, 'resource:pull_request_commits'], destination: github_pullRequestCommitsRaw,\n read: (context) => readPullRequestCommits(context, repo, source, deps),\n }),\n defineStream({\n ...options, id: `${source.sourceId}.stargazers.${suffix}`, tags: [...options.tags, 'resource:stargazers'], destination: github_stargazersRaw,\n read: (context) => readStargazers(context, repo, source, deps),\n }),\n ]\n }),\n })\n}\n\nexport const githubPipeline = createGitHubPipeline()\n" }, { "path": "github/sources/issues.ts", "type": "registry:file", "target": "src/integrations/github/sources/issues.ts", "content": "import { rawTable, type ReadContext, type TimestampRange, type TimestampWindowState } from '@chkit/plugin-ingest'\n\nimport { githubNumber, readIssuePages, toGitHubRows, type GitHubClientDeps } from '../client.js'\nimport type { GitHubConfig } from '../config.js'\n\nexport const github_issuesRaw = rawTable({ database: 'default', name: 'github_issues_raw' })\n\nexport async function* readIssues(context: ReadContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n for await (const page of readIssuePages(context, repo, config, deps, context.selection)) {\n yield { rows: toGitHubRows(page.items, repo, (issue) => githubNumber(issue, 'number')) }\n }\n}\n" }, { "path": "github/sources/stargazers.ts", "type": "registry:file", "target": "src/integrations/github/sources/stargazers.ts", "content": "import { rawTable, type FetchContext } from '@chkit/plugin-ingest'\n\nimport { githubNumber, readGitHubPages, requireGitHubObject, toGitHubRows, type GitHubClientDeps } from '../client.js'\nimport type { GitHubConfig } from '../config.js'\n\nexport const github_stargazersRaw = rawTable({ database: 'default', name: 'github_stargazers_raw' })\n\nexport async function* readStargazers(context: FetchContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n for await (const page of readGitHubPages(context, { path: `/repos/${repo}/stargazers`, accept: 'application/vnd.github.star+json' }, config, deps)) {\n yield { rows: toGitHubRows(page.items, repo, (star) => githubNumber(requireGitHubObject(star.user, 'stargazer user'), 'id')) }\n }\n}\n" }, { "path": "github/sources/issue-comments.ts", "type": "registry:file", "target": "src/integrations/github/sources/issue-comments.ts", "content": "import { rawTable, type ReadContext, type TimestampRange, type TimestampWindowState } from '@chkit/plugin-ingest'\n\nimport { githubNumber, readGitHubPages, readIssuePages, toGitHubRows, updatedItems, type GitHubClientDeps } from '../client.js'\nimport type { GitHubConfig } from '../config.js'\n\nexport const github_issueCommentsRaw = rawTable({ database: 'default', name: 'github_issue_comments_raw' })\n\nexport async function* readIssueComments(context: ReadContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n // Discover all issue parents: a recent comment need not imply a recent parent update.\n for await (const issues of readIssuePages(context, repo, config, deps)) {\n for (const issue of issues.items) {\n const number = githubNumber(issue, 'number')\n for await (const page of readGitHubPages(context, { path: `/repos/${repo}/issues/${number}/comments`, params: { since: context.selection.from.toISOString() } }, config, deps)) {\n yield { rows: toGitHubRows(updatedItems(page.items, context.selection), repo, (comment) => githubNumber(comment, 'id'), { issue_number: number }) }\n }\n }\n }\n}\n" }, { "path": "github/sources/pull-requests.ts", "type": "registry:file", "target": "src/integrations/github/sources/pull-requests.ts", "content": "import { rawTable, type FetchContext } from '@chkit/plugin-ingest'\n\nimport { githubNumber, readPullPages, toGitHubRows, type GitHubClientDeps } from '../client.js'\nimport type { GitHubConfig } from '../config.js'\n\nexport const github_pullRequestsRaw = rawTable({ database: 'default', name: 'github_pull_requests_raw' })\n\nexport async function* readPullRequests(context: FetchContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n for await (const page of readPullPages(context, repo, config, deps)) {\n yield { rows: toGitHubRows(page.items, repo, (pull) => githubNumber(pull, 'number')) }\n }\n}\n" }, { "path": "github/sources/pull-request-comments.ts", "type": "registry:file", "target": "src/integrations/github/sources/pull-request-comments.ts", "content": "import { rawTable, type ReadContext, type TimestampRange, type TimestampWindowState } from '@chkit/plugin-ingest'\n\nimport { githubNumber, readGitHubPages, readPullPages, toGitHubRows, updatedItems, type GitHubClientDeps } from '../client.js'\nimport type { GitHubConfig } from '../config.js'\n\nexport const github_pullRequestCommentsRaw = rawTable({ database: 'default', name: 'github_pull_request_comments_raw' })\n\nexport async function* readPullRequestComments(context: ReadContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n // This reader owns its discovery and window; the PR metadata stream need not have run.\n for await (const pulls of readPullPages(context, repo, config, deps)) {\n for (const pull of pulls.items) {\n const number = githubNumber(pull, 'number')\n for await (const page of readGitHubPages(context, { path: `/repos/${repo}/issues/${number}/comments`, params: { since: context.selection.from.toISOString() } }, config, deps)) {\n yield { rows: toGitHubRows(updatedItems(page.items, context.selection), repo, (comment) => githubNumber(comment, 'id'), { pull_number: number }) }\n }\n }\n }\n}\n" }, { "path": "github/sources/pull-request-review-comments.ts", "type": "registry:file", "target": "src/integrations/github/sources/pull-request-review-comments.ts", "content": "import { rawTable, type ReadContext, type TimestampRange, type TimestampWindowState } from '@chkit/plugin-ingest'\n\nimport { githubNumber, pullNumber, readGitHubPages, toGitHubRows, updatedItems, type GitHubClientDeps } from '../client.js'\nimport type { GitHubConfig } from '../config.js'\n\nexport const github_pullRequestReviewCommentsRaw = rawTable({ database: 'default', name: 'github_pull_request_review_comments_raw' })\n\nexport async function* readPullRequestReviewComments(context: ReadContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n for await (const page of readGitHubPages(context, { path: `/repos/${repo}/pulls/comments`, params: {\n since: context.selection.from.toISOString(), sort: 'updated', direction: 'asc',\n } }, config, deps)) {\n for (const comment of updatedItems(page.items, context.selection)) {\n yield { rows: toGitHubRows([comment], repo, (item) => githubNumber(item, 'id'), { pull_number: pullNumber(comment, repo) }) }\n }\n }\n}\n" }, { "path": "github/sources/pull-request-reviews.ts", "type": "registry:file", "target": "src/integrations/github/sources/pull-request-reviews.ts", "content": "import { rawTable, type FetchContext } from '@chkit/plugin-ingest'\n\nimport { githubNumber, readGitHubPages, readPullPages, toGitHubRows, type GitHubClientDeps } from '../client.js'\nimport type { GitHubConfig } from '../config.js'\n\nexport const github_pullRequestReviewsRaw = rawTable({ database: 'default', name: 'github_pull_request_reviews_raw' })\n\nexport async function* readPullRequestReviews(context: FetchContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n for await (const pulls of readPullPages(context, repo, config, deps)) {\n for (const pull of pulls.items) {\n const number = githubNumber(pull, 'number')\n for await (const page of readGitHubPages(context, { path: `/repos/${repo}/pulls/${number}/reviews` }, config, deps)) {\n yield { rows: toGitHubRows(page.items, repo, (review) => githubNumber(review, 'id'), { pull_number: number }) }\n }\n }\n }\n}\n" }, { "path": "github/sources/pull-request-commits.ts", "type": "registry:file", "target": "src/integrations/github/sources/pull-request-commits.ts", "content": "import { IngestConfigError, paginate, rawTable, type FetchContext } from '@chkit/plugin-ingest'\n\nimport { githubNumber, readPullPages, requestGitHubGraphql, requireGitHubObject, toGitHubRows, type GitHubClientDeps } from '../client.js'\nimport type { GitHubConfig } from '../config.js'\n\nexport const github_pullRequestCommitsRaw = rawTable({ database: 'default', name: 'github_pull_request_commits_raw' })\n\n// The REST PR commits endpoint caps results at 250. Request only the two desired fields through GraphQL.\nconst commitsQuery = `query PullRequestCommits($owner: String!, $repo: String!, $number: Int!, $first: Int!, $after: String) {\n repository(owner: $owner, name: $repo) {\n pullRequest(number: $number) {\n commits(first: $first, after: $after) {\n totalCount\n nodes { commit { oid message } }\n pageInfo { hasNextPage endCursor }\n }\n }\n }\n}`\n\nexport async function* readPullRequestCommits(context: FetchContext, repo: string, config: GitHubConfig, deps: GitHubClientDeps) {\n const [owner, name] = repo.split('/')\n for await (const pulls of readPullPages(context, repo, config, deps)) {\n for (const pull of pulls.items) {\n const number = githubNumber(pull, 'number')\n let expectedCount: number | undefined\n const seenShas = new Set()\n const pages = paginate<{ sha: string; message: string }, string>({\n context, label: `POST /graphql PR ${repo}#${number} commits`,\n fetchPage: async (after, signal) => {\n const data = await requestGitHubGraphql(commitsQuery, { owner, repo: name, number, first: config.pageSize, after: after ?? null }, signal, deps)\n const repository = requireGitHubObject(data.repository, 'GraphQL repository')\n const parent = requireGitHubObject(repository.pullRequest, 'GraphQL pull request')\n const connection = requireGitHubObject(parent.commits, 'GraphQL commits connection')\n const total = connection.totalCount\n if (typeof total !== 'number' || !Number.isSafeInteger(total) || total < 0) throw new IngestConfigError('GitHub commits have no valid totalCount.')\n if (expectedCount !== undefined && total !== expectedCount) throw new IngestConfigError('GitHub PR commit count changed during pagination; replay this stream.')\n if (!Array.isArray(connection.nodes)) throw new IngestConfigError('GitHub commits nodes is not an array.')\n const items = connection.nodes.map((node: unknown) => {\n const commit = requireGitHubObject(requireGitHubObject(node, 'GraphQL commit node').commit, 'GraphQL commit')\n if (typeof commit.oid !== 'string' || !commit.oid.trim() || typeof commit.message !== 'string') throw new IngestConfigError('GitHub commit has no SHA or message.')\n return { sha: commit.oid, message: commit.message }\n })\n const pageInfo = requireGitHubObject(connection.pageInfo, 'GraphQL commit pageInfo')\n if (typeof pageInfo.hasNextPage !== 'boolean') throw new IngestConfigError('GitHub commits have no hasNextPage flag.')\n if (pageInfo.hasNextPage && (typeof pageInfo.endCursor !== 'string' || !pageInfo.endCursor.trim())) throw new IngestConfigError('GitHub commits have no continuation cursor.')\n const next = pageInfo.hasNextPage && typeof pageInfo.endCursor === 'string' ? pageInfo.endCursor : undefined\n const pageShas = new Set()\n for (const commit of items) {\n if (seenShas.has(commit.sha) || pageShas.has(commit.sha)) throw new IngestConfigError('GitHub PR commits repeated a SHA; replay this stream.')\n pageShas.add(commit.sha)\n }\n const count = seenShas.size + pageShas.size\n if (count > total || (next === undefined && count !== total)) throw new IngestConfigError('GitHub PR commits ended without the advertised complete collection.')\n expectedCount = total\n for (const sha of pageShas) seenShas.add(sha)\n return { items, next }\n },\n })\n for await (const page of pages) {\n yield { rows: toGitHubRows(page.items, repo, (commit) => commit.sha, { pull_number: number }) }\n }\n }\n }\n}\n" }, { "path": "github/tests/basic.test.ts", "type": "registry:file", "target": "src/integrations/github/tests/basic.test.ts", "role": "test", "content": "import { expect, test } from 'bun:test'\nimport { HttpError, IngestConfigError, runIngestion, selectStreams, type FetchContext, type Page } from '@chkit/plugin-ingest'\nimport { createMemoryDestination, createMemoryJournal } from '@chkit/plugin-ingest/testing'\n\nimport { createGitHubPipeline, githubPipeline } from '../index.js'\nimport { githubConfig, type GitHubConfig } from '../config.js'\nimport { classifyGitHubError, readIssuePages, requestGitHubGraphql, type GitHubObject } from '../client.js'\n\nconst repository = 'obsessiondb/chkit'\nconst cutoff = new Date('2026-01-02T00:00:00Z')\nconst resources = ['issues', 'issue_comments', 'pull_requests', 'pull_request_comments', 'pull_request_review_comments', 'pull_request_reviews', 'pull_request_commits', 'stargazers']\nconst issue = { number: 1, id: 1001, title: 'Issue', updated_at: '2026-01-01T12:00:00Z', labels: [{ name: 'bug' }] }\nconst pull = { number: 2, id: 1002, title: 'Pull request', state: 'closed', updated_at: '2026-01-01T12:00:00Z', merged_at: '2026-01-01T00:00:00Z' }\nconst pullIssue = { ...pull, pull_request: { url: `https://api.github.com/repos/${repository}/pulls/2` } }\nconst issueComment = { id: 101, body: 'Issue discussion', updated_at: issue.updated_at, custom: ['retained'] }\nconst pullComment = { id: 201, body: 'Pull request discussion', updated_at: issue.updated_at }\nconst reviewComment = { id: 301, body: 'Review discussion', updated_at: issue.updated_at, pull_request_url: `https://api.github.com/repos/${repository}/pulls/2` }\nconst review = { id: 401, body: 'Review', state: 'APPROVED', submitted_at: '2020-01-01T00:00:00Z' }\nconst commit = { sha: '0123456789012345678901234567890123456789', message: 'Subject\\n\\nFull commit message\\nwith another line.' }\nconst stargazer = { starred_at: '2026-01-01T00:00:00Z', user: { id: 501, login: 'example' }, custom: true }\n\ntype Responder = (url: URL, init: RequestInit) => Response | Promise\ntype Pipeline = ReturnType\n\ntest('GitHub resource streams retain flat provider payloads and parent join identities', async () => {\n const requests: URL[] = []\n const pipeline = fixturePipeline((url, init) => { requests.push(url); return fixtureResponse(url, init) })\n expect(pipeline.streams.map((stream) => stream.id).sort()).toEqual(resources.map((resource) => `github.${resource}.obsessiondb.chkit`).sort())\n expect(githubPipeline.streams).toHaveLength(8)\n const destination = createMemoryDestination(), journal = createMemoryJournal()\n const result = await runIngestion(request(pipeline), { journal, destination, now: () => cutoff })\n expect(result.ok, JSON.stringify(result)).toBe(true)\n const expected: Record = {\n issues: { id: JSON.stringify([repository, 1]), raw: { repository, data: issue } },\n issue_comments: { id: JSON.stringify([repository, 1, 101]), raw: { repository, issue_number: 1, data: issueComment } },\n pull_requests: { id: JSON.stringify([repository, 2]), raw: { repository, data: pull } },\n pull_request_comments: { id: JSON.stringify([repository, 2, 201]), raw: { repository, pull_number: 2, data: pullComment } },\n pull_request_review_comments: { id: JSON.stringify([repository, 2, 301]), raw: { repository, pull_number: 2, data: reviewComment } },\n pull_request_reviews: { id: JSON.stringify([repository, 2, 401]), raw: { repository, pull_number: 2, data: review } },\n pull_request_commits: { id: JSON.stringify([repository, 2, commit.sha]), raw: { repository, pull_number: 2, data: commit } },\n stargazers: { id: JSON.stringify([repository, 501]), raw: { repository, data: stargazer } },\n }\n for (const [resource, expectedRow] of Object.entries(expected)) {\n expect(destination.tables.get(`default.github_${resource}_raw`)?.map(({ id, raw }) => ({ id, raw }))).toEqual([expectedRow])\n }\n expect(requests.some((url) => url.pathname.endsWith('/files') || /\\/pulls\\/\\d+\\/commits$/.test(url.pathname))).toBe(false)\n expect((await journal.readCheckpoint('github.issues.obsessiondb.chkit')).envelope?.state).toEqual({ watermark: cutoff.toISOString() })\n})\n\ntest('every resource runs alone and reversing stream order preserves the same observations', async () => {\n const pipeline = fixturePipeline()\n const combined = createMemoryDestination()\n const reversed = { ...pipeline, streams: [...pipeline.streams].reverse() }\n expect((await runIngestion(request(reversed), { journal: createMemoryJournal(), destination: combined, now: () => cutoff })).ok).toBe(true)\n for (const resource of resources) {\n const destination = createMemoryDestination()\n const selected = request(pipeline, resource)\n expect(selected.selected.map((entry) => entry.stream.id)).toEqual([`github.${resource}.obsessiondb.chkit`])\n const result = await runIngestion(selected, { journal: createMemoryJournal(), destination, now: () => cutoff })\n expect(result.ok, `${resource}: ${JSON.stringify(result)}`).toBe(true)\n expect(destination.tables.size).toBe(1)\n expect(destination.tables.get(`default.github_${resource}_raw`)?.map(({ id, raw }) => ({ id, raw })))\n .toEqual(combined.tables.get(`default.github_${resource}_raw`)?.map(({ id, raw }) => ({ id, raw })))\n }\n})\n\ntest('selecting parents requests no children and separates issue and pull request responses', async () => {\n for (const resource of ['issues', 'pull_requests']) {\n const requests: URL[] = []\n const pipeline = fixturePipeline((url, init) => { requests.push(url); return fixtureResponse(url, init) })\n const destination = createMemoryDestination()\n expect((await runIngestion(request(pipeline, resource), { journal: createMemoryJournal(), destination, now: () => cutoff })).ok).toBe(true)\n expect(requests.map((url) => url.pathname)).toEqual([`/repos/${repository}/${resource === 'issues' ? 'issues' : 'pulls'}`])\n expect(requests[0]?.searchParams.get('state')).toBe('all')\n expect(requests[0]?.searchParams.get('sort')).toBe('updated')\n expect(requests[0]?.searchParams.get('direction')).toBe('asc')\n expect(requests[0]?.searchParams.has('since')).toBe(resource === 'issues')\n expect(destination.tables.get(`default.github_${resource}_raw`)?.map((row) => row.raw)).toEqual([{ repository, data: resource === 'issues' ? issue : pull }])\n }\n})\n\ntest('short issue pages follow Link continuations while excluding PRs and updates beyond the cutoff', async () => {\n const requests: URL[] = []\n const nextIssue = { ...issue, number: 3, id: 1003 }\n const futureIssue = { ...issue, number: 4, updated_at: '2026-01-03T00:00:00Z' }\n const pipeline = fixturePipeline((url) => {\n requests.push(url)\n if (url.searchParams.has('page')) return Response.json([pullIssue, nextIssue, futureIssue])\n return Response.json([issue], { headers: { Link: `<${url}&page=2>; rel=\"next\"` } })\n })\n const destination = createMemoryDestination(), journal = createMemoryJournal()\n const result = await runIngestion(request(pipeline, 'issues'), { journal, destination, now: () => cutoff })\n expect(result.ok).toBe(true)\n expect(requests).toHaveLength(2)\n expect(requests.every((url) => url.searchParams.get('since') === '2008-01-01T00:00:00.000Z')).toBe(true)\n expect(destination.tables.get('default.github_issues_raw')?.map((row) => row.raw)).toEqual([{ repository, data: issue }, { repository, data: nextIssue }])\n expect((await journal.readCheckpoint('github.issues.obsessiondb.chkit')).envelope?.state).toEqual({ watermark: cutoff.toISOString() })\n})\n\ntest('issue page filtering preserves continuations and empty terminal pages', async () => {\n const signal = new AbortController().signal\n const context: FetchContext = { signal, attempt: (operation) => operation(signal) }\n const pages: Page[] = []\n const requests: URL[] = []\n for await (const page of readIssuePages(context, repository, githubConfig, {\n token: () => 'fixture', fetch: async (input) => {\n const url = new URL(input)\n requests.push(url)\n const number = Number(url.searchParams.get('page') ?? '1')\n const next = new URL(url)\n next.searchParams.set('page', String(number + 1))\n return Response.json(number === 1 ? [pullIssue] : number === 2 ? [issue] : [],\n { headers: number < 3 ? { Link: `<${next}>; rel=\"next\"` } : {} })\n },\n })) pages.push(page)\n expect(requests).toHaveLength(3)\n expect(pages.map((page) => page.items)).toEqual([[], [issue], []])\n expect(pages.map((page) => page.next)).toEqual([requests[1]?.toString(), requests[2]?.toString(), undefined])\n})\n\ntest('a failed child stream does not block its parents or the other resource checkpoints', async () => {\n const pipeline = fixturePipeline((url, init) => url.pathname.endsWith('/issues/1/comments')\n ? new Response('denied', { status: 403 }) : fixtureResponse(url, init))\n const destination = createMemoryDestination(), journal = createMemoryJournal()\n const result = await runIngestion(request(pipeline), { journal, destination, now: () => cutoff })\n expect(result.ok).toBe(false)\n expect(result.streams.filter((stream) => stream.outcome === 'failed').map((stream) => stream.streamId)).toEqual(['github.issue_comments.obsessiondb.chkit'])\n expect(result.streams.filter((stream) => stream.outcome === 'succeeded')).toHaveLength(7)\n expect(destination.tables.has('default.github_issues_raw')).toBe(true)\n expect(destination.tables.has('default.github_pull_requests_raw')).toBe(true)\n expect((await journal.readCheckpoint('github.issue_comments.obsessiondb.chkit')).envelope).toBeUndefined()\n for (const resource of ['issues', 'pull_request_comments', 'pull_request_review_comments']) {\n expect((await journal.readCheckpoint(`github.${resource}.obsessiondb.chkit`)).envelope?.state).toEqual({ watermark: cutoff.toISOString() })\n }\n expect((await journal.readCheckpoint('github.pull_requests.obsessiondb.chkit')).lastSuccessSeq).toBeGreaterThan(0)\n})\n\ntest('comment streams capture edits on old parents using their own overlapping since windows', async () => {\n const oldIssue = { ...issue, number: 3, updated_at: '2020-01-01T00:00:00Z' }\n const oldPull = { ...pull, number: 4, updated_at: '2020-01-01T00:00:00Z' }\n for (const resource of ['issue_comments', 'pull_request_comments', 'pull_request_review_comments']) {\n let edited = false\n const requests: URL[] = []\n const pipeline = fixturePipeline((url) => {\n requests.push(url)\n if (url.pathname.endsWith('/issues')) return Response.json([oldIssue, { ...oldPull, pull_request: pullIssue.pull_request }])\n if (url.pathname.endsWith('/pulls')) return Response.json([oldPull])\n const comment = resource === 'issue_comments' ? issueComment : resource === 'pull_request_comments' ? pullComment : reviewComment\n const data = { ...comment, body: edited ? 'Edited old discussion' : 'Original discussion', updated_at: edited ? '2026-01-02T12:00:00Z' : '2026-01-01T12:00:00Z',\n ...(resource === 'pull_request_review_comments' ? { pull_request_url: `https://api.github.com/repos/${repository}/pulls/4` } : {}) }\n return Response.json([data, { ...data, id: 999, updated_at: '2026-01-04T00:00:00Z' }])\n })\n const journal = createMemoryJournal(), destination = createMemoryDestination()\n expect((await runIngestion(request(pipeline, resource), { journal, destination, now: () => cutoff })).ok).toBe(true)\n edited = true\n expect((await runIngestion(request(pipeline, resource), { journal, destination, now: () => new Date('2026-01-03') })).ok).toBe(true)\n const children = requests.filter((url) => url.pathname.endsWith('/comments'))\n expect(children.map((url) => url.searchParams.get('since'))).toEqual(['2008-01-01T00:00:00.000Z', '2026-01-01T23:55:00.000Z'])\n expect(requests.filter((url) => url.pathname.endsWith('/issues') || url.pathname.endsWith('/pulls')).every((url) => !url.searchParams.has('since'))).toBe(true)\n const rows = destination.tables.get(`default.github_${resource}_raw`) ?? []\n expect(rows).toHaveLength(2)\n expect(new Set(rows.map((row) => row.id)).size).toBe(1)\n expect(rows.at(-1)?.raw).toMatchObject({ repository, data: { body: 'Edited old discussion' } })\n expect((await journal.readCheckpoint(`github.${resource}.obsessiondb.chkit`)).envelope?.state).toEqual({ watermark: '2026-01-03T00:00:00.000Z' })\n }\n})\n\ntest('a rejected child write cannot advance its timestamp watermark and the next run replays the window', async () => {\n const starts: string[] = []\n const pipeline = fixturePipeline((url, init) => {\n if (url.pathname.endsWith('/comments')) starts.push(url.searchParams.get('since') ?? '')\n return fixtureResponse(url, init)\n })\n const journal = createMemoryJournal(), destination = createMemoryDestination()\n const selected = request(pipeline, 'issue_comments')\n const failed = await runIngestion(selected, { journal, destination: { insert: async () => { throw new IngestConfigError('sink rejected') } }, now: () => cutoff })\n expect(failed.ok).toBe(false)\n expect((await journal.readCheckpoint('github.issue_comments.obsessiondb.chkit')).envelope).toBeUndefined()\n expect((await runIngestion(selected, { journal, destination, now: () => cutoff })).ok).toBe(true)\n expect(starts).toEqual(['2008-01-01T00:00:00.000Z', '2008-01-01T00:00:00.000Z'])\n expect(destination.tables.get('default.github_issue_comments_raw')).toHaveLength(1)\n})\n\ntest('empty resource runs complete independently and full readers scan again without provider state', async () => {\n const calls: string[] = []\n const pipeline = fixturePipeline((url) => { calls.push(url.pathname); return Response.json([]) })\n const journal = createMemoryJournal(), destination = createMemoryDestination()\n for (const now of [cutoff, new Date('2026-01-03')]) expect((await runIngestion(request(pipeline), { journal, destination, now: () => now })).ok).toBe(true)\n expect(destination.tables.size).toBe(0)\n for (const resource of ['pull_requests', 'pull_request_reviews', 'pull_request_commits', 'stargazers']) {\n const checkpoint = await journal.readCheckpoint(`github.${resource}.obsessiondb.chkit`)\n expect(checkpoint.envelope).toBeUndefined()\n expect(checkpoint.lastSuccessSeq).toBeGreaterThan(0)\n expect(journal.events.filter((event) => event.namespaceId === `github.${resource}.obsessiondb.chkit` && event.eventKind === 'work_finished' && event.workState === 'succeeded')).toHaveLength(2)\n }\n expect(calls.filter((path) => path.endsWith('/stargazers'))).toHaveLength(2)\n expect((await journal.readCheckpoint('github.issue_comments.obsessiondb.chkit')).envelope?.state).toEqual({ watermark: '2026-01-03T00:00:00.000Z' })\n})\n\ntest('stargazer full sync replays from its first page after page or destination failures before completing', async () => {\n let failSecondPage = true\n const starts: string[] = []\n const second = { ...stargazer, user: { id: 502, login: 'another-example' } }\n const pipeline = fixturePipeline((url) => {\n if (url.searchParams.get('page') === '2') return failSecondPage ? new Response('denied', { status: 403 }) : Response.json([second])\n starts.push(url.search)\n return Response.json([stargazer], { headers: { Link: `<${url}&page=2>; rel=\"next\"` } })\n })\n const journal = createMemoryJournal(), destination = createMemoryDestination()\n const selected = request(pipeline, 'stargazers')\n expect((await runIngestion(selected, { journal, destination, now: () => cutoff })).ok).toBe(false)\n expect((await journal.readCheckpoint('github.stargazers.obsessiondb.chkit')).lastSuccessSeq).toBe(0)\n expect((await journal.readCheckpoint('github.stargazers.obsessiondb.chkit')).envelope).toBeUndefined()\n failSecondPage = false\n const rejected = await runIngestion(selected, { journal, now: () => cutoff,\n destination: { insert: async () => { throw new IngestConfigError('sink rejected') } } })\n expect(rejected.ok).toBe(false)\n expect((await journal.readCheckpoint('github.stargazers.obsessiondb.chkit')).lastSuccessSeq).toBe(0)\n expect((await journal.readCheckpoint('github.stargazers.obsessiondb.chkit')).envelope).toBeUndefined()\n expect((await runIngestion(selected, { journal, destination, now: () => cutoff })).ok).toBe(true)\n const completed = await journal.readCheckpoint('github.stargazers.obsessiondb.chkit')\n expect(completed.lastSuccessSeq).toBeGreaterThan(0)\n expect(completed.envelope).toBeUndefined()\n expect(starts).toEqual(Array(3).fill('?per_page=100'))\n expect(destination.tables.get('default.github_stargazers_raw')?.map(({ id, raw }) => ({ id, raw }))).toEqual([\n { id: JSON.stringify([repository, 501]), raw: { repository, data: stargazer } },\n { id: JSON.stringify([repository, 502]), raw: { repository, data: second } },\n ])\n})\n\ntest('GraphQL commits collect more than 250 entries and retain only SHA and the full multiline message', async () => {\n const commits = Array.from({ length: 275 }, (_, index) => ({ sha: (index + 1).toString(16).padStart(40, '0'), message: `Subject ${index}\\n\\nFull body ${index}\\nLast line.` }))\n const afters: unknown[] = [], requests: URL[] = []\n const pipeline = fixturePipeline((url, init) => {\n requests.push(url)\n if (url.pathname !== '/graphql') return fixtureResponse(url, init)\n expect(init.method).toBe('POST')\n const body = JSON.parse(String(init.body))\n const after = body.variables.after ?? null\n afters.push(after)\n const offset = after === 'page-100' ? 100 : after === 'page-200' ? 200 : 0\n const items = commits.slice(offset, offset + 100)\n return commitPage(items, commits.length, offset + items.length < commits.length ? `page-${offset + items.length}` : null)\n })\n const journal = createMemoryJournal(), destination = createMemoryDestination()\n expect((await runIngestion(request(pipeline, 'pull_request_commits'), { journal, destination, now: () => cutoff })).ok).toBe(true)\n expect(afters).toEqual([null, 'page-100', 'page-200'])\n const rows = destination.tables.get('default.github_pull_request_commits_raw') ?? []\n expect(rows).toHaveLength(275)\n expect(rows.map((row) => row.raw)).toEqual(commits.map((data) => ({ repository, pull_number: 2, data })))\n expect(rows.at(-1)?.id).toBe(JSON.stringify([repository, 2, commits.at(-1)?.sha]))\n expect(requests.filter((url) => url.pathname !== '/graphql').map((url) => url.pathname)).toEqual([`/repos/${repository}/pulls`])\n expect((await journal.readCheckpoint('github.pull_request_commits.obsessiondb.chkit')).envelope).toBeUndefined()\n expect((await journal.readCheckpoint('github.pull_request_commits.obsessiondb.chkit')).lastSuccessSeq).toBeGreaterThan(0)\n})\n\ntest('GraphQL commit totals reject truncated collections and changes during pagination', async () => {\n for (const changed of [false, true]) {\n let calls = 0\n const pipeline = fixturePipeline((url, init) => {\n if (url.pathname !== '/graphql') return fixtureResponse(url, init)\n calls++\n return commitPage([{ ...commit, sha: String(calls).padStart(40, '0') }], changed && calls === 2 ? 3 : 2, changed && calls === 1 ? 'next' : null)\n })\n const journal = createMemoryJournal()\n const result = await runIngestion(request(pipeline, 'pull_request_commits'), { journal, destination: createMemoryDestination(), now: () => cutoff })\n expect(result.ok).toBe(false)\n expect(calls).toBe(changed ? 2 : 1)\n expect((await journal.readCheckpoint('github.pull_request_commits.obsessiondb.chkit')).lastSuccessSeq).toBe(0)\n }\n})\n\ntest('GraphQL commits validate complete counts on empty terminal pages', async () => {\n for (const total of [0, 1, 2]) {\n let calls = 0\n const pipeline = fixturePipeline((url, init) => {\n if (url.pathname !== '/graphql') return fixtureResponse(url, init)\n calls++\n return commitPage(total > 0 && calls === 1 ? [commit] : [], total, total > 0 && calls === 1 ? 'terminal' : null)\n })\n const journal = createMemoryJournal(), destination = createMemoryDestination()\n const result = await runIngestion(request(pipeline, 'pull_request_commits'), { journal, destination, now: () => cutoff })\n expect(result.ok).toBe(total < 2)\n expect(calls).toBe(total === 0 ? 1 : 2)\n expect((await journal.readCheckpoint('github.pull_request_commits.obsessiondb.chkit')).lastSuccessSeq > 0).toBe(total < 2)\n if (total < 2) expect(destination.tables.get('default.github_pull_request_commits_raw') ?? []).toHaveLength(total)\n }\n})\n\ntest('GraphQL commit pagination rejects duplicate SHAs within or across pages despite a matching total', async () => {\n for (const acrossPages of [true, false]) {\n let calls = 0\n const pipeline = fixturePipeline((url, init) => {\n if (url.pathname !== '/graphql') return fixtureResponse(url, init)\n calls++\n return acrossPages ? commitPage([commit], 2, calls === 1 ? 'next' : null) : commitPage([commit, commit], 2, null)\n })\n const journal = createMemoryJournal()\n const result = await runIngestion(request(pipeline, 'pull_request_commits'), { journal, destination: createMemoryDestination(), now: () => cutoff })\n expect(result.ok).toBe(false)\n expect(calls).toBe(acrossPages ? 2 : 1)\n expect((await journal.readCheckpoint('github.pull_request_commits.obsessiondb.chkit')).lastSuccessSeq).toBe(0)\n }\n})\n\ntest('GitHub binds configuration and preserves independently selected installation and repository progress', async () => {\n const requests: URL[] = []\n const config = { ...githubConfig, sourceId: 'github.fixture', repositories: ['first/repo', 'second/repo'], pageSize: 25, start: new Date('2025-01-01'), overlapMs: 60_000 }\n const pipeline = createGitHubPipeline(config, { token: () => 'bound-token', fetch: async (input, init) => {\n const url = new URL(input)\n requests.push(url)\n expect(new Headers(init.headers).get('authorization')).toBe('Bearer bound-token')\n expect(url.searchParams.get('per_page')).toBe('25')\n return Response.json([])\n } })\n config.pageSize = 100\n config.repositories.push('third/repo')\n config.start.setUTCFullYear(2000)\n config.overlapMs = 3_600_000\n expect(pipeline.streams.map((stream) => stream.id).sort()).toEqual(['first.repo', 'second.repo'].flatMap((repo) => resources.map((resource) => `github.fixture.${resource}.${repo}`)).sort())\n const journal = createMemoryJournal(), destination = createMemoryDestination()\n expect((await runIngestion(request(pipeline), { journal, destination, now: () => cutoff })).ok).toBe(true)\n expect(requests.filter((url) => url.searchParams.has('since')).every((url) => url.searchParams.get('since') === '2025-01-01T00:00:00.000Z')).toBe(true)\n requests.length = 0\n const selected = selectStreams([pipeline], ['repository:second/repo', 'resource:issues'])\n expect(selected.map((entry) => entry.stream.id)).toEqual(['github.fixture.issues.second.repo'])\n expect((await runIngestion({ selected, backfill: undefined }, { journal, destination, now: () => new Date('2026-01-03') })).ok).toBe(true)\n expect(requests.map((url) => url.pathname)).toEqual(['/repos/second/repo/issues'])\n expect(requests[0]?.searchParams.get('since')).toBe('2026-01-01T23:59:00.000Z')\n expect((await journal.readCheckpoint('github.issues.obsessiondb.chkit')).envelope).toBeUndefined()\n})\n\ntest('GitHub paginated HTTP rate limits consume exactly one request retry budget', async () => {\n let attempts = 0\n const pipeline = fixturePipeline(() => ++attempts === 1\n ? new Response('rate limited', { status: 403, headers: { 'x-ratelimit-remaining': '0', 'retry-after': '0' } }) : Response.json([]))\n const selected = request(pipeline, 'stargazers').selected.map((entry) => ({ ...entry, stream: { ...entry.stream, retry: { retries: 1, minTimeout: 0, maxTimeout: 0 } } }))\n const journal = createMemoryJournal()\n expect((await runIngestion({ selected, backfill: undefined }, { journal, destination: createMemoryDestination(), now: () => cutoff })).ok).toBe(true)\n expect(attempts).toBe(2)\n expect(journal.events.filter((event) => event.eventKind === 'retry_scheduled' && event.errorClass === 'rate_limited')).toHaveLength(1)\n})\n\ntest('GraphQL HTTP200 rate errors honor Retry-After while partial data fails permanently', async () => {\n for (const retryable of [true, false]) {\n let attempts = 0\n const pipeline = fixturePipeline((url, init) => {\n if (url.pathname !== '/graphql') return fixtureResponse(url, init)\n attempts++\n if (retryable && attempts > 1) return commitPage([commit], 1, null)\n return Response.json({ data: { repository: null }, errors: [{ type: retryable ? 'RATE_LIMITED' : 'NOT_FOUND', message: 'query rejected' }] },\n { headers: retryable ? { 'Retry-After': '0', 'x-ratelimit-remaining': '0' } : {} })\n })\n const selected = request(pipeline, 'pull_request_commits').selected.map((entry) => ({ ...entry, stream: { ...entry.stream, retry: { retries: 1, minTimeout: 0, maxTimeout: 0 } } }))\n const journal = createMemoryJournal()\n const result = await runIngestion({ selected, backfill: undefined }, { journal, destination: createMemoryDestination(), now: () => cutoff })\n expect(result.ok).toBe(retryable)\n expect(attempts).toBe(retryable ? 2 : 1)\n expect(journal.events.filter((event) => event.eventKind === 'retry_scheduled')).toHaveLength(retryable ? 1 : 0)\n }\n})\n\ntest('secondary REST rate limits and headerless GraphQL rate errors retain provider diagnostics', async () => {\n const rest = await HttpError.fromResponse(Response.json({ message: 'You have exceeded a secondary rate limit.' },\n { status: 403, headers: { 'x-ratelimit-remaining': '19' } }))\n expect(rest.status).toBe(403)\n expect(rest.body).toContain('secondary rate limit')\n expect(classifyGitHubError(rest)).toEqual({ kind: 'rate_limited', retryAfterMs: 60_000 })\n const payload = { data: { repository: null }, errors: [{ type: 'RATE_LIMITED', message: 'API rate limit exceeded' }] }\n const failure: unknown = await requestGitHubGraphql('query { viewer { login } }', {}, new AbortController().signal,\n { token: () => 'fixture', fetch: async () => Response.json(payload) }).catch((cause: unknown) => cause)\n expect(failure).toBeInstanceOf(HttpError)\n expect(failure).toMatchObject({ status: 200, body: JSON.stringify(payload) })\n expect(classifyGitHubError(failure)).toEqual({ kind: 'rate_limited', retryAfterMs: 60_000 })\n})\n\ntest('invalid REST continuations and payloads fail without completing or replaying the resource', async () => {\n for (const mode of ['repeated', 'foreign', 'malformed']) {\n let calls = 0\n const pipeline = fixturePipeline((url) => {\n calls++\n return mode === 'malformed' ? Response.json({ not: 'an array' })\n : Response.json([stargazer], { headers: { Link: `<${mode === 'foreign' ? 'https://example.com/steal' : url.toString()}>; rel=\"next\"` } })\n })\n const journal = createMemoryJournal(), destination = createMemoryDestination()\n const result = await runIngestion(request(pipeline, 'stargazers'), { journal, destination, now: () => cutoff })\n expect(result.ok).toBe(false)\n expect(calls).toBe(1)\n expect(destination.tables.size).toBe(0)\n expect((await journal.readCheckpoint('github.stargazers.obsessiondb.chkit')).lastSuccessSeq).toBe(0)\n }\n})\n\ntest('GraphQL malformed or cyclic cursors and invalid commit nodes never record successful completion', async () => {\n for (const mode of ['missing-cursor', 'repeated', 'missing-message']) {\n let calls = 0\n const pipeline = fixturePipeline((url, init) => {\n if (url.pathname !== '/graphql') return fixtureResponse(url, init)\n calls++\n const page = { totalCount: mode === 'repeated' ? 3 : 1,\n nodes: [{ commit: mode === 'missing-message' ? { oid: commit.sha }\n : { oid: mode === 'repeated' ? String(calls).padStart(40, '0') : commit.sha, message: commit.message } }],\n pageInfo: { hasNextPage: mode !== 'missing-message', endCursor: mode === 'missing-cursor' ? null : 'same' } }\n return Response.json({ data: { repository: { pullRequest: { commits: page } } } })\n })\n const journal = createMemoryJournal()\n const result = await runIngestion(request(pipeline, 'pull_request_commits'), { journal, destination: createMemoryDestination(), now: () => cutoff })\n expect(result.ok).toBe(false)\n expect(calls).toBe(mode === 'repeated' ? 2 : 1)\n if (mode === 'repeated') expect(result.streams[0]?.error).toContain('repeated continuation')\n expect((await journal.readCheckpoint('github.pull_request_commits.obsessiondb.chkit')).lastSuccessSeq).toBe(0)\n }\n})\n\ntest('review comments reject a parent URL from another repository before claiming a watermark', async () => {\n const pipeline = fixturePipeline(() => Response.json([{ ...reviewComment, pull_request_url: 'https://api.github.com/repos/another/project/pulls/2' }]))\n const journal = createMemoryJournal()\n const result = await runIngestion(request(pipeline, 'pull_request_review_comments'), { journal, destination: createMemoryDestination(), now: () => cutoff })\n expect(result.ok).toBe(false)\n expect((await journal.readCheckpoint('github.pull_request_review_comments.obsessiondb.chkit')).envelope).toBeUndefined()\n})\n\nfunction fixturePipeline(respond: Responder = fixtureResponse, config: GitHubConfig = githubConfig): Pipeline {\n return createGitHubPipeline(config, { token: () => 'fixture', fetch: (url, init) => Promise.resolve(respond(new URL(url), init)) })\n}\n\nfunction request(pipeline: Pipeline, resource?: string) {\n return { selected: selectStreams([pipeline], resource ? [`resource:${resource}`] : []).map((entry) => ({\n ...entry, stream: { ...entry.stream, batchSize: 1, retry: { retries: 0 } },\n })), backfill: undefined }\n}\n\nfunction fixtureResponse(url: URL, _init: RequestInit): Response {\n if (url.pathname === `/repos/${repository}/issues`) return Response.json([issue, pullIssue])\n if (url.pathname === `/repos/${repository}/pulls`) return Response.json([pull])\n if (url.pathname.endsWith('/issues/1/comments')) return Response.json([issueComment])\n if (url.pathname.endsWith('/issues/2/comments')) return Response.json([pullComment])\n if (url.pathname.endsWith('/pulls/comments')) return Response.json([reviewComment])\n if (url.pathname.endsWith('/pulls/2/reviews')) return Response.json([review])\n if (url.pathname.endsWith('/stargazers')) return Response.json([stargazer])\n if (url.pathname === '/graphql') return commitPage([commit], 1, null)\n throw new IngestConfigError(`Unexpected GitHub fixture request: ${url}`)\n}\n\nfunction commitPage(items: readonly { sha: string; message: string }[], totalCount: number, next: string | null): Response {\n return Response.json({ data: { repository: { pullRequest: { commits: { totalCount,\n nodes: items.map((item) => ({ commit: { oid: item.sha, message: item.message, author: { name: 'Do not retain expanded commit fields' } } })),\n pageInfo: { hasNextPage: next !== null, endCursor: next },\n } } } } })\n}\n" } ], "meta": { "chkit": { "formatVersion": 1, "version": "0.2.0", "changelog": [ { "version": "0.2.0", "changes": [ "Sync issues and editable comments through overlapping updated-time windows; advance each stream watermark only after its destination acknowledgement.", "Separate issues, issue comments, pull requests, PR conversation comments, review comments, reviews, commits, and stargazers into independently selectable raw streams for every configured repository.", "Store repository and parent join keys beside provider data; retain only commit SHA and message through paginated GraphQL commit connections, and leave joins to ClickHouse.", "Use one installation pipeline with configuration snapshots, injectable requests, shared pagination, and fullSync where no reliable change filter exists; existing mixed or combined observations require deliberate data migration.", "Consume full pagination pages and use shared continuation-cycle detection while preserving raw resource checkpoints and PR commit completeness checks." ] }, { "version": "0.1.0", "changes": [ "Introduce raw repository issues and stargazers ingestion." ] } ], "language": "typescript", "license": "MIT", "documentation": "https://chkit.obsessiondb.com/integrations/github/", "logo": "https://chkit.obsessiondb.com/logos/github.svg", "authentication": { "method": "Bearer token", "env": [ "GITHUB_TOKEN" ], "setup": [ "For private repositories, the supported setup grants GITHUB_TOKEN repository access with Issues:read, Pull requests:read, and Contents:read, including GraphQL commit reads; this is not a verified field-level permission minimum.", "Supply a new access token when the existing token expires." ], "documentation": "https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens" }, "chkit": "^0.2.0-beta.10", "ingest": "^0.2.0-beta.10", "clickhouse": ">=25.3.0", "root": "src/integrations/github", "entry": "index.ts", "exports": [ "githubPipeline", "createGitHubPipeline", "github_issuesRaw", "github_issueCommentsRaw", "github_pullRequestsRaw", "github_pullRequestCommentsRaw", "github_pullRequestReviewCommentsRaw", "github_pullRequestReviewsRaw", "github_pullRequestCommitsRaw", "github_stargazersRaw" ], "resources": [ { "name": "issues", "title": "Issues", "table": "github_issues_raw", "description": "Only ordinary issues, with complete provider issue fields and repository context", "scopes": [ "Issues:read" ], "strategy": "timestamp", "endpoints": [ { "method": "GET", "path": "/repos/{owner}/{repo}/issues", "documentation": "https://docs.github.com/en/rest/issues/issues#list-repository-issues" } ] }, { "name": "issue_comments", "title": "Issue comments", "table": "github_issue_comments_raw", "description": "One raw comment per row for ordinary issues; independently discovers all issue parents and filters child updates", "scopes": [ "Issues:read" ], "strategy": "timestamp", "endpoints": [ { "method": "GET", "path": "/repos/{owner}/{repo}/issues", "documentation": "https://docs.github.com/en/rest/issues/issues#list-repository-issues" }, { "method": "GET", "path": "/repos/{owner}/{repo}/issues/{issue_number}/comments", "documentation": "https://docs.github.com/en/rest/issues/comments#list-issue-comments" } ] }, { "name": "pull_requests", "title": "Pull requests", "table": "github_pull_requests_raw", "description": "Pull-request metadata from its own collection, with repository context", "scopes": [ "Pull requests:read" ], "strategy": "full", "endpoints": [ { "method": "GET", "path": "/repos/{owner}/{repo}/pulls", "documentation": "https://docs.github.com/en/rest/pulls/pulls#list-pull-requests" } ] }, { "name": "pull_request_comments", "title": "Pull request conversation comments", "table": "github_pull_request_comments_raw", "description": "One raw conversation comment per row with its pull number; independently discovers all pull-request parents and filters child updates", "scopes": [ "Pull requests:read" ], "strategy": "timestamp", "endpoints": [ { "method": "GET", "path": "/repos/{owner}/{repo}/pulls", "documentation": "https://docs.github.com/en/rest/pulls/pulls#list-pull-requests" }, { "method": "GET", "path": "/repos/{owner}/{repo}/issues/{pull_number}/comments", "documentation": "https://docs.github.com/en/rest/issues/comments#list-issue-comments" } ] }, { "name": "pull_request_review_comments", "title": "Pull request review comments", "table": "github_pull_request_review_comments_raw", "description": "Raw diff-review comments with repository and pull-number context, selected by their own update times", "scopes": [ "Pull requests:read" ], "strategy": "timestamp", "endpoints": [ { "method": "GET", "path": "/repos/{owner}/{repo}/pulls/comments", "documentation": "https://docs.github.com/en/rest/pulls/comments#list-review-comments-in-a-repository" } ] }, { "name": "pull_request_reviews", "title": "Pull request reviews", "table": "github_pull_request_reviews_raw", "description": "One raw review per row with repository and pull number; discovers its own pull-request parents", "scopes": [ "Pull requests:read" ], "strategy": "full", "endpoints": [ { "method": "GET", "path": "/repos/{owner}/{repo}/pulls", "documentation": "https://docs.github.com/en/rest/pulls/pulls#list-pull-requests" }, { "method": "GET", "path": "/repos/{owner}/{repo}/pulls/{pull_number}/reviews", "documentation": "https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request" } ] }, { "name": "pull_request_commits", "title": "Pull request commits", "table": "github_pull_request_commits_raw", "description": "Commit SHA and message only, with repository and pull number; paginates GraphQL commits after independent pull-request discovery", "scopes": [ "Pull requests:read", "Contents:read" ], "strategy": "full", "endpoints": [ { "method": "GET", "path": "/repos/{owner}/{repo}/pulls", "documentation": "https://docs.github.com/en/rest/pulls/pulls#list-pull-requests" }, { "method": "POST", "path": "/graphql", "documentation": "https://docs.github.com/en/graphql/reference/pulls#pullrequest" } ] }, { "name": "stargazers", "title": "Stargazers", "table": "github_stargazers_raw", "description": "Repository stargazers with starred_at and repository context", "scopes": [], "strategy": "full", "endpoints": [ { "method": "GET", "path": "/repos/{owner}/{repo}/stargazers", "documentation": "https://docs.github.com/en/rest/activity/starring#list-stargazers" } ] } ], "views": [], "sync": { "description": "One installation pipeline groups eight independent resource streams per configured repository. Issues and comments use completed updated-time windows; pull requests, reviews, commits, and stargazers use fullSync. Each child stream discovers its own parent collection, independently of parent-stream execution or parent update times.", "schedule": "Run bunx chkit ingest run --tag provider:github from a scheduler.", "deletions": "Deleted records, removed stars, and commits no longer present after a force-push remain stored. Missing observations do not generate tombstones; legacy mixed issue/PR rows and nested child payloads require deliberate migration." }, "env": { "GITHUB_TOKEN": "" }, "fileHashes": { "src/integrations/github/README.md": "693ac62853763b5e2c7216bcd3afc014fc93f6e5f9bca35192cac8b899eb3935", "src/integrations/github/index.ts": "18cc6d48bcd79ca7855de185d15c3f245423571863e5f39deb031278640d7a9e", "src/integrations/github/config.ts": "c6ee56c657acb19da8db5117e5c99bfbc56931d9d1b503f3c71d5f2b9fca0ca4", "src/integrations/github/client.ts": "1289977bab8acc6ac0b59d31442469e4ff21645f1633c933addc22d9021366de", "src/integrations/github/pipeline.ts": "8e32ebb37d40752677c3cecd36bd42c6b541b86d7fc78805923e7be1c3fa10b4", "src/integrations/github/sources/issues.ts": "8bd8e313361aa08f238474155d041b5a3ba604058120fdea6e02b458c1775e98", "src/integrations/github/sources/stargazers.ts": "d678998d14954df9f77f2f97b07933c7449b7e6fa2abde95311bdcda4f664dd6", "src/integrations/github/sources/issue-comments.ts": "7fcb004c429c12cd766479255e79bd281d4e191ff8aa7adf5a7cffcb27761645", "src/integrations/github/sources/pull-requests.ts": "5d5ed7331de17af89b33ab172c95bd1b71fd81ce22801c2a32f7c365a855c589", "src/integrations/github/sources/pull-request-comments.ts": "461bd1b01cedbedeb6e2eebe3f8cf0de81cd89b3229f5ea298e2ef75bb652d5f", "src/integrations/github/sources/pull-request-review-comments.ts": "911bea05e646a3c9e8e81c81a067836f8621cc7ff3a6b8798db4cd9293b72210", "src/integrations/github/sources/pull-request-reviews.ts": "a0738d9f2b4cf5ce9df4edcaa0255cd306450593884fff28d374725ceae3902f", "src/integrations/github/sources/pull-request-commits.ts": "4a091b39eb3e4653abe17480ab6119c7aed0375b2bbafdf636dd88a54c25adb3", "src/integrations/github/tests/basic.test.ts": "a754bd2a1a0a27371df4ad3f8a5d830d0c0e7d13319d546b431c748de97bf746" } } } }