comfy-qa 2.0.0 → 2.0.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/utils/github.ts +38 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comfy-qa",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "ComfyUI QA automation CLI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,46 +37,56 @@ export function parseRef(ref: string): { owner: string; repo: string; number?: n
37
37
  }
38
38
 
39
39
  export async function fetchPR(owner: string, repo: string, number: number): Promise<PRInfo> {
40
- const json = await $`gh pr view ${number} --repo ${owner}/${repo} --json number,title,body,state,headRefName,baseRefName,author,labels,url,files,comments`.text();
41
- const raw = JSON.parse(json);
40
+ const [prJson, filesJson, commentsJson] = await Promise.all([
41
+ $`gh api repos/${owner}/${repo}/pulls/${number}`.text(),
42
+ $`gh api repos/${owner}/${repo}/pulls/${number}/files --paginate`.text(),
43
+ $`gh api repos/${owner}/${repo}/issues/${number}/comments --paginate`.text(),
44
+ ]);
45
+ const pr = JSON.parse(prJson);
46
+ const files = JSON.parse(filesJson);
47
+ const comments = JSON.parse(commentsJson);
42
48
  return {
43
- number: raw.number,
44
- title: raw.title,
45
- body: raw.body || "",
46
- state: raw.state,
47
- headRefName: raw.headRefName,
48
- baseRefName: raw.baseRefName,
49
- author: raw.author?.login || "unknown",
50
- labels: (raw.labels || []).map((l: any) => l.name),
51
- url: raw.url,
52
- files: (raw.files || []).map((f: any) => ({
53
- path: f.path,
49
+ number: pr.number,
50
+ title: pr.title,
51
+ body: pr.body || "",
52
+ state: pr.state,
53
+ headRefName: pr.head.ref,
54
+ baseRefName: pr.base.ref,
55
+ author: pr.user?.login || "unknown",
56
+ labels: (pr.labels || []).map((l: any) => l.name),
57
+ url: pr.html_url,
58
+ files: files.map((f: any) => ({
59
+ path: f.filename,
54
60
  additions: f.additions,
55
61
  deletions: f.deletions,
56
62
  })),
57
- comments: (raw.comments || []).map((c: any) => ({
58
- author: c.author?.login || "unknown",
63
+ comments: comments.map((c: any) => ({
64
+ author: c.user?.login || "unknown",
59
65
  body: c.body || "",
60
- createdAt: c.createdAt,
66
+ createdAt: c.created_at,
61
67
  })),
62
68
  };
63
69
  }
64
70
 
65
71
  export async function fetchIssue(owner: string, repo: string, number: number): Promise<IssueInfo> {
66
- const json = await $`gh issue view ${number} --repo ${owner}/${repo} --json number,title,body,state,author,labels,url,comments`.text();
67
- const raw = JSON.parse(json);
72
+ const [issueJson, commentsJson] = await Promise.all([
73
+ $`gh api repos/${owner}/${repo}/issues/${number}`.text(),
74
+ $`gh api repos/${owner}/${repo}/issues/${number}/comments --paginate`.text(),
75
+ ]);
76
+ const issue = JSON.parse(issueJson);
77
+ const comments = JSON.parse(commentsJson);
68
78
  return {
69
- number: raw.number,
70
- title: raw.title,
71
- body: raw.body || "",
72
- state: raw.state,
73
- author: raw.author?.login || "unknown",
74
- labels: (raw.labels || []).map((l: any) => l.name),
75
- url: raw.url,
76
- comments: (raw.comments || []).map((c: any) => ({
77
- author: c.author?.login || "unknown",
79
+ number: issue.number,
80
+ title: issue.title,
81
+ body: issue.body || "",
82
+ state: issue.state,
83
+ author: issue.user?.login || "unknown",
84
+ labels: (issue.labels || []).map((l: any) => l.name),
85
+ url: issue.html_url,
86
+ comments: comments.map((c: any) => ({
87
+ author: c.user?.login || "unknown",
78
88
  body: c.body || "",
79
- createdAt: c.createdAt,
89
+ createdAt: c.created_at,
80
90
  })),
81
91
  };
82
92
  }