npm-cli-gh-issue-preparator 1.0.0 → 1.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.
- package/CHANGELOG.md +7 -0
- package/bin/adapter/repositories/GitHubIssueRepository.js +128 -77
- package/bin/adapter/repositories/GitHubIssueRepository.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/repositories/GitHubIssueRepository.integration.test.ts +53 -37
- package/src/adapter/repositories/GitHubIssueRepository.test.ts +40 -0
- package/src/adapter/repositories/GitHubIssueRepository.ts +153 -84
- package/types/adapter/repositories/GitHubIssueRepository.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.0.1](https://github.com/HiromiShikata/npm-cli-gh-issue-preparator/compare/v1.0.0...v1.0.1) (2025-12-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* failed to load PR and over 100 items ([dd1c216](https://github.com/HiromiShikata/npm-cli-gh-issue-preparator/commit/dd1c2164e3ed1b8dcfa1b4de75395f875a8d0de2))
|
|
7
|
+
|
|
1
8
|
# 1.0.0 (2025-12-14)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -31,10 +31,15 @@ class GitHubIssueRepository {
|
|
|
31
31
|
}
|
|
32
32
|
buildProjectItemsQuery() {
|
|
33
33
|
return `
|
|
34
|
-
query($owner: String!, $number: Int
|
|
34
|
+
query($owner: String!, $number: Int!, $after: String) {
|
|
35
35
|
organization(login: $owner) {
|
|
36
36
|
projectV2(number: $number) {
|
|
37
|
-
items(first: 100) {
|
|
37
|
+
items(first: 100, after: $after) {
|
|
38
|
+
totalCount
|
|
39
|
+
pageInfo {
|
|
40
|
+
endCursor
|
|
41
|
+
hasNextPage
|
|
42
|
+
}
|
|
38
43
|
nodes {
|
|
39
44
|
id
|
|
40
45
|
content {
|
|
@@ -48,6 +53,16 @@ class GitHubIssueRepository {
|
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
}
|
|
56
|
+
... on PullRequest {
|
|
57
|
+
url
|
|
58
|
+
title
|
|
59
|
+
number
|
|
60
|
+
labels(first: 10) {
|
|
61
|
+
nodes {
|
|
62
|
+
name
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
51
66
|
}
|
|
52
67
|
fieldValues(first: 20) {
|
|
53
68
|
nodes {
|
|
@@ -76,7 +91,12 @@ class GitHubIssueRepository {
|
|
|
76
91
|
}
|
|
77
92
|
user(login: $owner) {
|
|
78
93
|
projectV2(number: $number) {
|
|
79
|
-
items(first: 100) {
|
|
94
|
+
items(first: 100, after: $after) {
|
|
95
|
+
totalCount
|
|
96
|
+
pageInfo {
|
|
97
|
+
endCursor
|
|
98
|
+
hasNextPage
|
|
99
|
+
}
|
|
80
100
|
nodes {
|
|
81
101
|
id
|
|
82
102
|
content {
|
|
@@ -90,6 +110,16 @@ class GitHubIssueRepository {
|
|
|
90
110
|
}
|
|
91
111
|
}
|
|
92
112
|
}
|
|
113
|
+
... on PullRequest {
|
|
114
|
+
url
|
|
115
|
+
title
|
|
116
|
+
number
|
|
117
|
+
labels(first: 10) {
|
|
118
|
+
nodes {
|
|
119
|
+
name
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
93
123
|
}
|
|
94
124
|
fieldValues(first: 20) {
|
|
95
125
|
nodes {
|
|
@@ -198,45 +228,57 @@ class GitHubIssueRepository {
|
|
|
198
228
|
async getAllOpened(project) {
|
|
199
229
|
const { owner, projectNumber } = this.parseProjectInfo(project);
|
|
200
230
|
const query = this.buildProjectItemsQuery();
|
|
201
|
-
const response = await fetch('https://api.github.com/graphql', {
|
|
202
|
-
method: 'POST',
|
|
203
|
-
headers: {
|
|
204
|
-
Authorization: `Bearer ${this.token}`,
|
|
205
|
-
'Content-Type': 'application/json',
|
|
206
|
-
},
|
|
207
|
-
body: JSON.stringify({
|
|
208
|
-
query,
|
|
209
|
-
variables: {
|
|
210
|
-
owner,
|
|
211
|
-
number: projectNumber,
|
|
212
|
-
},
|
|
213
|
-
}),
|
|
214
|
-
});
|
|
215
|
-
if (!response.ok) {
|
|
216
|
-
const errorText = await response.text();
|
|
217
|
-
throw new Error(`GitHub API error: ${errorText}`);
|
|
218
|
-
}
|
|
219
|
-
const responseData = await response.json();
|
|
220
|
-
if (!isProjectItemsResponse(responseData)) {
|
|
221
|
-
throw new Error('Invalid API response format');
|
|
222
|
-
}
|
|
223
|
-
const result = responseData;
|
|
224
|
-
const items = result.data?.organization?.projectV2?.items.nodes ||
|
|
225
|
-
result.data?.user?.projectV2?.items.nodes ||
|
|
226
|
-
[];
|
|
227
231
|
const issues = [];
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
232
|
+
let after = null;
|
|
233
|
+
let hasNextPage = true;
|
|
234
|
+
while (hasNextPage) {
|
|
235
|
+
const response = await fetch('https://api.github.com/graphql', {
|
|
236
|
+
method: 'POST',
|
|
237
|
+
headers: {
|
|
238
|
+
Authorization: `Bearer ${this.token}`,
|
|
239
|
+
'Content-Type': 'application/json',
|
|
240
|
+
},
|
|
241
|
+
body: JSON.stringify({
|
|
242
|
+
query,
|
|
243
|
+
variables: {
|
|
244
|
+
owner,
|
|
245
|
+
number: projectNumber,
|
|
246
|
+
after,
|
|
247
|
+
},
|
|
248
|
+
}),
|
|
239
249
|
});
|
|
250
|
+
if (!response.ok) {
|
|
251
|
+
const errorText = await response.text();
|
|
252
|
+
throw new Error(`GitHub API error: ${errorText}`);
|
|
253
|
+
}
|
|
254
|
+
const responseData = await response.json();
|
|
255
|
+
if (!isProjectItemsResponse(responseData)) {
|
|
256
|
+
throw new Error('Invalid API response format');
|
|
257
|
+
}
|
|
258
|
+
const result = responseData;
|
|
259
|
+
const projectData = result.data?.organization?.projectV2 || result.data?.user?.projectV2;
|
|
260
|
+
if (!projectData) {
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
const items = projectData.items.nodes;
|
|
264
|
+
for (const item of items) {
|
|
265
|
+
if (!item.content)
|
|
266
|
+
continue;
|
|
267
|
+
const statusField = item.fieldValues?.nodes.find((fv) => fv.field?.name === 'Status');
|
|
268
|
+
const status = statusField?.name || '';
|
|
269
|
+
if (item.content.url === undefined) {
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
issues.push({
|
|
273
|
+
id: item.id,
|
|
274
|
+
url: item.content.url,
|
|
275
|
+
title: item.content.title,
|
|
276
|
+
labels: item.content.labels?.nodes?.map((l) => l.name) || [],
|
|
277
|
+
status,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
hasNextPage = projectData.items.pageInfo.hasNextPage;
|
|
281
|
+
after = projectData.items.pageInfo.endCursor;
|
|
240
282
|
}
|
|
241
283
|
return issues;
|
|
242
284
|
}
|
|
@@ -293,45 +335,54 @@ class GitHubIssueRepository {
|
|
|
293
335
|
async get(issueUrl, project) {
|
|
294
336
|
const { owner, projectNumber } = this.parseProjectInfo(project);
|
|
295
337
|
const query = this.buildProjectItemsQuery();
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
variables: {
|
|
305
|
-
owner,
|
|
306
|
-
number: projectNumber,
|
|
338
|
+
let after = null;
|
|
339
|
+
let hasNextPage = true;
|
|
340
|
+
while (hasNextPage) {
|
|
341
|
+
const response = await fetch('https://api.github.com/graphql', {
|
|
342
|
+
method: 'POST',
|
|
343
|
+
headers: {
|
|
344
|
+
Authorization: `Bearer ${this.token}`,
|
|
345
|
+
'Content-Type': 'application/json',
|
|
307
346
|
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
347
|
+
body: JSON.stringify({
|
|
348
|
+
query,
|
|
349
|
+
variables: {
|
|
350
|
+
owner,
|
|
351
|
+
number: projectNumber,
|
|
352
|
+
after,
|
|
353
|
+
},
|
|
354
|
+
}),
|
|
355
|
+
});
|
|
356
|
+
if (!response.ok) {
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
const responseData = await response.json();
|
|
360
|
+
if (!isProjectItemsResponse(responseData)) {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
const result = responseData;
|
|
364
|
+
const projectData = result.data?.organization?.projectV2 || result.data?.user?.projectV2;
|
|
365
|
+
if (!projectData) {
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
const items = projectData.items.nodes;
|
|
369
|
+
for (const item of items) {
|
|
370
|
+
if (!item.content)
|
|
371
|
+
continue;
|
|
372
|
+
if (item.content.url === issueUrl) {
|
|
373
|
+
const statusField = item.fieldValues?.nodes.find((fv) => fv.field?.name === 'Status');
|
|
374
|
+
const status = statusField?.name || '';
|
|
375
|
+
return {
|
|
376
|
+
id: item.id,
|
|
377
|
+
url: item.content.url,
|
|
378
|
+
title: item.content.title,
|
|
379
|
+
labels: item.content.labels?.nodes?.map((l) => l.name) || [],
|
|
380
|
+
status,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
334
383
|
}
|
|
384
|
+
hasNextPage = projectData.items.pageInfo.hasNextPage;
|
|
385
|
+
after = projectData.items.pageInfo.endCursor;
|
|
335
386
|
}
|
|
336
387
|
return null;
|
|
337
388
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHubIssueRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/GitHubIssueRepository.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"GitHubIssueRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/GitHubIssueRepository.ts"],"names":[],"mappings":";;;AA6FA,SAAS,sBAAsB,CAAC,KAAc;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAc;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAa,qBAAqB;IAChC,YAA6B,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAEtC,gBAAgB,CAAC,OAAgB;QAIvC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAChC,uDAAuD,CACxD,CAAC;QACF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChE,CAAC;QACD,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC1B,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAEhD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IAClC,CAAC;IAEO,sBAAsB;QAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 -10,41 +10,57 @@ describe('GitHubIssueRepository Integration Test', () => {
|
|
|
10
10
|
const issueUrl =
|
|
11
11
|
'https://github.com/HiromiShikata/test-repository/issues/1552';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
13
|
+
describe('getgetAllOpened', () => {
|
|
14
|
+
it('should get all opened issues and verify the list is not empty', async () => {
|
|
15
|
+
if (!token) {
|
|
16
|
+
throw new Error('GH_TOKEN environment variable is required');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const repository = new GitHubIssueRepository(token);
|
|
20
|
+
const projectRepository = new GitHubProjectRepository(token);
|
|
21
|
+
const project = await projectRepository.getByUrl(projectUrl);
|
|
22
|
+
|
|
23
|
+
const openedIssues = await repository.getAllOpened(project);
|
|
24
|
+
expect(openedIssues.length).toBeGreaterThan(0);
|
|
25
|
+
}, 60000);
|
|
26
|
+
});
|
|
27
|
+
describe('update', () => {
|
|
28
|
+
it('should update issue status from Awaiting workspace to Preparation and verify the change', async () => {
|
|
29
|
+
if (!token) {
|
|
30
|
+
throw new Error('GH_TOKEN environment variable is required');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const repository = new GitHubIssueRepository(token);
|
|
34
|
+
const projectRepository = new GitHubProjectRepository(token);
|
|
35
|
+
const project = await projectRepository.getByUrl(projectUrl);
|
|
36
|
+
|
|
37
|
+
const initialIssue = await repository.get(issueUrl, project);
|
|
38
|
+
expect(initialIssue).not.toBeNull();
|
|
39
|
+
if (!initialIssue) {
|
|
40
|
+
throw new Error('Failed to get initial issue');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
initialIssue.status = 'Awaiting workspace';
|
|
44
|
+
await repository.update(initialIssue, project);
|
|
45
|
+
|
|
46
|
+
const reloadedIssue = await repository.get(issueUrl, project);
|
|
47
|
+
if (!reloadedIssue) {
|
|
48
|
+
throw new Error('Failed to get reloaded issue');
|
|
49
|
+
}
|
|
50
|
+
expect(reloadedIssue.status).toBe('Awaiting workspace');
|
|
51
|
+
|
|
52
|
+
reloadedIssue.status = 'Preparation';
|
|
53
|
+
await repository.update(reloadedIssue, project);
|
|
54
|
+
|
|
55
|
+
const verifyIssue = await repository.get(issueUrl, project);
|
|
56
|
+
expect(verifyIssue).not.toBeNull();
|
|
57
|
+
if (!verifyIssue) {
|
|
58
|
+
throw new Error('Failed to get verify issue');
|
|
59
|
+
}
|
|
60
|
+
expect(verifyIssue.status).toBe('Preparation');
|
|
61
|
+
|
|
62
|
+
verifyIssue.status = 'Awaiting workspace';
|
|
63
|
+
await repository.update(verifyIssue, project);
|
|
64
|
+
}, 60000);
|
|
65
|
+
});
|
|
50
66
|
});
|
|
@@ -38,6 +38,11 @@ describe('GitHubIssueRepository', () => {
|
|
|
38
38
|
organization: {
|
|
39
39
|
projectV2: {
|
|
40
40
|
items: {
|
|
41
|
+
totalCount: 2,
|
|
42
|
+
pageInfo: {
|
|
43
|
+
endCursor: null,
|
|
44
|
+
hasNextPage: false,
|
|
45
|
+
},
|
|
41
46
|
nodes: [
|
|
42
47
|
{
|
|
43
48
|
id: 'issue-1',
|
|
@@ -149,6 +154,11 @@ describe('GitHubIssueRepository', () => {
|
|
|
149
154
|
user: {
|
|
150
155
|
projectV2: {
|
|
151
156
|
items: {
|
|
157
|
+
totalCount: 1,
|
|
158
|
+
pageInfo: {
|
|
159
|
+
endCursor: null,
|
|
160
|
+
hasNextPage: false,
|
|
161
|
+
},
|
|
152
162
|
nodes: [
|
|
153
163
|
{
|
|
154
164
|
id: 'user-issue-1',
|
|
@@ -199,6 +209,11 @@ describe('GitHubIssueRepository', () => {
|
|
|
199
209
|
organization: {
|
|
200
210
|
projectV2: {
|
|
201
211
|
items: {
|
|
212
|
+
totalCount: 2,
|
|
213
|
+
pageInfo: {
|
|
214
|
+
endCursor: null,
|
|
215
|
+
hasNextPage: false,
|
|
216
|
+
},
|
|
202
217
|
nodes: [
|
|
203
218
|
{
|
|
204
219
|
id: 'item-without-content',
|
|
@@ -263,6 +278,11 @@ describe('GitHubIssueRepository', () => {
|
|
|
263
278
|
organization: {
|
|
264
279
|
projectV2: {
|
|
265
280
|
items: {
|
|
281
|
+
totalCount: 1,
|
|
282
|
+
pageInfo: {
|
|
283
|
+
endCursor: null,
|
|
284
|
+
hasNextPage: false,
|
|
285
|
+
},
|
|
266
286
|
nodes: [
|
|
267
287
|
{
|
|
268
288
|
id: 'issue-no-status',
|
|
@@ -728,6 +748,11 @@ describe('GitHubIssueRepository', () => {
|
|
|
728
748
|
organization: {
|
|
729
749
|
projectV2: {
|
|
730
750
|
items: {
|
|
751
|
+
totalCount: 1,
|
|
752
|
+
pageInfo: {
|
|
753
|
+
endCursor: null,
|
|
754
|
+
hasNextPage: false,
|
|
755
|
+
},
|
|
731
756
|
nodes: [
|
|
732
757
|
{
|
|
733
758
|
id: 'issue-1',
|
|
@@ -805,6 +830,11 @@ describe('GitHubIssueRepository', () => {
|
|
|
805
830
|
organization: {
|
|
806
831
|
projectV2: {
|
|
807
832
|
items: {
|
|
833
|
+
totalCount: 0,
|
|
834
|
+
pageInfo: {
|
|
835
|
+
endCursor: null,
|
|
836
|
+
hasNextPage: false,
|
|
837
|
+
},
|
|
808
838
|
nodes: [],
|
|
809
839
|
},
|
|
810
840
|
},
|
|
@@ -828,6 +858,11 @@ describe('GitHubIssueRepository', () => {
|
|
|
828
858
|
user: {
|
|
829
859
|
projectV2: {
|
|
830
860
|
items: {
|
|
861
|
+
totalCount: 1,
|
|
862
|
+
pageInfo: {
|
|
863
|
+
endCursor: null,
|
|
864
|
+
hasNextPage: false,
|
|
865
|
+
},
|
|
831
866
|
nodes: [
|
|
832
867
|
{
|
|
833
868
|
id: 'issue-2',
|
|
@@ -880,6 +915,11 @@ describe('GitHubIssueRepository', () => {
|
|
|
880
915
|
organization: {
|
|
881
916
|
projectV2: {
|
|
882
917
|
items: {
|
|
918
|
+
totalCount: 1,
|
|
919
|
+
pageInfo: {
|
|
920
|
+
endCursor: null,
|
|
921
|
+
hasNextPage: false,
|
|
922
|
+
},
|
|
883
923
|
nodes: [
|
|
884
924
|
{
|
|
885
925
|
id: 'issue-3',
|
|
@@ -27,6 +27,11 @@ type ProjectItemsResponse = {
|
|
|
27
27
|
organization?: {
|
|
28
28
|
projectV2?: {
|
|
29
29
|
items: {
|
|
30
|
+
totalCount: number;
|
|
31
|
+
pageInfo: {
|
|
32
|
+
endCursor: string;
|
|
33
|
+
hasNextPage: boolean;
|
|
34
|
+
};
|
|
30
35
|
nodes: ProjectItem[];
|
|
31
36
|
};
|
|
32
37
|
};
|
|
@@ -34,6 +39,11 @@ type ProjectItemsResponse = {
|
|
|
34
39
|
user?: {
|
|
35
40
|
projectV2?: {
|
|
36
41
|
items: {
|
|
42
|
+
totalCount: number;
|
|
43
|
+
pageInfo: {
|
|
44
|
+
endCursor: string;
|
|
45
|
+
hasNextPage: boolean;
|
|
46
|
+
};
|
|
37
47
|
nodes: ProjectItem[];
|
|
38
48
|
};
|
|
39
49
|
};
|
|
@@ -117,10 +127,15 @@ export class GitHubIssueRepository implements IssueRepository {
|
|
|
117
127
|
|
|
118
128
|
private buildProjectItemsQuery(): string {
|
|
119
129
|
return `
|
|
120
|
-
query($owner: String!, $number: Int
|
|
130
|
+
query($owner: String!, $number: Int!, $after: String) {
|
|
121
131
|
organization(login: $owner) {
|
|
122
132
|
projectV2(number: $number) {
|
|
123
|
-
items(first: 100) {
|
|
133
|
+
items(first: 100, after: $after) {
|
|
134
|
+
totalCount
|
|
135
|
+
pageInfo {
|
|
136
|
+
endCursor
|
|
137
|
+
hasNextPage
|
|
138
|
+
}
|
|
124
139
|
nodes {
|
|
125
140
|
id
|
|
126
141
|
content {
|
|
@@ -134,6 +149,16 @@ export class GitHubIssueRepository implements IssueRepository {
|
|
|
134
149
|
}
|
|
135
150
|
}
|
|
136
151
|
}
|
|
152
|
+
... on PullRequest {
|
|
153
|
+
url
|
|
154
|
+
title
|
|
155
|
+
number
|
|
156
|
+
labels(first: 10) {
|
|
157
|
+
nodes {
|
|
158
|
+
name
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
137
162
|
}
|
|
138
163
|
fieldValues(first: 20) {
|
|
139
164
|
nodes {
|
|
@@ -162,7 +187,12 @@ export class GitHubIssueRepository implements IssueRepository {
|
|
|
162
187
|
}
|
|
163
188
|
user(login: $owner) {
|
|
164
189
|
projectV2(number: $number) {
|
|
165
|
-
items(first: 100) {
|
|
190
|
+
items(first: 100, after: $after) {
|
|
191
|
+
totalCount
|
|
192
|
+
pageInfo {
|
|
193
|
+
endCursor
|
|
194
|
+
hasNextPage
|
|
195
|
+
}
|
|
166
196
|
nodes {
|
|
167
197
|
id
|
|
168
198
|
content {
|
|
@@ -176,6 +206,16 @@ export class GitHubIssueRepository implements IssueRepository {
|
|
|
176
206
|
}
|
|
177
207
|
}
|
|
178
208
|
}
|
|
209
|
+
... on PullRequest {
|
|
210
|
+
url
|
|
211
|
+
title
|
|
212
|
+
number
|
|
213
|
+
labels(first: 10) {
|
|
214
|
+
nodes {
|
|
215
|
+
name
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
179
219
|
}
|
|
180
220
|
fieldValues(first: 20) {
|
|
181
221
|
nodes {
|
|
@@ -300,53 +340,69 @@ export class GitHubIssueRepository implements IssueRepository {
|
|
|
300
340
|
|
|
301
341
|
const query = this.buildProjectItemsQuery();
|
|
302
342
|
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
number: projectNumber,
|
|
343
|
+
const issues: Issue[] = [];
|
|
344
|
+
let after: string | null = null;
|
|
345
|
+
let hasNextPage = true;
|
|
346
|
+
|
|
347
|
+
while (hasNextPage) {
|
|
348
|
+
const response = await fetch('https://api.github.com/graphql', {
|
|
349
|
+
method: 'POST',
|
|
350
|
+
headers: {
|
|
351
|
+
Authorization: `Bearer ${this.token}`,
|
|
352
|
+
'Content-Type': 'application/json',
|
|
314
353
|
},
|
|
315
|
-
|
|
316
|
-
|
|
354
|
+
body: JSON.stringify({
|
|
355
|
+
query,
|
|
356
|
+
variables: {
|
|
357
|
+
owner,
|
|
358
|
+
number: projectNumber,
|
|
359
|
+
after,
|
|
360
|
+
},
|
|
361
|
+
}),
|
|
362
|
+
});
|
|
317
363
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
364
|
+
if (!response.ok) {
|
|
365
|
+
const errorText = await response.text();
|
|
366
|
+
throw new Error(`GitHub API error: ${errorText}`);
|
|
367
|
+
}
|
|
322
368
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
369
|
+
const responseData: unknown = await response.json();
|
|
370
|
+
if (!isProjectItemsResponse(responseData)) {
|
|
371
|
+
throw new Error('Invalid API response format');
|
|
372
|
+
}
|
|
327
373
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
result.data?.user?.projectV2?.items.nodes ||
|
|
332
|
-
[];
|
|
374
|
+
const result: ProjectItemsResponse = responseData;
|
|
375
|
+
const projectData =
|
|
376
|
+
result.data?.organization?.projectV2 || result.data?.user?.projectV2;
|
|
333
377
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
)
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
378
|
+
if (!projectData) {
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const items = projectData.items.nodes;
|
|
383
|
+
|
|
384
|
+
for (const item of items) {
|
|
385
|
+
if (!item.content) continue;
|
|
386
|
+
|
|
387
|
+
const statusField = item.fieldValues?.nodes.find(
|
|
388
|
+
(fv) => fv.field?.name === 'Status',
|
|
389
|
+
);
|
|
390
|
+
const status = statusField?.name || '';
|
|
391
|
+
|
|
392
|
+
if (item.content.url === undefined) {
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
issues.push({
|
|
396
|
+
id: item.id,
|
|
397
|
+
url: item.content.url,
|
|
398
|
+
title: item.content.title,
|
|
399
|
+
labels: item.content.labels?.nodes?.map((l) => l.name) || [],
|
|
400
|
+
status,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
hasNextPage = projectData.items.pageInfo.hasNextPage;
|
|
405
|
+
after = projectData.items.pageInfo.endCursor;
|
|
350
406
|
}
|
|
351
407
|
|
|
352
408
|
return issues;
|
|
@@ -416,53 +472,66 @@ export class GitHubIssueRepository implements IssueRepository {
|
|
|
416
472
|
|
|
417
473
|
const query = this.buildProjectItemsQuery();
|
|
418
474
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
owner,
|
|
429
|
-
number: projectNumber,
|
|
475
|
+
let after: string | null = null;
|
|
476
|
+
let hasNextPage = true;
|
|
477
|
+
|
|
478
|
+
while (hasNextPage) {
|
|
479
|
+
const response = await fetch('https://api.github.com/graphql', {
|
|
480
|
+
method: 'POST',
|
|
481
|
+
headers: {
|
|
482
|
+
Authorization: `Bearer ${this.token}`,
|
|
483
|
+
'Content-Type': 'application/json',
|
|
430
484
|
},
|
|
431
|
-
|
|
432
|
-
|
|
485
|
+
body: JSON.stringify({
|
|
486
|
+
query,
|
|
487
|
+
variables: {
|
|
488
|
+
owner,
|
|
489
|
+
number: projectNumber,
|
|
490
|
+
after,
|
|
491
|
+
},
|
|
492
|
+
}),
|
|
493
|
+
});
|
|
433
494
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
495
|
+
if (!response.ok) {
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
437
498
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
499
|
+
const responseData: unknown = await response.json();
|
|
500
|
+
if (!isProjectItemsResponse(responseData)) {
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
442
503
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
result.data?.user?.projectV2?.items.nodes ||
|
|
447
|
-
[];
|
|
504
|
+
const result: ProjectItemsResponse = responseData;
|
|
505
|
+
const projectData =
|
|
506
|
+
result.data?.organization?.projectV2 || result.data?.user?.projectV2;
|
|
448
507
|
|
|
449
|
-
|
|
450
|
-
|
|
508
|
+
if (!projectData) {
|
|
509
|
+
return null;
|
|
510
|
+
}
|
|
451
511
|
|
|
452
|
-
|
|
453
|
-
const statusField = item.fieldValues?.nodes.find(
|
|
454
|
-
(fv) => fv.field?.name === 'Status',
|
|
455
|
-
);
|
|
456
|
-
const status = statusField?.name || '';
|
|
512
|
+
const items = projectData.items.nodes;
|
|
457
513
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
514
|
+
for (const item of items) {
|
|
515
|
+
if (!item.content) continue;
|
|
516
|
+
|
|
517
|
+
if (item.content.url === issueUrl) {
|
|
518
|
+
const statusField = item.fieldValues?.nodes.find(
|
|
519
|
+
(fv) => fv.field?.name === 'Status',
|
|
520
|
+
);
|
|
521
|
+
const status = statusField?.name || '';
|
|
522
|
+
|
|
523
|
+
return {
|
|
524
|
+
id: item.id,
|
|
525
|
+
url: item.content.url,
|
|
526
|
+
title: item.content.title,
|
|
527
|
+
labels: item.content.labels?.nodes?.map((l) => l.name) || [],
|
|
528
|
+
status,
|
|
529
|
+
};
|
|
530
|
+
}
|
|
465
531
|
}
|
|
532
|
+
|
|
533
|
+
hasNextPage = projectData.items.pageInfo.hasNextPage;
|
|
534
|
+
after = projectData.items.pageInfo.endCursor;
|
|
466
535
|
}
|
|
467
536
|
|
|
468
537
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHubIssueRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/GitHubIssueRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"GitHubIssueRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/GitHubIssueRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AA0GxD,qBAAa,qBAAsB,YAAW,eAAe;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,MAAM;IAE1C,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,sBAAsB;YAyHhB,iBAAiB;IAyFzB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAyEhD,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA2DrD,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAqErE"}
|