MCPcopy Create free account
hub / github.com/ix-infrastructure/Ix / transformIssueComment

Function transformIssueComment

ix-cli/src/cli/github/transform.ts:47–78  ·  view source on GitHub ↗
(
  repo: GitHubRepo, issueNumber: number, comment: GitHubComment
)

Source from the content-addressed store, hash-verified

45}
46
47export function transformIssueComment(
48 repo: GitHubRepo, issueNumber: number, comment: GitHubComment
49): PatchOp[] {
50 const parentUri = `github://${repo.owner}/${repo.repo}/issues/${issueNumber}`;
51 const commentUri = `${parentUri}/comments/${comment.id}`;
52 const parentId = deterministicId(parentUri);
53 const commentId = deterministicId(commentUri);
54 const edgeId = deterministicId(`${parentUri}:CONTAINS:${commentUri}`);
55 return [
56 {
57 type: "UpsertNode",
58 id: commentId,
59 kind: "doc",
60 name: `Issue #${issueNumber} comment by ${comment.user?.login ?? "unknown"}`,
61 attrs: {
62 url: comment.html_url,
63 author: comment.user?.login ?? "unknown",
64 created_at: comment.created_at,
65 body: truncate(comment.body, 2000),
66 source_uri: commentUri,
67 },
68 },
69 {
70 type: "UpsertEdge",
71 id: edgeId,
72 src: parentId,
73 dst: commentId,
74 predicate: "CONTAINS",
75 attrs: {},
76 },
77 ];
78}
79
80export function transformPR(repo: GitHubRepo, pr: GitHubPR): PatchOp[] {
81 const uri = `github://${repo.owner}/${repo.repo}/pull/${pr.number}`;

Callers 1

ingestGitHubFunction · 0.85

Calls 2

deterministicIdFunction · 0.70
truncateFunction · 0.70

Tested by

no test coverage detected