github-issue-tower-defence-management 1.68.0 → 1.69.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 +15 -0
- package/README.md +5 -0
- package/bin/adapter/entry-points/cli/index.js +9 -0
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/cli/projectConfig.js +4 -0
- package/bin/adapter/entry-points/cli/projectConfig.js.map +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +20 -8
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +1 -0
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js +11 -5
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/StartPreparationUseCase.js +6 -0
- package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
- package/package.json +2 -2
- package/src/adapter/entry-points/cli/index.test.ts +4 -0
- package/src/adapter/entry-points/cli/index.ts +10 -0
- package/src/adapter/entry-points/cli/projectConfig.ts +6 -0
- package/src/domain/usecases/HandleScheduledEventUseCase.ts +3 -0
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.test.ts +357 -0
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.ts +32 -9
- package/src/domain/usecases/StartPreparationUseCase.test.ts +198 -0
- package/src/domain/usecases/StartPreparationUseCase.ts +10 -0
- package/types/adapter/entry-points/cli/projectConfig.d.ts +1 -0
- package/types/adapter/entry-points/cli/projectConfig.d.ts.map +1 -1
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts +1 -0
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts +2 -0
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/StartPreparationUseCase.d.ts +1 -0
- package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
|
@@ -174,6 +174,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
174
174
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
175
175
|
thresholdForAutoReject: 3,
|
|
176
176
|
workflowBlockerResolvedWebhookUrl: null,
|
|
177
|
+
allowedIssueAuthors: null,
|
|
177
178
|
});
|
|
178
179
|
|
|
179
180
|
expect(mockIssueRepository.update).toHaveBeenCalledTimes(1);
|
|
@@ -229,6 +230,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
229
230
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
230
231
|
thresholdForAutoReject: 3,
|
|
231
232
|
workflowBlockerResolvedWebhookUrl: null,
|
|
233
|
+
allowedIssueAuthors: null,
|
|
232
234
|
});
|
|
233
235
|
|
|
234
236
|
expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledWith(
|
|
@@ -248,6 +250,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
248
250
|
issueUrl: 'https://github.com/user/repo/issues/999',
|
|
249
251
|
thresholdForAutoReject: 3,
|
|
250
252
|
workflowBlockerResolvedWebhookUrl: null,
|
|
253
|
+
allowedIssueAuthors: null,
|
|
251
254
|
}),
|
|
252
255
|
).rejects.toThrow(
|
|
253
256
|
'Issue not found: https://github.com/user/repo/issues/999',
|
|
@@ -269,6 +272,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
269
272
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
270
273
|
thresholdForAutoReject: 3,
|
|
271
274
|
workflowBlockerResolvedWebhookUrl: null,
|
|
275
|
+
allowedIssueAuthors: null,
|
|
272
276
|
}),
|
|
273
277
|
).rejects.toThrow(
|
|
274
278
|
'Illegal issue status for https://github.com/user/repo/issues/1: expected Preparation, but got Done',
|
|
@@ -293,6 +297,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
293
297
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
294
298
|
thresholdForAutoReject: 3,
|
|
295
299
|
workflowBlockerResolvedWebhookUrl: null,
|
|
300
|
+
allowedIssueAuthors: null,
|
|
296
301
|
});
|
|
297
302
|
|
|
298
303
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -345,6 +350,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
345
350
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
346
351
|
thresholdForAutoReject: 3,
|
|
347
352
|
workflowBlockerResolvedWebhookUrl: null,
|
|
353
|
+
allowedIssueAuthors: null,
|
|
348
354
|
});
|
|
349
355
|
|
|
350
356
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -372,6 +378,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
372
378
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
373
379
|
thresholdForAutoReject: 3,
|
|
374
380
|
workflowBlockerResolvedWebhookUrl: null,
|
|
381
|
+
allowedIssueAuthors: null,
|
|
375
382
|
});
|
|
376
383
|
|
|
377
384
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -404,6 +411,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
404
411
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
405
412
|
thresholdForAutoReject: 3,
|
|
406
413
|
workflowBlockerResolvedWebhookUrl: null,
|
|
414
|
+
allowedIssueAuthors: null,
|
|
407
415
|
});
|
|
408
416
|
|
|
409
417
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -451,6 +459,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
451
459
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
452
460
|
thresholdForAutoReject: 3,
|
|
453
461
|
workflowBlockerResolvedWebhookUrl: null,
|
|
462
|
+
allowedIssueAuthors: null,
|
|
454
463
|
});
|
|
455
464
|
|
|
456
465
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -500,6 +509,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
500
509
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
501
510
|
thresholdForAutoReject: 3,
|
|
502
511
|
workflowBlockerResolvedWebhookUrl: null,
|
|
512
|
+
allowedIssueAuthors: null,
|
|
503
513
|
});
|
|
504
514
|
|
|
505
515
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -547,6 +557,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
547
557
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
548
558
|
thresholdForAutoReject: 3,
|
|
549
559
|
workflowBlockerResolvedWebhookUrl: null,
|
|
560
|
+
allowedIssueAuthors: null,
|
|
550
561
|
});
|
|
551
562
|
|
|
552
563
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -589,6 +600,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
589
600
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
590
601
|
thresholdForAutoReject: 3,
|
|
591
602
|
workflowBlockerResolvedWebhookUrl: null,
|
|
603
|
+
allowedIssueAuthors: null,
|
|
592
604
|
});
|
|
593
605
|
|
|
594
606
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -631,6 +643,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
631
643
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
632
644
|
thresholdForAutoReject: 3,
|
|
633
645
|
workflowBlockerResolvedWebhookUrl: null,
|
|
646
|
+
allowedIssueAuthors: null,
|
|
634
647
|
});
|
|
635
648
|
|
|
636
649
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -673,6 +686,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
673
686
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
674
687
|
thresholdForAutoReject: 3,
|
|
675
688
|
workflowBlockerResolvedWebhookUrl: null,
|
|
689
|
+
allowedIssueAuthors: null,
|
|
676
690
|
});
|
|
677
691
|
|
|
678
692
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -701,6 +715,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
701
715
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
702
716
|
thresholdForAutoReject: 3,
|
|
703
717
|
workflowBlockerResolvedWebhookUrl: null,
|
|
718
|
+
allowedIssueAuthors: null,
|
|
704
719
|
});
|
|
705
720
|
|
|
706
721
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -762,6 +777,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
762
777
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
763
778
|
thresholdForAutoReject: 3,
|
|
764
779
|
workflowBlockerResolvedWebhookUrl: null,
|
|
780
|
+
allowedIssueAuthors: null,
|
|
765
781
|
});
|
|
766
782
|
|
|
767
783
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -814,6 +830,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
814
830
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
815
831
|
thresholdForAutoReject: 3,
|
|
816
832
|
workflowBlockerResolvedWebhookUrl: null,
|
|
833
|
+
allowedIssueAuthors: null,
|
|
817
834
|
});
|
|
818
835
|
|
|
819
836
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -858,6 +875,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
858
875
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
859
876
|
thresholdForAutoReject: 3,
|
|
860
877
|
workflowBlockerResolvedWebhookUrl: null,
|
|
878
|
+
allowedIssueAuthors: null,
|
|
861
879
|
});
|
|
862
880
|
|
|
863
881
|
expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
|
|
@@ -904,6 +922,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
904
922
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
905
923
|
thresholdForAutoReject: 3,
|
|
906
924
|
workflowBlockerResolvedWebhookUrl: null,
|
|
925
|
+
allowedIssueAuthors: null,
|
|
907
926
|
});
|
|
908
927
|
|
|
909
928
|
expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
|
|
@@ -948,6 +967,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
948
967
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
949
968
|
thresholdForAutoReject: 3,
|
|
950
969
|
workflowBlockerResolvedWebhookUrl: null,
|
|
970
|
+
allowedIssueAuthors: null,
|
|
951
971
|
});
|
|
952
972
|
|
|
953
973
|
expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
|
|
@@ -974,6 +994,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
974
994
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
975
995
|
thresholdForAutoReject: 3,
|
|
976
996
|
workflowBlockerResolvedWebhookUrl: null,
|
|
997
|
+
allowedIssueAuthors: null,
|
|
977
998
|
});
|
|
978
999
|
|
|
979
1000
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1027,6 +1048,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1027
1048
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1028
1049
|
thresholdForAutoReject: 3,
|
|
1029
1050
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1051
|
+
allowedIssueAuthors: null,
|
|
1030
1052
|
});
|
|
1031
1053
|
|
|
1032
1054
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1071,6 +1093,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1071
1093
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1072
1094
|
thresholdForAutoReject: 3,
|
|
1073
1095
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1096
|
+
allowedIssueAuthors: null,
|
|
1074
1097
|
});
|
|
1075
1098
|
|
|
1076
1099
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1115,6 +1138,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1115
1138
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1116
1139
|
thresholdForAutoReject: 3,
|
|
1117
1140
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1141
|
+
allowedIssueAuthors: null,
|
|
1118
1142
|
});
|
|
1119
1143
|
|
|
1120
1144
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1159,6 +1183,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1159
1183
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1160
1184
|
thresholdForAutoReject: 3,
|
|
1161
1185
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1186
|
+
allowedIssueAuthors: null,
|
|
1162
1187
|
});
|
|
1163
1188
|
|
|
1164
1189
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1209,6 +1234,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1209
1234
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1210
1235
|
thresholdForAutoReject: 3,
|
|
1211
1236
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1237
|
+
allowedIssueAuthors: null,
|
|
1212
1238
|
});
|
|
1213
1239
|
|
|
1214
1240
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1259,6 +1285,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1259
1285
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1260
1286
|
thresholdForAutoReject: 3,
|
|
1261
1287
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1288
|
+
allowedIssueAuthors: null,
|
|
1262
1289
|
});
|
|
1263
1290
|
|
|
1264
1291
|
expect(mockIssueCommentRepository.createComment).toHaveBeenCalledWith(
|
|
@@ -1297,6 +1324,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1297
1324
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1298
1325
|
thresholdForAutoReject: 3,
|
|
1299
1326
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1327
|
+
allowedIssueAuthors: null,
|
|
1300
1328
|
});
|
|
1301
1329
|
|
|
1302
1330
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1342,6 +1370,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1342
1370
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1343
1371
|
thresholdForAutoReject: 3,
|
|
1344
1372
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1373
|
+
allowedIssueAuthors: null,
|
|
1345
1374
|
});
|
|
1346
1375
|
|
|
1347
1376
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1377,6 +1406,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1377
1406
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1378
1407
|
thresholdForAutoReject: 3,
|
|
1379
1408
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1409
|
+
allowedIssueAuthors: null,
|
|
1380
1410
|
});
|
|
1381
1411
|
|
|
1382
1412
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1416,6 +1446,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1416
1446
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1417
1447
|
thresholdForAutoReject: 3,
|
|
1418
1448
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1449
|
+
allowedIssueAuthors: null,
|
|
1419
1450
|
});
|
|
1420
1451
|
|
|
1421
1452
|
expect(mockIssueRepository.findRelatedOpenPRs).toHaveBeenCalled();
|
|
@@ -1448,6 +1479,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1448
1479
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1449
1480
|
thresholdForAutoReject: 3,
|
|
1450
1481
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1482
|
+
allowedIssueAuthors: null,
|
|
1451
1483
|
});
|
|
1452
1484
|
|
|
1453
1485
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1483,6 +1515,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1483
1515
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1484
1516
|
thresholdForAutoReject: 3,
|
|
1485
1517
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1518
|
+
allowedIssueAuthors: null,
|
|
1486
1519
|
});
|
|
1487
1520
|
|
|
1488
1521
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1510,6 +1543,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1510
1543
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1511
1544
|
thresholdForAutoReject: 3,
|
|
1512
1545
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1546
|
+
allowedIssueAuthors: null,
|
|
1513
1547
|
});
|
|
1514
1548
|
|
|
1515
1549
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1539,6 +1573,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1539
1573
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1540
1574
|
thresholdForAutoReject: 3,
|
|
1541
1575
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1576
|
+
allowedIssueAuthors: null,
|
|
1542
1577
|
});
|
|
1543
1578
|
|
|
1544
1579
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -1578,6 +1613,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1578
1613
|
issueUrl: 'https://github.com/user/repo/pull/10',
|
|
1579
1614
|
thresholdForAutoReject: 3,
|
|
1580
1615
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1616
|
+
allowedIssueAuthors: null,
|
|
1581
1617
|
});
|
|
1582
1618
|
|
|
1583
1619
|
expect(mockIssueRepository.getOpenPullRequest).toHaveBeenCalledWith(
|
|
@@ -1620,6 +1656,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1620
1656
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1621
1657
|
thresholdForAutoReject: 3,
|
|
1622
1658
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1659
|
+
allowedIssueAuthors: null,
|
|
1623
1660
|
});
|
|
1624
1661
|
|
|
1625
1662
|
expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledWith(
|
|
@@ -1658,6 +1695,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1658
1695
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1659
1696
|
thresholdForAutoReject: 3,
|
|
1660
1697
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1698
|
+
allowedIssueAuthors: null,
|
|
1661
1699
|
});
|
|
1662
1700
|
|
|
1663
1701
|
expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledWith(
|
|
@@ -1706,6 +1744,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1706
1744
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1707
1745
|
thresholdForAutoReject: 3,
|
|
1708
1746
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1747
|
+
allowedIssueAuthors: null,
|
|
1709
1748
|
});
|
|
1710
1749
|
|
|
1711
1750
|
expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledWith(
|
|
@@ -1751,6 +1790,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1751
1790
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1752
1791
|
thresholdForAutoReject: 3,
|
|
1753
1792
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1793
|
+
allowedIssueAuthors: null,
|
|
1754
1794
|
});
|
|
1755
1795
|
|
|
1756
1796
|
expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledTimes(1);
|
|
@@ -1798,6 +1838,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1798
1838
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1799
1839
|
thresholdForAutoReject: 3,
|
|
1800
1840
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1841
|
+
allowedIssueAuthors: null,
|
|
1801
1842
|
});
|
|
1802
1843
|
|
|
1803
1844
|
expect(consoleWarnSpy).toHaveBeenCalledWith(
|
|
@@ -1880,6 +1921,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1880
1921
|
thresholdForAutoReject: 3,
|
|
1881
1922
|
workflowBlockerResolvedWebhookUrl:
|
|
1882
1923
|
'https://example.com/webhook?url={URL}&msg={MESSAGE}',
|
|
1924
|
+
allowedIssueAuthors: null,
|
|
1883
1925
|
});
|
|
1884
1926
|
|
|
1885
1927
|
expect(mockWebhookRepository.sendGetRequest).toHaveBeenCalledWith(
|
|
@@ -1919,6 +1961,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1919
1961
|
thresholdForAutoReject: 3,
|
|
1920
1962
|
workflowBlockerResolvedWebhookUrl:
|
|
1921
1963
|
'https://example.com/notify={MESSAGE}',
|
|
1964
|
+
allowedIssueAuthors: null,
|
|
1922
1965
|
});
|
|
1923
1966
|
|
|
1924
1967
|
expect(mockWebhookRepository.sendGetRequest).toHaveBeenCalledTimes(1);
|
|
@@ -1959,6 +2002,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1959
2002
|
thresholdForAutoReject: 3,
|
|
1960
2003
|
workflowBlockerResolvedWebhookUrl:
|
|
1961
2004
|
'https://example.com/webhook?msg={MESSAGE}',
|
|
2005
|
+
allowedIssueAuthors: null,
|
|
1962
2006
|
});
|
|
1963
2007
|
|
|
1964
2008
|
expect(mockWebhookRepository.sendGetRequest).not.toHaveBeenCalled();
|
|
@@ -1992,6 +2036,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1992
2036
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1993
2037
|
thresholdForAutoReject: 3,
|
|
1994
2038
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2039
|
+
allowedIssueAuthors: null,
|
|
1995
2040
|
});
|
|
1996
2041
|
|
|
1997
2042
|
expect(mockWebhookRepository.sendGetRequest).not.toHaveBeenCalled();
|
|
@@ -2036,6 +2081,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2036
2081
|
thresholdForAutoReject: 3,
|
|
2037
2082
|
workflowBlockerResolvedWebhookUrl:
|
|
2038
2083
|
'https://example.com/webhook?msg={MESSAGE}',
|
|
2084
|
+
allowedIssueAuthors: null,
|
|
2039
2085
|
});
|
|
2040
2086
|
|
|
2041
2087
|
expect(consoleWarnSpy).toHaveBeenCalledWith(
|
|
@@ -2086,6 +2132,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2086
2132
|
thresholdForAutoReject: 3,
|
|
2087
2133
|
workflowBlockerResolvedWebhookUrl:
|
|
2088
2134
|
'https://example.com/runTasker/notify=:={MESSAGE}',
|
|
2135
|
+
allowedIssueAuthors: null,
|
|
2089
2136
|
});
|
|
2090
2137
|
|
|
2091
2138
|
expect(mockWebhookRepository.sendGetRequest).toHaveBeenCalledTimes(1);
|
|
@@ -2137,6 +2184,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2137
2184
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2138
2185
|
thresholdForAutoReject: 3,
|
|
2139
2186
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2187
|
+
allowedIssueAuthors: null,
|
|
2140
2188
|
});
|
|
2141
2189
|
|
|
2142
2190
|
expect(consoleWarnSpy).toHaveBeenCalledWith(
|
|
@@ -2170,6 +2218,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2170
2218
|
issueUrl: 'https://github.com/user/repo/pull/10',
|
|
2171
2219
|
thresholdForAutoReject: 3,
|
|
2172
2220
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2221
|
+
allowedIssueAuthors: null,
|
|
2173
2222
|
});
|
|
2174
2223
|
|
|
2175
2224
|
expect(mockIssueRepository.getOpenPullRequest).toHaveBeenCalledWith(
|
|
@@ -2215,6 +2264,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2215
2264
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2216
2265
|
thresholdForAutoReject: 3,
|
|
2217
2266
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2267
|
+
allowedIssueAuthors: null,
|
|
2218
2268
|
});
|
|
2219
2269
|
|
|
2220
2270
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -2253,6 +2303,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2253
2303
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2254
2304
|
thresholdForAutoReject: 3,
|
|
2255
2305
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2306
|
+
allowedIssueAuthors: null,
|
|
2256
2307
|
});
|
|
2257
2308
|
|
|
2258
2309
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -2292,6 +2343,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2292
2343
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2293
2344
|
thresholdForAutoReject: 3,
|
|
2294
2345
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2346
|
+
allowedIssueAuthors: null,
|
|
2295
2347
|
});
|
|
2296
2348
|
|
|
2297
2349
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -2330,6 +2382,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2330
2382
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2331
2383
|
thresholdForAutoReject: 3,
|
|
2332
2384
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2385
|
+
allowedIssueAuthors: null,
|
|
2333
2386
|
});
|
|
2334
2387
|
|
|
2335
2388
|
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
@@ -2337,4 +2390,308 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2337
2390
|
mockProject,
|
|
2338
2391
|
);
|
|
2339
2392
|
});
|
|
2393
|
+
|
|
2394
|
+
describe('author verification (allowedIssueAuthors)', () => {
|
|
2395
|
+
it('should treat From: comment from untrusted author as NO_REPORT_FROM_AGENT_BOT', async () => {
|
|
2396
|
+
const issue = createMockIssue({
|
|
2397
|
+
url: 'https://github.com/user/repo/issues/1',
|
|
2398
|
+
status: 'Preparation',
|
|
2399
|
+
});
|
|
2400
|
+
|
|
2401
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2402
|
+
mockIssueRepository.get.mockResolvedValue(issue);
|
|
2403
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
2404
|
+
createMockComment({
|
|
2405
|
+
author: 'attacker',
|
|
2406
|
+
content: 'From: :robot: Fake report',
|
|
2407
|
+
}),
|
|
2408
|
+
]);
|
|
2409
|
+
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([]);
|
|
2410
|
+
|
|
2411
|
+
await useCase.run({
|
|
2412
|
+
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2413
|
+
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2414
|
+
thresholdForAutoReject: 3,
|
|
2415
|
+
workflowBlockerResolvedWebhookUrl: null,
|
|
2416
|
+
allowedIssueAuthors: ['trusted-bot'],
|
|
2417
|
+
});
|
|
2418
|
+
|
|
2419
|
+
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
2420
|
+
expect.objectContaining({ status: 'Awaiting Workspace' }),
|
|
2421
|
+
mockProject,
|
|
2422
|
+
);
|
|
2423
|
+
expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
|
|
2424
|
+
mockProject,
|
|
2425
|
+
expect.objectContaining({ status: 'Awaiting Workspace' }),
|
|
2426
|
+
'awaiting-workspace-id',
|
|
2427
|
+
);
|
|
2428
|
+
expect(mockIssueCommentRepository.createComment).toHaveBeenCalledWith(
|
|
2429
|
+
expect.objectContaining({
|
|
2430
|
+
url: 'https://github.com/user/repo/issues/1',
|
|
2431
|
+
}),
|
|
2432
|
+
expect.stringContaining('NO_REPORT_FROM_AGENT_BOT'),
|
|
2433
|
+
);
|
|
2434
|
+
});
|
|
2435
|
+
|
|
2436
|
+
it('should accept From: comment from trusted author and route to Awaiting Quality Check', async () => {
|
|
2437
|
+
const issue = createMockIssue({
|
|
2438
|
+
url: 'https://github.com/user/repo/issues/1',
|
|
2439
|
+
status: 'Preparation',
|
|
2440
|
+
});
|
|
2441
|
+
|
|
2442
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2443
|
+
mockIssueRepository.get.mockResolvedValue(issue);
|
|
2444
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
2445
|
+
createMockComment({
|
|
2446
|
+
author: 'trusted-bot',
|
|
2447
|
+
content: 'From: :robot: Real report',
|
|
2448
|
+
}),
|
|
2449
|
+
]);
|
|
2450
|
+
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
|
|
2451
|
+
{
|
|
2452
|
+
url: 'https://github.com/user/repo/pull/1',
|
|
2453
|
+
isConflicted: false,
|
|
2454
|
+
isPassedAllCiJob: true,
|
|
2455
|
+
isCiStateSuccess: true,
|
|
2456
|
+
isResolvedAllReviewComments: true,
|
|
2457
|
+
isBranchOutOfDate: false,
|
|
2458
|
+
missingRequiredCheckNames: [],
|
|
2459
|
+
},
|
|
2460
|
+
]);
|
|
2461
|
+
|
|
2462
|
+
await useCase.run({
|
|
2463
|
+
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2464
|
+
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2465
|
+
thresholdForAutoReject: 3,
|
|
2466
|
+
workflowBlockerResolvedWebhookUrl: null,
|
|
2467
|
+
allowedIssueAuthors: ['trusted-bot'],
|
|
2468
|
+
});
|
|
2469
|
+
|
|
2470
|
+
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
2471
|
+
expect.objectContaining({ status: 'Awaiting Quality Check' }),
|
|
2472
|
+
mockProject,
|
|
2473
|
+
);
|
|
2474
|
+
expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
|
|
2475
|
+
mockProject,
|
|
2476
|
+
expect.objectContaining({ status: 'Awaiting Quality Check' }),
|
|
2477
|
+
'awaiting-quality-check-id',
|
|
2478
|
+
);
|
|
2479
|
+
});
|
|
2480
|
+
|
|
2481
|
+
it('should not auto-escalate to Failed Preparation when REJECTED comments come from untrusted authors', async () => {
|
|
2482
|
+
const issue = createMockIssue({
|
|
2483
|
+
url: 'https://github.com/user/repo/issues/1',
|
|
2484
|
+
status: 'Preparation',
|
|
2485
|
+
});
|
|
2486
|
+
|
|
2487
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2488
|
+
mockIssueRepository.get.mockResolvedValue(issue);
|
|
2489
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
2490
|
+
createMockComment({
|
|
2491
|
+
author: 'attacker',
|
|
2492
|
+
content: 'Auto Status Check: REJECTED - first',
|
|
2493
|
+
}),
|
|
2494
|
+
createMockComment({
|
|
2495
|
+
author: 'attacker',
|
|
2496
|
+
content: 'Auto Status Check: REJECTED - second',
|
|
2497
|
+
}),
|
|
2498
|
+
createMockComment({
|
|
2499
|
+
author: 'attacker',
|
|
2500
|
+
content: 'Auto Status Check: REJECTED - third',
|
|
2501
|
+
}),
|
|
2502
|
+
]);
|
|
2503
|
+
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([]);
|
|
2504
|
+
|
|
2505
|
+
await useCase.run({
|
|
2506
|
+
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2507
|
+
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2508
|
+
thresholdForAutoReject: 3,
|
|
2509
|
+
workflowBlockerResolvedWebhookUrl: null,
|
|
2510
|
+
allowedIssueAuthors: ['trusted-bot'],
|
|
2511
|
+
});
|
|
2512
|
+
|
|
2513
|
+
expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
|
|
2514
|
+
expect.objectContaining({ status: 'Failed Preparation' }),
|
|
2515
|
+
mockProject,
|
|
2516
|
+
);
|
|
2517
|
+
expect(mockIssueRepository.updateStatus).not.toHaveBeenCalledWith(
|
|
2518
|
+
mockProject,
|
|
2519
|
+
expect.anything(),
|
|
2520
|
+
'failed-preparation-id',
|
|
2521
|
+
);
|
|
2522
|
+
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
2523
|
+
expect.objectContaining({ status: 'Awaiting Workspace' }),
|
|
2524
|
+
mockProject,
|
|
2525
|
+
);
|
|
2526
|
+
});
|
|
2527
|
+
|
|
2528
|
+
it('should auto-escalate to Failed Preparation when REJECTED comments come from trusted authors', async () => {
|
|
2529
|
+
const issue = createMockIssue({
|
|
2530
|
+
url: 'https://github.com/user/repo/issues/1',
|
|
2531
|
+
status: 'Preparation',
|
|
2532
|
+
});
|
|
2533
|
+
|
|
2534
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2535
|
+
mockIssueRepository.get.mockResolvedValue(issue);
|
|
2536
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
2537
|
+
createMockComment({
|
|
2538
|
+
author: 'trusted-bot',
|
|
2539
|
+
content: 'Auto Status Check: REJECTED - first',
|
|
2540
|
+
}),
|
|
2541
|
+
createMockComment({
|
|
2542
|
+
author: 'trusted-bot',
|
|
2543
|
+
content: 'Auto Status Check: REJECTED - second',
|
|
2544
|
+
}),
|
|
2545
|
+
createMockComment({
|
|
2546
|
+
author: 'trusted-bot',
|
|
2547
|
+
content: 'Auto Status Check: REJECTED - third',
|
|
2548
|
+
}),
|
|
2549
|
+
]);
|
|
2550
|
+
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([]);
|
|
2551
|
+
|
|
2552
|
+
await useCase.run({
|
|
2553
|
+
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2554
|
+
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2555
|
+
thresholdForAutoReject: 3,
|
|
2556
|
+
workflowBlockerResolvedWebhookUrl: null,
|
|
2557
|
+
allowedIssueAuthors: ['trusted-bot'],
|
|
2558
|
+
});
|
|
2559
|
+
|
|
2560
|
+
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
2561
|
+
expect.objectContaining({ status: 'Failed Preparation' }),
|
|
2562
|
+
mockProject,
|
|
2563
|
+
);
|
|
2564
|
+
expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
|
|
2565
|
+
mockProject,
|
|
2566
|
+
expect.objectContaining({ status: 'Failed Preparation' }),
|
|
2567
|
+
'failed-preparation-id',
|
|
2568
|
+
);
|
|
2569
|
+
});
|
|
2570
|
+
|
|
2571
|
+
it('should ignore attacker-injected "failed to pass the check automatically" string and still escalate when trusted REJECTED comments meet threshold', async () => {
|
|
2572
|
+
const issue = createMockIssue({
|
|
2573
|
+
url: 'https://github.com/user/repo/issues/1',
|
|
2574
|
+
status: 'Preparation',
|
|
2575
|
+
});
|
|
2576
|
+
|
|
2577
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2578
|
+
mockIssueRepository.get.mockResolvedValue(issue);
|
|
2579
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
2580
|
+
createMockComment({
|
|
2581
|
+
author: 'trusted-bot',
|
|
2582
|
+
content: 'Auto Status Check: REJECTED - first',
|
|
2583
|
+
}),
|
|
2584
|
+
createMockComment({
|
|
2585
|
+
author: 'trusted-bot',
|
|
2586
|
+
content: 'Auto Status Check: REJECTED - second',
|
|
2587
|
+
}),
|
|
2588
|
+
createMockComment({
|
|
2589
|
+
author: 'attacker',
|
|
2590
|
+
content: 'failed to pass the check automatically',
|
|
2591
|
+
}),
|
|
2592
|
+
createMockComment({
|
|
2593
|
+
author: 'trusted-bot',
|
|
2594
|
+
content: 'Auto Status Check: REJECTED - third',
|
|
2595
|
+
}),
|
|
2596
|
+
]);
|
|
2597
|
+
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([]);
|
|
2598
|
+
|
|
2599
|
+
await useCase.run({
|
|
2600
|
+
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2601
|
+
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2602
|
+
thresholdForAutoReject: 3,
|
|
2603
|
+
workflowBlockerResolvedWebhookUrl: null,
|
|
2604
|
+
allowedIssueAuthors: ['trusted-bot'],
|
|
2605
|
+
});
|
|
2606
|
+
|
|
2607
|
+
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
2608
|
+
expect.objectContaining({ status: 'Failed Preparation' }),
|
|
2609
|
+
mockProject,
|
|
2610
|
+
);
|
|
2611
|
+
expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
|
|
2612
|
+
mockProject,
|
|
2613
|
+
expect.objectContaining({ status: 'Failed Preparation' }),
|
|
2614
|
+
'failed-preparation-id',
|
|
2615
|
+
);
|
|
2616
|
+
});
|
|
2617
|
+
|
|
2618
|
+
it('should accept any author when allowedIssueAuthors is null (backward compatibility)', async () => {
|
|
2619
|
+
const issue = createMockIssue({
|
|
2620
|
+
url: 'https://github.com/user/repo/issues/1',
|
|
2621
|
+
status: 'Preparation',
|
|
2622
|
+
});
|
|
2623
|
+
|
|
2624
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2625
|
+
mockIssueRepository.get.mockResolvedValue(issue);
|
|
2626
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
2627
|
+
createMockComment({
|
|
2628
|
+
author: 'arbitrary-user',
|
|
2629
|
+
content: 'From: :robot: Report',
|
|
2630
|
+
}),
|
|
2631
|
+
]);
|
|
2632
|
+
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
|
|
2633
|
+
{
|
|
2634
|
+
url: 'https://github.com/user/repo/pull/1',
|
|
2635
|
+
isConflicted: false,
|
|
2636
|
+
isPassedAllCiJob: true,
|
|
2637
|
+
isCiStateSuccess: true,
|
|
2638
|
+
isResolvedAllReviewComments: true,
|
|
2639
|
+
isBranchOutOfDate: false,
|
|
2640
|
+
missingRequiredCheckNames: [],
|
|
2641
|
+
},
|
|
2642
|
+
]);
|
|
2643
|
+
|
|
2644
|
+
await useCase.run({
|
|
2645
|
+
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2646
|
+
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2647
|
+
thresholdForAutoReject: 3,
|
|
2648
|
+
workflowBlockerResolvedWebhookUrl: null,
|
|
2649
|
+
allowedIssueAuthors: null,
|
|
2650
|
+
});
|
|
2651
|
+
|
|
2652
|
+
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
2653
|
+
expect.objectContaining({ status: 'Awaiting Quality Check' }),
|
|
2654
|
+
mockProject,
|
|
2655
|
+
);
|
|
2656
|
+
});
|
|
2657
|
+
|
|
2658
|
+
it('should accept any author when allowedIssueAuthors is omitted (backward compatibility)', async () => {
|
|
2659
|
+
const issue = createMockIssue({
|
|
2660
|
+
url: 'https://github.com/user/repo/issues/1',
|
|
2661
|
+
status: 'Preparation',
|
|
2662
|
+
});
|
|
2663
|
+
|
|
2664
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2665
|
+
mockIssueRepository.get.mockResolvedValue(issue);
|
|
2666
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
2667
|
+
createMockComment({
|
|
2668
|
+
author: 'arbitrary-user',
|
|
2669
|
+
content: 'From: :robot: Report',
|
|
2670
|
+
}),
|
|
2671
|
+
]);
|
|
2672
|
+
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
|
|
2673
|
+
{
|
|
2674
|
+
url: 'https://github.com/user/repo/pull/1',
|
|
2675
|
+
isConflicted: false,
|
|
2676
|
+
isPassedAllCiJob: true,
|
|
2677
|
+
isCiStateSuccess: true,
|
|
2678
|
+
isResolvedAllReviewComments: true,
|
|
2679
|
+
isBranchOutOfDate: false,
|
|
2680
|
+
missingRequiredCheckNames: [],
|
|
2681
|
+
},
|
|
2682
|
+
]);
|
|
2683
|
+
|
|
2684
|
+
await useCase.run({
|
|
2685
|
+
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2686
|
+
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2687
|
+
thresholdForAutoReject: 3,
|
|
2688
|
+
workflowBlockerResolvedWebhookUrl: null,
|
|
2689
|
+
});
|
|
2690
|
+
|
|
2691
|
+
expect(mockIssueRepository.update).toHaveBeenCalledWith(
|
|
2692
|
+
expect.objectContaining({ status: 'Awaiting Quality Check' }),
|
|
2693
|
+
mockProject,
|
|
2694
|
+
);
|
|
2695
|
+
});
|
|
2696
|
+
});
|
|
2340
2697
|
});
|