github-issue-tower-defence-management 1.197.1 → 2.0.0

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 (24) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +21 -1
  3. package/bin/adapter/entry-points/console/webServer.js +5 -0
  4. package/bin/adapter/entry-points/console/webServer.js.map +1 -1
  5. package/bin/domain/usecases/CheckIssueReviewReadinessUseCase.js +2 -2
  6. package/bin/domain/usecases/CheckIssueReviewReadinessUseCase.js.map +1 -1
  7. package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js +12 -2
  8. package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
  9. package/bin/domain/usecases/StartPreparationUseCase.js +2 -3
  10. package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/adapter/entry-points/console/webServer.test.ts +68 -7
  13. package/src/adapter/entry-points/console/webServer.ts +9 -0
  14. package/src/domain/usecases/CheckIssueReviewReadinessUseCase.test.ts +38 -6
  15. package/src/domain/usecases/CheckIssueReviewReadinessUseCase.ts +2 -7
  16. package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.test.ts +315 -143
  17. package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.ts +21 -7
  18. package/src/domain/usecases/StartPreparationUseCase.ts +2 -3
  19. package/types/adapter/entry-points/console/webServer.d.ts.map +1 -1
  20. package/types/domain/usecases/CheckIssueReviewReadinessUseCase.d.ts +0 -1
  21. package/types/domain/usecases/CheckIssueReviewReadinessUseCase.d.ts.map +1 -1
  22. package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts +0 -1
  23. package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
  24. package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
@@ -211,7 +211,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
211
211
  issueUrl: 'https://github.com/user/repo/issues/1',
212
212
  thresholdForAutoReject: 3,
213
213
  workflowBlockerResolvedWebhookUrl: null,
214
- allowedIssueAuthors: null,
214
+ allowedIssueAuthors: ['test-user'],
215
215
  });
216
216
 
217
217
  expect(mockIssueRepository.update).toHaveBeenCalledTimes(1);
@@ -267,7 +267,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
267
267
  issueUrl: 'https://github.com/user/repo/issues/1',
268
268
  thresholdForAutoReject: 3,
269
269
  workflowBlockerResolvedWebhookUrl: null,
270
- allowedIssueAuthors: null,
270
+ allowedIssueAuthors: ['test-user'],
271
271
  });
272
272
 
273
273
  expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledWith(
@@ -287,7 +287,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
287
287
  issueUrl: 'https://github.com/user/repo/issues/999',
288
288
  thresholdForAutoReject: 3,
289
289
  workflowBlockerResolvedWebhookUrl: null,
290
- allowedIssueAuthors: null,
290
+ allowedIssueAuthors: ['test-user'],
291
291
  }),
292
292
  ).rejects.toThrow(
293
293
  'Issue not found: https://github.com/user/repo/issues/999',
@@ -304,7 +304,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
304
304
  issueUrl: 'https://github.com/user/repo/pull/999',
305
305
  thresholdForAutoReject: 3,
306
306
  workflowBlockerResolvedWebhookUrl: null,
307
- allowedIssueAuthors: null,
307
+ allowedIssueAuthors: ['test-user'],
308
308
  }),
309
309
  ).rejects.toThrow('Issue not found: https://github.com/user/repo/pull/999');
310
310
  expect(mockIssueRepository.update).not.toHaveBeenCalled();
@@ -328,7 +328,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
328
328
  issueUrl: issueUrlOnAnotherProjectOnly,
329
329
  thresholdForAutoReject: 3,
330
330
  workflowBlockerResolvedWebhookUrl: null,
331
- allowedIssueAuthors: null,
331
+ allowedIssueAuthors: ['test-user'],
332
332
  }),
333
333
  ).rejects.toThrow(`Issue not found: ${issueUrlOnAnotherProjectOnly}`);
334
334
  expect(mockIssueRepository.get.mock.calls).toEqual([
@@ -367,7 +367,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
367
367
  issueUrl: 'https://github.com/user/repo/pull/77',
368
368
  thresholdForAutoReject: 3,
369
369
  workflowBlockerResolvedWebhookUrl: null,
370
- allowedIssueAuthors: null,
370
+ allowedIssueAuthors: ['test-user'],
371
371
  });
372
372
 
373
373
  expect(mockIssueRepository.get).toHaveBeenCalledWith(
@@ -406,7 +406,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
406
406
  issueUrl: 'https://github.com/user/repo/issues/1',
407
407
  thresholdForAutoReject: 3,
408
408
  workflowBlockerResolvedWebhookUrl: null,
409
- allowedIssueAuthors: null,
409
+ allowedIssueAuthors: ['test-user'],
410
410
  }),
411
411
  ).rejects.toThrow(
412
412
  'Illegal issue status for https://github.com/user/repo/issues/1: expected Preparation, but got Done',
@@ -431,7 +431,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
431
431
  issueUrl: 'https://github.com/user/repo/issues/1',
432
432
  thresholdForAutoReject: 3,
433
433
  workflowBlockerResolvedWebhookUrl: null,
434
- allowedIssueAuthors: null,
434
+ allowedIssueAuthors: ['test-user'],
435
435
  });
436
436
 
437
437
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -484,7 +484,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
484
484
  issueUrl: 'https://github.com/user/repo/issues/1',
485
485
  thresholdForAutoReject: 3,
486
486
  workflowBlockerResolvedWebhookUrl: null,
487
- allowedIssueAuthors: null,
487
+ allowedIssueAuthors: ['test-user'],
488
488
  });
489
489
 
490
490
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -513,7 +513,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
513
513
  issueUrl: 'https://github.com/user/repo/issues/1',
514
514
  thresholdForAutoReject: 3,
515
515
  workflowBlockerResolvedWebhookUrl: null,
516
- allowedIssueAuthors: null,
516
+ allowedIssueAuthors: ['test-user'],
517
517
  });
518
518
 
519
519
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -547,7 +547,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
547
547
  issueUrl: 'https://github.com/user/repo/issues/1',
548
548
  thresholdForAutoReject: 3,
549
549
  workflowBlockerResolvedWebhookUrl: null,
550
- allowedIssueAuthors: null,
550
+ allowedIssueAuthors: ['test-user'],
551
551
  });
552
552
 
553
553
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -595,7 +595,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
595
595
  issueUrl: 'https://github.com/user/repo/issues/1',
596
596
  thresholdForAutoReject: 3,
597
597
  workflowBlockerResolvedWebhookUrl: null,
598
- allowedIssueAuthors: null,
598
+ allowedIssueAuthors: ['test-user'],
599
599
  });
600
600
 
601
601
  expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
@@ -640,7 +640,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
640
640
  issueUrl: 'https://github.com/user/repo/issues/1',
641
641
  thresholdForAutoReject: 3,
642
642
  workflowBlockerResolvedWebhookUrl: null,
643
- allowedIssueAuthors: null,
643
+ allowedIssueAuthors: ['test-user'],
644
644
  });
645
645
 
646
646
  expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
@@ -685,7 +685,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
685
685
  issueUrl: 'https://github.com/user/repo/issues/1',
686
686
  thresholdForAutoReject: 3,
687
687
  workflowBlockerResolvedWebhookUrl: null,
688
- allowedIssueAuthors: null,
688
+ allowedIssueAuthors: ['test-user'],
689
689
  });
690
690
 
691
691
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -735,7 +735,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
735
735
  issueUrl: 'https://github.com/user/repo/issues/1',
736
736
  thresholdForAutoReject: 3,
737
737
  workflowBlockerResolvedWebhookUrl: null,
738
- allowedIssueAuthors: null,
738
+ allowedIssueAuthors: ['test-user'],
739
739
  });
740
740
 
741
741
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -783,7 +783,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
783
783
  issueUrl: 'https://github.com/user/repo/issues/1',
784
784
  thresholdForAutoReject: 3,
785
785
  workflowBlockerResolvedWebhookUrl: null,
786
- allowedIssueAuthors: null,
786
+ allowedIssueAuthors: ['test-user'],
787
787
  });
788
788
 
789
789
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -826,7 +826,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
826
826
  issueUrl: 'https://github.com/user/repo/issues/1',
827
827
  thresholdForAutoReject: 3,
828
828
  workflowBlockerResolvedWebhookUrl: null,
829
- allowedIssueAuthors: null,
829
+ allowedIssueAuthors: ['test-user'],
830
830
  });
831
831
 
832
832
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -869,7 +869,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
869
869
  issueUrl: 'https://github.com/user/repo/issues/1',
870
870
  thresholdForAutoReject: 3,
871
871
  workflowBlockerResolvedWebhookUrl: null,
872
- allowedIssueAuthors: null,
872
+ allowedIssueAuthors: ['test-user'],
873
873
  });
874
874
 
875
875
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -912,7 +912,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
912
912
  issueUrl: 'https://github.com/user/repo/issues/1',
913
913
  thresholdForAutoReject: 3,
914
914
  workflowBlockerResolvedWebhookUrl: null,
915
- allowedIssueAuthors: null,
915
+ allowedIssueAuthors: ['test-user'],
916
916
  });
917
917
 
918
918
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -944,7 +944,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
944
944
  issueUrl: 'https://github.com/user/repo/issues/1',
945
945
  thresholdForAutoReject: 3,
946
946
  workflowBlockerResolvedWebhookUrl: null,
947
- allowedIssueAuthors: null,
947
+ allowedIssueAuthors: ['test-user'],
948
948
  });
949
949
 
950
950
  expect(mockIssueRepository.getOrCreateLabel).not.toHaveBeenCalled();
@@ -977,7 +977,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
977
977
  issueUrl: 'https://github.com/user/repo/issues/1',
978
978
  thresholdForAutoReject: 3,
979
979
  workflowBlockerResolvedWebhookUrl: null,
980
- allowedIssueAuthors: null,
980
+ allowedIssueAuthors: ['test-user'],
981
981
  });
982
982
 
983
983
  expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
@@ -1021,7 +1021,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1021
1021
  issueUrl: 'https://github.com/user/repo/issues/1',
1022
1022
  thresholdForAutoReject: 3,
1023
1023
  workflowBlockerResolvedWebhookUrl: null,
1024
- allowedIssueAuthors: null,
1024
+ allowedIssueAuthors: ['test-user'],
1025
1025
  });
1026
1026
 
1027
1027
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -1068,7 +1068,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1068
1068
  issueUrl: 'https://github.com/user/repo/issues/1',
1069
1069
  thresholdForAutoReject: 3,
1070
1070
  workflowBlockerResolvedWebhookUrl: null,
1071
- allowedIssueAuthors: null,
1071
+ allowedIssueAuthors: ['test-user'],
1072
1072
  });
1073
1073
 
1074
1074
  expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
@@ -1116,7 +1116,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1116
1116
  thresholdForAutoReject: 3,
1117
1117
  thresholdForDispatchLoop: 3,
1118
1118
  workflowBlockerResolvedWebhookUrl: null,
1119
- allowedIssueAuthors: null,
1119
+ allowedIssueAuthors: ['test-user'],
1120
1120
  });
1121
1121
 
1122
1122
  expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
@@ -1164,7 +1164,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1164
1164
  thresholdForAutoReject: 3,
1165
1165
  thresholdForDispatchLoop: 3,
1166
1166
  workflowBlockerResolvedWebhookUrl: null,
1167
- allowedIssueAuthors: null,
1167
+ allowedIssueAuthors: ['test-user'],
1168
1168
  });
1169
1169
 
1170
1170
  expect(mockIssueRepository.updateStatus).not.toHaveBeenCalledWith(
@@ -1206,7 +1206,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1206
1206
  issueUrl: 'https://github.com/user/repo/issues/1',
1207
1207
  thresholdForAutoReject: 3,
1208
1208
  workflowBlockerResolvedWebhookUrl: null,
1209
- allowedIssueAuthors: null,
1209
+ allowedIssueAuthors: ['test-user'],
1210
1210
  });
1211
1211
 
1212
1212
  expect(mockIssueRepository.getOrCreateLabel).not.toHaveBeenCalled();
@@ -1244,7 +1244,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1244
1244
  issueUrl: 'https://github.com/user/repo/issues/1',
1245
1245
  thresholdForAutoReject: 3,
1246
1246
  workflowBlockerResolvedWebhookUrl: null,
1247
- allowedIssueAuthors: null,
1247
+ allowedIssueAuthors: ['test-user'],
1248
1248
  });
1249
1249
 
1250
1250
  expect(mockIssueRepository.getOrCreateLabel).not.toHaveBeenCalled();
@@ -1278,7 +1278,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1278
1278
  issueUrl: 'https://github.com/user/repo/issues/1',
1279
1279
  thresholdForAutoReject: 3,
1280
1280
  workflowBlockerResolvedWebhookUrl: null,
1281
- allowedIssueAuthors: null,
1281
+ allowedIssueAuthors: ['test-user'],
1282
1282
  });
1283
1283
 
1284
1284
  expect(mockIssueRepository.getOrCreateLabel).not.toHaveBeenCalled();
@@ -1307,7 +1307,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1307
1307
  issueUrl: 'https://github.com/user/repo/issues/1',
1308
1308
  thresholdForAutoReject: 3,
1309
1309
  workflowBlockerResolvedWebhookUrl: null,
1310
- allowedIssueAuthors: null,
1310
+ allowedIssueAuthors: ['test-user'],
1311
1311
  labelsAsLlmAgentName: ['chore', 'accounting'],
1312
1312
  });
1313
1313
 
@@ -1346,7 +1346,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1346
1346
  issueUrl: 'https://github.com/user/repo/issues/1',
1347
1347
  thresholdForAutoReject: 3,
1348
1348
  workflowBlockerResolvedWebhookUrl: null,
1349
- allowedIssueAuthors: null,
1349
+ allowedIssueAuthors: ['test-user'],
1350
1350
  });
1351
1351
 
1352
1352
  expect(mockIssueRepository.getOrCreateLabel).not.toHaveBeenCalled();
@@ -1377,7 +1377,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1377
1377
  issueUrl: 'https://github.com/user/repo/issues/1',
1378
1378
  thresholdForAutoReject: 3,
1379
1379
  workflowBlockerResolvedWebhookUrl: null,
1380
- allowedIssueAuthors: null,
1380
+ allowedIssueAuthors: ['test-user'],
1381
1381
  });
1382
1382
 
1383
1383
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -1439,7 +1439,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1439
1439
  issueUrl: 'https://github.com/user/repo/issues/1',
1440
1440
  thresholdForAutoReject: 3,
1441
1441
  workflowBlockerResolvedWebhookUrl: null,
1442
- allowedIssueAuthors: null,
1442
+ allowedIssueAuthors: ['test-user'],
1443
1443
  });
1444
1444
 
1445
1445
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -1492,7 +1492,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1492
1492
  issueUrl: 'https://github.com/user/repo/issues/1',
1493
1493
  thresholdForAutoReject: 3,
1494
1494
  workflowBlockerResolvedWebhookUrl: null,
1495
- allowedIssueAuthors: null,
1495
+ allowedIssueAuthors: ['test-user'],
1496
1496
  });
1497
1497
 
1498
1498
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -1537,7 +1537,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1537
1537
  issueUrl: 'https://github.com/user/repo/issues/1',
1538
1538
  thresholdForAutoReject: 3,
1539
1539
  workflowBlockerResolvedWebhookUrl: null,
1540
- allowedIssueAuthors: null,
1540
+ allowedIssueAuthors: ['test-user'],
1541
1541
  });
1542
1542
 
1543
1543
  expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
@@ -1584,7 +1584,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1584
1584
  issueUrl: 'https://github.com/user/repo/issues/1',
1585
1585
  thresholdForAutoReject: 3,
1586
1586
  workflowBlockerResolvedWebhookUrl: null,
1587
- allowedIssueAuthors: null,
1587
+ allowedIssueAuthors: ['test-user'],
1588
1588
  });
1589
1589
 
1590
1590
  expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
@@ -1629,7 +1629,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1629
1629
  issueUrl: 'https://github.com/user/repo/issues/1',
1630
1630
  thresholdForAutoReject: 3,
1631
1631
  workflowBlockerResolvedWebhookUrl: null,
1632
- allowedIssueAuthors: null,
1632
+ allowedIssueAuthors: ['test-user'],
1633
1633
  });
1634
1634
 
1635
1635
  expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
@@ -1656,7 +1656,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1656
1656
  issueUrl: 'https://github.com/user/repo/issues/1',
1657
1657
  thresholdForAutoReject: 3,
1658
1658
  workflowBlockerResolvedWebhookUrl: null,
1659
- allowedIssueAuthors: null,
1659
+ allowedIssueAuthors: ['test-user'],
1660
1660
  });
1661
1661
 
1662
1662
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -1694,7 +1694,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1694
1694
  issueUrl: 'https://github.com/user/repo/issues/1',
1695
1695
  thresholdForAutoReject: 3,
1696
1696
  workflowBlockerResolvedWebhookUrl: null,
1697
- allowedIssueAuthors: null,
1697
+ allowedIssueAuthors: ['test-user'],
1698
1698
  });
1699
1699
 
1700
1700
  expect(mockIssueCommentRepository.createComment).not.toHaveBeenCalledWith(
@@ -1730,7 +1730,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1730
1730
  issueUrl: 'https://github.com/user/repo/issues/1',
1731
1731
  thresholdForAutoReject: 3,
1732
1732
  workflowBlockerResolvedWebhookUrl: null,
1733
- allowedIssueAuthors: null,
1733
+ allowedIssueAuthors: ['test-user'],
1734
1734
  });
1735
1735
 
1736
1736
  expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
@@ -1771,7 +1771,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1771
1771
  issueUrl: 'https://github.com/user/repo/issues/1',
1772
1772
  thresholdForAutoReject: 3,
1773
1773
  workflowBlockerResolvedWebhookUrl: null,
1774
- allowedIssueAuthors: null,
1774
+ allowedIssueAuthors: ['test-user'],
1775
1775
  });
1776
1776
 
1777
1777
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -1817,7 +1817,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1817
1817
  issueUrl: 'https://github.com/user/repo/issues/1',
1818
1818
  thresholdForAutoReject: 3,
1819
1819
  workflowBlockerResolvedWebhookUrl: null,
1820
- allowedIssueAuthors: null,
1820
+ allowedIssueAuthors: ['test-user'],
1821
1821
  });
1822
1822
 
1823
1823
  expect(mockIssueRepository.setIssueAgentField).not.toHaveBeenCalled();
@@ -1898,7 +1898,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1898
1898
  issueUrl: 'https://github.com/user/repo/issues/1',
1899
1899
  thresholdForAutoReject: 3,
1900
1900
  workflowBlockerResolvedWebhookUrl: null,
1901
- allowedIssueAuthors: null,
1901
+ allowedIssueAuthors: ['test-user'],
1902
1902
  });
1903
1903
 
1904
1904
  expect(mockIssueCommentRepository.createComment).toHaveBeenCalledWith(
@@ -1928,7 +1928,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1928
1928
  issueUrl: 'https://github.com/user/repo/issues/1',
1929
1929
  thresholdForAutoReject: 3,
1930
1930
  workflowBlockerResolvedWebhookUrl: null,
1931
- allowedIssueAuthors: null,
1931
+ allowedIssueAuthors: ['test-user'],
1932
1932
  labelsAsLlmAgentName: ['chore', 'accounting'],
1933
1933
  labelsNotRequiringPullRequest: ['story'],
1934
1934
  });
@@ -1958,7 +1958,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
1958
1958
  issueUrl: 'https://github.com/user/repo/issues/1',
1959
1959
  thresholdForAutoReject: 3,
1960
1960
  workflowBlockerResolvedWebhookUrl: null,
1961
- allowedIssueAuthors: null,
1961
+ allowedIssueAuthors: ['test-user'],
1962
1962
  developerAgentName: 'my-agent',
1963
1963
  });
1964
1964
 
@@ -2007,7 +2007,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2007
2007
  issueUrl: 'https://github.com/user/repo/issues/1',
2008
2008
  thresholdForAutoReject: 3,
2009
2009
  workflowBlockerResolvedWebhookUrl: null,
2010
- allowedIssueAuthors: null,
2010
+ allowedIssueAuthors: ['test-user'],
2011
2011
  });
2012
2012
 
2013
2013
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2052,7 +2052,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2052
2052
  issueUrl: 'https://github.com/user/repo/issues/1',
2053
2053
  thresholdForAutoReject: 3,
2054
2054
  workflowBlockerResolvedWebhookUrl: null,
2055
- allowedIssueAuthors: null,
2055
+ allowedIssueAuthors: ['test-user'],
2056
2056
  });
2057
2057
 
2058
2058
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2097,7 +2097,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2097
2097
  issueUrl: 'https://github.com/user/repo/issues/1',
2098
2098
  thresholdForAutoReject: 3,
2099
2099
  workflowBlockerResolvedWebhookUrl: null,
2100
- allowedIssueAuthors: null,
2100
+ allowedIssueAuthors: ['test-user'],
2101
2101
  });
2102
2102
 
2103
2103
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2142,7 +2142,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2142
2142
  issueUrl: 'https://github.com/user/repo/issues/1',
2143
2143
  thresholdForAutoReject: 3,
2144
2144
  workflowBlockerResolvedWebhookUrl: null,
2145
- allowedIssueAuthors: null,
2145
+ allowedIssueAuthors: ['test-user'],
2146
2146
  });
2147
2147
 
2148
2148
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2193,7 +2193,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2193
2193
  issueUrl: 'https://github.com/user/repo/issues/1',
2194
2194
  thresholdForAutoReject: 3,
2195
2195
  workflowBlockerResolvedWebhookUrl: null,
2196
- allowedIssueAuthors: null,
2196
+ allowedIssueAuthors: ['test-user'],
2197
2197
  });
2198
2198
 
2199
2199
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2244,7 +2244,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2244
2244
  issueUrl: 'https://github.com/user/repo/issues/1',
2245
2245
  thresholdForAutoReject: 3,
2246
2246
  workflowBlockerResolvedWebhookUrl: null,
2247
- allowedIssueAuthors: null,
2247
+ allowedIssueAuthors: ['test-user'],
2248
2248
  });
2249
2249
 
2250
2250
  expect(mockIssueCommentRepository.createComment).toHaveBeenCalledWith(
@@ -2283,7 +2283,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2283
2283
  issueUrl: 'https://github.com/user/repo/issues/1',
2284
2284
  thresholdForAutoReject: 3,
2285
2285
  workflowBlockerResolvedWebhookUrl: null,
2286
- allowedIssueAuthors: null,
2286
+ allowedIssueAuthors: ['test-user'],
2287
2287
  });
2288
2288
 
2289
2289
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2329,7 +2329,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2329
2329
  issueUrl: 'https://github.com/user/repo/issues/1',
2330
2330
  thresholdForAutoReject: 3,
2331
2331
  workflowBlockerResolvedWebhookUrl: null,
2332
- allowedIssueAuthors: null,
2332
+ allowedIssueAuthors: ['test-user'],
2333
2333
  });
2334
2334
 
2335
2335
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2365,7 +2365,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2365
2365
  issueUrl: 'https://github.com/user/repo/issues/1',
2366
2366
  thresholdForAutoReject: 3,
2367
2367
  workflowBlockerResolvedWebhookUrl: null,
2368
- allowedIssueAuthors: null,
2368
+ allowedIssueAuthors: ['test-user'],
2369
2369
  });
2370
2370
 
2371
2371
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2405,7 +2405,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2405
2405
  issueUrl: 'https://github.com/user/repo/issues/1',
2406
2406
  thresholdForAutoReject: 3,
2407
2407
  workflowBlockerResolvedWebhookUrl: null,
2408
- allowedIssueAuthors: null,
2408
+ allowedIssueAuthors: ['test-user'],
2409
2409
  });
2410
2410
 
2411
2411
  expect(mockIssueRepository.findRelatedOpenPRs).toHaveBeenCalled();
@@ -2438,7 +2438,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2438
2438
  issueUrl: 'https://github.com/user/repo/issues/1',
2439
2439
  thresholdForAutoReject: 3,
2440
2440
  workflowBlockerResolvedWebhookUrl: null,
2441
- allowedIssueAuthors: null,
2441
+ allowedIssueAuthors: ['test-user'],
2442
2442
  });
2443
2443
 
2444
2444
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2475,7 +2475,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2475
2475
  issueUrl: 'https://github.com/user/repo/issues/1',
2476
2476
  thresholdForAutoReject: 3,
2477
2477
  workflowBlockerResolvedWebhookUrl: null,
2478
- allowedIssueAuthors: null,
2478
+ allowedIssueAuthors: ['test-user'],
2479
2479
  });
2480
2480
 
2481
2481
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2504,7 +2504,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2504
2504
  issueUrl: 'https://github.com/user/repo/issues/1',
2505
2505
  thresholdForAutoReject: 3,
2506
2506
  workflowBlockerResolvedWebhookUrl: null,
2507
- allowedIssueAuthors: null,
2507
+ allowedIssueAuthors: ['test-user'],
2508
2508
  });
2509
2509
 
2510
2510
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2534,7 +2534,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2534
2534
  issueUrl: 'https://github.com/user/repo/issues/1',
2535
2535
  thresholdForAutoReject: 3,
2536
2536
  workflowBlockerResolvedWebhookUrl: null,
2537
- allowedIssueAuthors: null,
2537
+ allowedIssueAuthors: ['test-user'],
2538
2538
  });
2539
2539
 
2540
2540
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -2574,7 +2574,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2574
2574
  issueUrl: 'https://github.com/user/repo/pull/10',
2575
2575
  thresholdForAutoReject: 3,
2576
2576
  workflowBlockerResolvedWebhookUrl: null,
2577
- allowedIssueAuthors: null,
2577
+ allowedIssueAuthors: ['test-user'],
2578
2578
  });
2579
2579
 
2580
2580
  expect(mockIssueRepository.getOpenPullRequest).toHaveBeenCalledWith(
@@ -2617,7 +2617,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2617
2617
  issueUrl: 'https://github.com/user/repo/issues/1',
2618
2618
  thresholdForAutoReject: 3,
2619
2619
  workflowBlockerResolvedWebhookUrl: null,
2620
- allowedIssueAuthors: null,
2620
+ allowedIssueAuthors: ['test-user'],
2621
2621
  });
2622
2622
 
2623
2623
  expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledWith(
@@ -2656,7 +2656,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2656
2656
  issueUrl: 'https://github.com/user/repo/issues/1',
2657
2657
  thresholdForAutoReject: 3,
2658
2658
  workflowBlockerResolvedWebhookUrl: null,
2659
- allowedIssueAuthors: null,
2659
+ allowedIssueAuthors: ['test-user'],
2660
2660
  });
2661
2661
 
2662
2662
  expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledWith(
@@ -2705,7 +2705,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2705
2705
  issueUrl: 'https://github.com/user/repo/issues/1',
2706
2706
  thresholdForAutoReject: 3,
2707
2707
  workflowBlockerResolvedWebhookUrl: null,
2708
- allowedIssueAuthors: null,
2708
+ allowedIssueAuthors: ['test-user'],
2709
2709
  });
2710
2710
 
2711
2711
  expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledWith(
@@ -2751,7 +2751,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2751
2751
  issueUrl: 'https://github.com/user/repo/issues/1',
2752
2752
  thresholdForAutoReject: 3,
2753
2753
  workflowBlockerResolvedWebhookUrl: null,
2754
- allowedIssueAuthors: null,
2754
+ allowedIssueAuthors: ['test-user'],
2755
2755
  });
2756
2756
 
2757
2757
  expect(mockIssueRepository.setDependedIssueUrl).toHaveBeenCalledTimes(1);
@@ -2790,7 +2790,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2790
2790
  issueUrl: prUrl,
2791
2791
  thresholdForAutoReject: 3,
2792
2792
  workflowBlockerResolvedWebhookUrl: null,
2793
- allowedIssueAuthors: null,
2793
+ allowedIssueAuthors: ['test-user'],
2794
2794
  });
2795
2795
 
2796
2796
  expect(mockIssueRepository.setDependedIssueUrl).not.toHaveBeenCalled();
@@ -2833,7 +2833,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2833
2833
  issueUrl: 'https://github.com/user/repo/issues/1',
2834
2834
  thresholdForAutoReject: 3,
2835
2835
  workflowBlockerResolvedWebhookUrl: null,
2836
- allowedIssueAuthors: null,
2836
+ allowedIssueAuthors: ['test-user'],
2837
2837
  });
2838
2838
 
2839
2839
  expect(consoleWarnSpy).toHaveBeenCalledWith(
@@ -2916,7 +2916,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2916
2916
  thresholdForAutoReject: 3,
2917
2917
  workflowBlockerResolvedWebhookUrl:
2918
2918
  'https://example.com/webhook?url={URL}&msg={MESSAGE}',
2919
- allowedIssueAuthors: null,
2919
+ allowedIssueAuthors: ['test-user'],
2920
2920
  });
2921
2921
 
2922
2922
  expect(mockWebhookRepository.sendGetRequest).toHaveBeenCalledWith(
@@ -2956,7 +2956,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2956
2956
  thresholdForAutoReject: 3,
2957
2957
  workflowBlockerResolvedWebhookUrl:
2958
2958
  'https://example.com/notify={MESSAGE}',
2959
- allowedIssueAuthors: null,
2959
+ allowedIssueAuthors: ['test-user'],
2960
2960
  });
2961
2961
 
2962
2962
  expect(mockWebhookRepository.sendGetRequest).toHaveBeenCalledTimes(1);
@@ -2997,7 +2997,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
2997
2997
  thresholdForAutoReject: 3,
2998
2998
  workflowBlockerResolvedWebhookUrl:
2999
2999
  'https://example.com/webhook?msg={MESSAGE}',
3000
- allowedIssueAuthors: null,
3000
+ allowedIssueAuthors: ['test-user'],
3001
3001
  });
3002
3002
 
3003
3003
  expect(mockWebhookRepository.sendGetRequest).not.toHaveBeenCalled();
@@ -3031,7 +3031,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3031
3031
  issueUrl: 'https://github.com/user/repo/issues/1',
3032
3032
  thresholdForAutoReject: 3,
3033
3033
  workflowBlockerResolvedWebhookUrl: null,
3034
- allowedIssueAuthors: null,
3034
+ allowedIssueAuthors: ['test-user'],
3035
3035
  });
3036
3036
 
3037
3037
  expect(mockWebhookRepository.sendGetRequest).not.toHaveBeenCalled();
@@ -3076,7 +3076,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3076
3076
  thresholdForAutoReject: 3,
3077
3077
  workflowBlockerResolvedWebhookUrl:
3078
3078
  'https://example.com/webhook?msg={MESSAGE}',
3079
- allowedIssueAuthors: null,
3079
+ allowedIssueAuthors: ['test-user'],
3080
3080
  });
3081
3081
 
3082
3082
  expect(consoleWarnSpy).toHaveBeenCalledWith(
@@ -3127,7 +3127,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3127
3127
  thresholdForAutoReject: 3,
3128
3128
  workflowBlockerResolvedWebhookUrl:
3129
3129
  'https://example.com/runTasker/notify=:={MESSAGE}',
3130
- allowedIssueAuthors: null,
3130
+ allowedIssueAuthors: ['test-user'],
3131
3131
  });
3132
3132
 
3133
3133
  expect(mockWebhookRepository.sendGetRequest).toHaveBeenCalledTimes(1);
@@ -3179,7 +3179,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3179
3179
  issueUrl: 'https://github.com/user/repo/issues/1',
3180
3180
  thresholdForAutoReject: 3,
3181
3181
  workflowBlockerResolvedWebhookUrl: null,
3182
- allowedIssueAuthors: null,
3182
+ allowedIssueAuthors: ['test-user'],
3183
3183
  });
3184
3184
 
3185
3185
  expect(consoleWarnSpy).toHaveBeenCalledWith(
@@ -3213,7 +3213,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3213
3213
  issueUrl: 'https://github.com/user/repo/pull/10',
3214
3214
  thresholdForAutoReject: 3,
3215
3215
  workflowBlockerResolvedWebhookUrl: null,
3216
- allowedIssueAuthors: null,
3216
+ allowedIssueAuthors: ['test-user'],
3217
3217
  });
3218
3218
 
3219
3219
  expect(mockIssueRepository.getOpenPullRequest).toHaveBeenCalledWith(
@@ -3259,7 +3259,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3259
3259
  issueUrl: 'https://github.com/user/repo/issues/1',
3260
3260
  thresholdForAutoReject: 3,
3261
3261
  workflowBlockerResolvedWebhookUrl: null,
3262
- allowedIssueAuthors: null,
3262
+ allowedIssueAuthors: ['test-user'],
3263
3263
  });
3264
3264
 
3265
3265
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -3298,7 +3298,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3298
3298
  issueUrl: 'https://github.com/user/repo/issues/1',
3299
3299
  thresholdForAutoReject: 3,
3300
3300
  workflowBlockerResolvedWebhookUrl: null,
3301
- allowedIssueAuthors: null,
3301
+ allowedIssueAuthors: ['test-user'],
3302
3302
  });
3303
3303
 
3304
3304
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -3338,7 +3338,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3338
3338
  issueUrl: 'https://github.com/user/repo/issues/1',
3339
3339
  thresholdForAutoReject: 3,
3340
3340
  workflowBlockerResolvedWebhookUrl: null,
3341
- allowedIssueAuthors: null,
3341
+ allowedIssueAuthors: ['test-user'],
3342
3342
  });
3343
3343
 
3344
3344
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -3377,7 +3377,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3377
3377
  issueUrl: 'https://github.com/user/repo/issues/1',
3378
3378
  thresholdForAutoReject: 3,
3379
3379
  workflowBlockerResolvedWebhookUrl: null,
3380
- allowedIssueAuthors: null,
3380
+ allowedIssueAuthors: ['test-user'],
3381
3381
  });
3382
3382
 
3383
3383
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -3610,7 +3610,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3610
3610
  );
3611
3611
  });
3612
3612
 
3613
- it('should accept any author when allowedIssueAuthors is null (backward compatibility)', async () => {
3613
+ it('should reject author not in allowedIssueAuthors list (fail-closed)', async () => {
3614
3614
  const issue = createMockIssue({
3615
3615
  url: 'https://github.com/user/repo/issues/1',
3616
3616
  status: 'Preparation',
@@ -3624,33 +3624,29 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3624
3624
  content: 'From: :robot: Report',
3625
3625
  }),
3626
3626
  ]);
3627
- mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
3628
- {
3629
- url: 'https://github.com/user/repo/pull/1',
3630
- isConflicted: false,
3631
- isPassedAllCiJob: true,
3632
- isCiStateSuccess: true,
3633
- isResolvedAllReviewComments: true,
3634
- isBranchOutOfDate: false,
3635
- missingRequiredCheckNames: [],
3636
- },
3637
- ]);
3627
+ mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([]);
3638
3628
 
3639
3629
  await useCase.run({
3640
3630
  projectUrl: 'https://github.com/users/user/projects/1',
3641
3631
  issueUrl: 'https://github.com/user/repo/issues/1',
3642
3632
  thresholdForAutoReject: 3,
3643
3633
  workflowBlockerResolvedWebhookUrl: null,
3644
- allowedIssueAuthors: null,
3634
+ allowedIssueAuthors: ['trusted-bot'],
3645
3635
  });
3646
3636
 
3647
3637
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
3648
- expect.objectContaining({ status: 'Awaiting Quality Check' }),
3638
+ expect.objectContaining({ status: 'Awaiting Workspace' }),
3649
3639
  mockProject,
3650
3640
  );
3641
+ expect(mockIssueCommentRepository.createComment).toHaveBeenCalledWith(
3642
+ expect.objectContaining({
3643
+ url: 'https://github.com/user/repo/issues/1',
3644
+ }),
3645
+ expect.stringContaining('NO_REPORT_FROM_AGENT_BOT'),
3646
+ );
3651
3647
  });
3652
3648
 
3653
- it('should accept any author when allowedIssueAuthors is omitted (backward compatibility)', async () => {
3649
+ it('should reject all authors when allowedIssueAuthors is omitted (fail-closed)', async () => {
3654
3650
  const issue = createMockIssue({
3655
3651
  url: 'https://github.com/user/repo/issues/1',
3656
3652
  status: 'Preparation',
@@ -3664,17 +3660,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3664
3660
  content: 'From: :robot: Report',
3665
3661
  }),
3666
3662
  ]);
3667
- mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
3668
- {
3669
- url: 'https://github.com/user/repo/pull/1',
3670
- isConflicted: false,
3671
- isPassedAllCiJob: true,
3672
- isCiStateSuccess: true,
3673
- isResolvedAllReviewComments: true,
3674
- isBranchOutOfDate: false,
3675
- missingRequiredCheckNames: [],
3676
- },
3677
- ]);
3663
+ mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([]);
3678
3664
 
3679
3665
  await useCase.run({
3680
3666
  projectUrl: 'https://github.com/users/user/projects/1',
@@ -3684,7 +3670,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3684
3670
  });
3685
3671
 
3686
3672
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
3687
- expect.objectContaining({ status: 'Awaiting Quality Check' }),
3673
+ expect.objectContaining({ status: 'Awaiting Workspace' }),
3688
3674
  mockProject,
3689
3675
  );
3690
3676
  });
@@ -3723,7 +3709,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3723
3709
  issueUrl: 'https://github.com/user/repo/issues/1',
3724
3710
  thresholdForAutoReject: 3,
3725
3711
  workflowBlockerResolvedWebhookUrl: null,
3726
- allowedIssueAuthors: null,
3712
+ allowedIssueAuthors: ['test-user'],
3727
3713
  });
3728
3714
 
3729
3715
  expect(
@@ -3748,7 +3734,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3748
3734
  issueUrl: 'https://github.com/user/repo/issues/1',
3749
3735
  thresholdForAutoReject: 3,
3750
3736
  workflowBlockerResolvedWebhookUrl: null,
3751
- allowedIssueAuthors: null,
3737
+ allowedIssueAuthors: ['test-user'],
3752
3738
  });
3753
3739
 
3754
3740
  expect(
@@ -3775,7 +3761,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3775
3761
  issueUrl: 'https://github.com/user/repo/issues/1',
3776
3762
  thresholdForAutoReject: 3,
3777
3763
  workflowBlockerResolvedWebhookUrl: null,
3778
- allowedIssueAuthors: null,
3764
+ allowedIssueAuthors: ['test-user'],
3779
3765
  });
3780
3766
 
3781
3767
  expect(
@@ -3802,7 +3788,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3802
3788
  issueUrl: 'https://github.com/user/repo/issues/1',
3803
3789
  thresholdForAutoReject: 3,
3804
3790
  workflowBlockerResolvedWebhookUrl: null,
3805
- allowedIssueAuthors: null,
3791
+ allowedIssueAuthors: ['test-user'],
3806
3792
  });
3807
3793
 
3808
3794
  expect(mockIssueRepository.approvePullRequest).toHaveBeenCalledWith(
@@ -3826,7 +3812,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3826
3812
  issueUrl: 'https://github.com/user/repo/issues/1',
3827
3813
  thresholdForAutoReject: 3,
3828
3814
  workflowBlockerResolvedWebhookUrl: null,
3829
- allowedIssueAuthors: null,
3815
+ allowedIssueAuthors: ['test-user'],
3830
3816
  });
3831
3817
 
3832
3818
  expect(mockIssueRepository.approvePullRequest).not.toHaveBeenCalled();
@@ -3844,7 +3830,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3844
3830
  issueUrl: 'https://github.com/user/repo/issues/1',
3845
3831
  thresholdForAutoReject: 3,
3846
3832
  workflowBlockerResolvedWebhookUrl: null,
3847
- allowedIssueAuthors: null,
3833
+ allowedIssueAuthors: ['test-user'],
3848
3834
  });
3849
3835
 
3850
3836
  expect(mockIssueRepository.approvePullRequest).not.toHaveBeenCalled();
@@ -3862,7 +3848,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3862
3848
  issueUrl: 'https://github.com/user/repo/issues/1',
3863
3849
  thresholdForAutoReject: 3,
3864
3850
  workflowBlockerResolvedWebhookUrl: null,
3865
- allowedIssueAuthors: null,
3851
+ allowedIssueAuthors: ['test-user'],
3866
3852
  });
3867
3853
 
3868
3854
  expect(mockIssueRepository.approvePullRequest).toHaveBeenCalledWith(
@@ -3879,7 +3865,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3879
3865
  issueUrl: 'https://github.com/user/repo/issues/1',
3880
3866
  thresholdForAutoReject: 3,
3881
3867
  workflowBlockerResolvedWebhookUrl: null,
3882
- allowedIssueAuthors: null,
3868
+ allowedIssueAuthors: ['test-user'],
3883
3869
  });
3884
3870
 
3885
3871
  expect(
@@ -3906,7 +3892,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3906
3892
  issueUrl: 'https://github.com/user/repo/issues/1',
3907
3893
  thresholdForAutoReject: 3,
3908
3894
  workflowBlockerResolvedWebhookUrl: null,
3909
- allowedIssueAuthors: null,
3895
+ allowedIssueAuthors: ['test-user'],
3910
3896
  });
3911
3897
 
3912
3898
  expect(
@@ -3926,7 +3912,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3926
3912
  issueUrl: 'https://github.com/user/repo/issues/1',
3927
3913
  thresholdForAutoReject: 3,
3928
3914
  workflowBlockerResolvedWebhookUrl: null,
3929
- allowedIssueAuthors: null,
3915
+ allowedIssueAuthors: ['test-user'],
3930
3916
  });
3931
3917
 
3932
3918
  expect(mockIssueRepository.approvePullRequest).toHaveBeenCalledWith(
@@ -3945,7 +3931,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3945
3931
  issueUrl: 'https://github.com/user/repo/issues/1',
3946
3932
  thresholdForAutoReject: 3,
3947
3933
  workflowBlockerResolvedWebhookUrl: null,
3948
- allowedIssueAuthors: null,
3934
+ allowedIssueAuthors: ['test-user'],
3949
3935
  });
3950
3936
 
3951
3937
  expect(mockIssueRepository.approvePullRequest).toHaveBeenCalledWith(
@@ -3964,7 +3950,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3964
3950
  issueUrl: 'https://github.com/user/repo/issues/1',
3965
3951
  thresholdForAutoReject: 3,
3966
3952
  workflowBlockerResolvedWebhookUrl: null,
3967
- allowedIssueAuthors: null,
3953
+ allowedIssueAuthors: ['test-user'],
3968
3954
  changeTargetPathAliases: {
3969
3955
  adapters: 'src/domain/usecases/adapter-interfaces',
3970
3956
  },
@@ -3986,7 +3972,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
3986
3972
  issueUrl: 'https://github.com/user/repo/issues/1',
3987
3973
  thresholdForAutoReject: 3,
3988
3974
  workflowBlockerResolvedWebhookUrl: null,
3989
- allowedIssueAuthors: null,
3975
+ allowedIssueAuthors: ['test-user'],
3990
3976
  changeTargetPathAliases: {
3991
3977
  adapters: 'src/domain/usecases/adapter-interfaces',
3992
3978
  },
@@ -4026,7 +4012,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4026
4012
  issueUrl: 'https://github.com/user/repo/issues/1',
4027
4013
  thresholdForAutoReject: 3,
4028
4014
  workflowBlockerResolvedWebhookUrl: null,
4029
- allowedIssueAuthors: null,
4015
+ allowedIssueAuthors: ['test-user'],
4030
4016
  });
4031
4017
 
4032
4018
  expect(mockIssueRepository.setIssueAgentField).toHaveBeenCalledWith(
@@ -4058,7 +4044,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4058
4044
  issueUrl: 'https://github.com/user/repo/issues/1',
4059
4045
  thresholdForAutoReject: 3,
4060
4046
  workflowBlockerResolvedWebhookUrl: null,
4061
- allowedIssueAuthors: null,
4047
+ allowedIssueAuthors: ['test-user'],
4062
4048
  });
4063
4049
 
4064
4050
  expect(mockIssueRepository.setIssueAgentField).not.toHaveBeenCalled();
@@ -4086,7 +4072,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4086
4072
  issueUrl: 'https://github.com/user/repo/issues/1',
4087
4073
  thresholdForAutoReject: 3,
4088
4074
  workflowBlockerResolvedWebhookUrl: null,
4089
- allowedIssueAuthors: null,
4075
+ allowedIssueAuthors: ['test-user'],
4090
4076
  });
4091
4077
 
4092
4078
  expect(mockProjectRepository.updateAgentList).toHaveBeenCalledWith(
@@ -4131,7 +4117,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4131
4117
  issueUrl: 'https://github.com/user/repo/issues/1',
4132
4118
  thresholdForAutoReject: 3,
4133
4119
  workflowBlockerResolvedWebhookUrl: null,
4134
- allowedIssueAuthors: null,
4120
+ allowedIssueAuthors: ['test-user'],
4135
4121
  });
4136
4122
 
4137
4123
  expect(mockIssueRepository.setIssueAgentField).not.toHaveBeenCalled();
@@ -4156,7 +4142,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4156
4142
  issueUrl: 'https://github.com/user/repo/issues/1',
4157
4143
  thresholdForAutoReject: 3,
4158
4144
  workflowBlockerResolvedWebhookUrl: null,
4159
- allowedIssueAuthors: null,
4145
+ allowedIssueAuthors: ['test-user'],
4160
4146
  });
4161
4147
 
4162
4148
  expect(mockProjectRepository.createField).toHaveBeenCalledWith(
@@ -4216,7 +4202,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4216
4202
  issueUrl: 'https://github.com/user/repo/issues/1',
4217
4203
  thresholdForAutoReject: 3,
4218
4204
  workflowBlockerResolvedWebhookUrl: null,
4219
- allowedIssueAuthors: null,
4205
+ allowedIssueAuthors: ['test-user'],
4220
4206
  });
4221
4207
 
4222
4208
  expect(
@@ -4243,7 +4229,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4243
4229
  issueUrl: 'https://github.com/user/repo/issues/1',
4244
4230
  thresholdForAutoReject: 3,
4245
4231
  workflowBlockerResolvedWebhookUrl: null,
4246
- allowedIssueAuthors: null,
4232
+ allowedIssueAuthors: ['test-user'],
4247
4233
  });
4248
4234
 
4249
4235
  expect(
@@ -4290,7 +4276,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4290
4276
  issueUrl: 'https://github.com/user/repo/issues/1',
4291
4277
  thresholdForAutoReject: 3,
4292
4278
  workflowBlockerResolvedWebhookUrl: null,
4293
- allowedIssueAuthors: null,
4279
+ allowedIssueAuthors: ['test-user'],
4294
4280
  });
4295
4281
 
4296
4282
  expect(capturedArg).toMatchObject({
@@ -4321,7 +4307,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4321
4307
  issueUrl: 'https://github.com/user/repo/issues/1',
4322
4308
  thresholdForAutoReject: 3,
4323
4309
  workflowBlockerResolvedWebhookUrl: null,
4324
- allowedIssueAuthors: null,
4310
+ allowedIssueAuthors: ['test-user'],
4325
4311
  }),
4326
4312
  ).resolves.not.toThrow();
4327
4313
  expect(
@@ -4347,7 +4333,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4347
4333
  issueUrl,
4348
4334
  thresholdForAutoReject: 3,
4349
4335
  workflowBlockerResolvedWebhookUrl: null,
4350
- allowedIssueAuthors: null,
4336
+ allowedIssueAuthors: ['test-user'],
4351
4337
  missingAgentName: 'impl',
4352
4338
  manager: 'alice',
4353
4339
  sessionErrorLine:
@@ -4420,7 +4406,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4420
4406
  issueUrl,
4421
4407
  thresholdForAutoReject: 3,
4422
4408
  workflowBlockerResolvedWebhookUrl: null,
4423
- allowedIssueAuthors: null,
4409
+ allowedIssueAuthors: ['test-user'],
4424
4410
  missingAgentName: 'impl',
4425
4411
  });
4426
4412
 
@@ -4449,7 +4435,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4449
4435
  issueUrl,
4450
4436
  thresholdForAutoReject: 3,
4451
4437
  workflowBlockerResolvedWebhookUrl: null,
4452
- allowedIssueAuthors: null,
4438
+ allowedIssueAuthors: ['test-user'],
4453
4439
  missingAgentName: 'impl',
4454
4440
  manager: 'alice',
4455
4441
  });
@@ -4475,7 +4461,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4475
4461
  issueUrl,
4476
4462
  thresholdForAutoReject: 3,
4477
4463
  workflowBlockerResolvedWebhookUrl: null,
4478
- allowedIssueAuthors: null,
4464
+ allowedIssueAuthors: ['test-user'],
4479
4465
  missingAgentName: 'impl',
4480
4466
  manager: 'alice',
4481
4467
  });
@@ -4502,7 +4488,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4502
4488
  issueUrl,
4503
4489
  thresholdForAutoReject: 3,
4504
4490
  workflowBlockerResolvedWebhookUrl: null,
4505
- allowedIssueAuthors: null,
4491
+ allowedIssueAuthors: ['test-user'],
4506
4492
  missingAgentName: 'impl',
4507
4493
  manager: 'alice',
4508
4494
  });
@@ -4529,7 +4515,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4529
4515
  issueUrl,
4530
4516
  thresholdForAutoReject: 3,
4531
4517
  workflowBlockerResolvedWebhookUrl: null,
4532
- allowedIssueAuthors: null,
4518
+ allowedIssueAuthors: ['test-user'],
4533
4519
  missingAgentName: 'impl',
4534
4520
  }),
4535
4521
  ).rejects.toThrow('manager');
@@ -4555,7 +4541,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4555
4541
  issueUrl,
4556
4542
  thresholdForAutoReject: 3,
4557
4543
  workflowBlockerResolvedWebhookUrl: null,
4558
- allowedIssueAuthors: null,
4544
+ allowedIssueAuthors: ['test-user'],
4559
4545
  deferPreparation: true,
4560
4546
  });
4561
4547
 
@@ -4593,7 +4579,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4593
4579
  issueUrl,
4594
4580
  thresholdForAutoReject: 3,
4595
4581
  workflowBlockerResolvedWebhookUrl: null,
4596
- allowedIssueAuthors: null,
4582
+ allowedIssueAuthors: ['test-user'],
4597
4583
  deferPreparation: true,
4598
4584
  missingAgentName: 'some-agent',
4599
4585
  manager: 'alice',
@@ -4619,7 +4605,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4619
4605
  issueUrl,
4620
4606
  thresholdForAutoReject: 3,
4621
4607
  workflowBlockerResolvedWebhookUrl: null,
4622
- allowedIssueAuthors: null,
4608
+ allowedIssueAuthors: ['test-user'],
4623
4609
  deferPreparation: false,
4624
4610
  });
4625
4611
 
@@ -4636,7 +4622,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4636
4622
  issueUrl,
4637
4623
  thresholdForAutoReject: 3,
4638
4624
  workflowBlockerResolvedWebhookUrl: null,
4639
- allowedIssueAuthors: null,
4625
+ allowedIssueAuthors: ['test-user'],
4640
4626
  deferPreparation: true,
4641
4627
  sessionErrorLine:
4642
4628
  'Task failed 3 consecutive times with terminal_reason=api_error',
@@ -4661,7 +4647,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4661
4647
  issueUrl,
4662
4648
  thresholdForAutoReject: 3,
4663
4649
  workflowBlockerResolvedWebhookUrl: null,
4664
- allowedIssueAuthors: null,
4650
+ allowedIssueAuthors: ['test-user'],
4665
4651
  deferPreparation: true,
4666
4652
  });
4667
4653
 
@@ -4672,6 +4658,192 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4672
4658
  });
4673
4659
  });
4674
4660
 
4661
+ describe('nextStepAgent validation against agents list', () => {
4662
+ it('should transition to Failed Preparation when nextStepAgent is not in configured agents list', async () => {
4663
+ const issue = createMockIssue({
4664
+ url: 'https://github.com/user/repo/issues/1',
4665
+ status: 'Preparation',
4666
+ });
4667
+
4668
+ mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
4669
+ mockIssueRepository.get.mockResolvedValue(issue);
4670
+ mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
4671
+ createMockComment({
4672
+ content:
4673
+ 'From: :robot: test-agent (model)\n```json\n{"nextStepAgent": "unknown-agent"}\n```',
4674
+ }),
4675
+ ]);
4676
+ mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([]);
4677
+
4678
+ await useCase.run({
4679
+ projectUrl: 'https://github.com/users/user/projects/1',
4680
+ issueUrl: 'https://github.com/user/repo/issues/1',
4681
+ thresholdForAutoReject: 3,
4682
+ workflowBlockerResolvedWebhookUrl: null,
4683
+ allowedIssueAuthors: ['test-user'],
4684
+ agents: ['developer', 'triager'],
4685
+ });
4686
+
4687
+ expect(mockIssueRepository.update).toHaveBeenCalledWith(
4688
+ expect.objectContaining({ status: 'Failed Preparation' }),
4689
+ mockProject,
4690
+ );
4691
+ expect(mockIssueRepository.updateStatus).toHaveBeenCalledWith(
4692
+ mockProject,
4693
+ expect.objectContaining({ status: 'Failed Preparation' }),
4694
+ 'failed-preparation-id',
4695
+ );
4696
+ expect(mockIssueCommentRepository.createComment).toHaveBeenCalledWith(
4697
+ expect.objectContaining({
4698
+ url: 'https://github.com/user/repo/issues/1',
4699
+ }),
4700
+ expect.stringContaining('unknown-agent'),
4701
+ );
4702
+ expect(mockIssueCommentRepository.createComment).toHaveBeenCalledWith(
4703
+ expect.objectContaining({
4704
+ url: 'https://github.com/user/repo/issues/1',
4705
+ }),
4706
+ expect.stringContaining('not in the configured agents list'),
4707
+ );
4708
+ });
4709
+
4710
+ it('should dispatch normally when nextStepAgent is in the configured agents list', async () => {
4711
+ const issue = createMockIssue({
4712
+ url: 'https://github.com/user/repo/issues/1',
4713
+ status: 'Preparation',
4714
+ });
4715
+
4716
+ mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
4717
+ mockIssueRepository.get.mockResolvedValue(issue);
4718
+ mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
4719
+ createMockComment({
4720
+ content:
4721
+ 'From: :robot: test-agent (model)\n```json\n{"nextStepAgent": "developer"}\n```',
4722
+ }),
4723
+ ]);
4724
+
4725
+ await useCase.run({
4726
+ projectUrl: 'https://github.com/users/user/projects/1',
4727
+ issueUrl: 'https://github.com/user/repo/issues/1',
4728
+ thresholdForAutoReject: 3,
4729
+ workflowBlockerResolvedWebhookUrl: null,
4730
+ allowedIssueAuthors: ['test-user'],
4731
+ agents: ['developer', 'triager'],
4732
+ });
4733
+
4734
+ expect(mockIssueRepository.update).toHaveBeenCalledWith(
4735
+ expect.objectContaining({ status: 'Awaiting Workspace' }),
4736
+ mockProject,
4737
+ );
4738
+ expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
4739
+ expect.objectContaining({ status: 'Failed Preparation' }),
4740
+ mockProject,
4741
+ );
4742
+ });
4743
+
4744
+ it('should skip nextStepAgent validation when agents list is null', async () => {
4745
+ const issue = createMockIssue({
4746
+ url: 'https://github.com/user/repo/issues/1',
4747
+ status: 'Preparation',
4748
+ });
4749
+
4750
+ mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
4751
+ mockIssueRepository.get.mockResolvedValue(issue);
4752
+ mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
4753
+ createMockComment({
4754
+ content:
4755
+ 'From: :robot: test-agent (model)\n```json\n{"nextStepAgent": "any-arbitrary-agent"}\n```',
4756
+ }),
4757
+ ]);
4758
+
4759
+ await useCase.run({
4760
+ projectUrl: 'https://github.com/users/user/projects/1',
4761
+ issueUrl: 'https://github.com/user/repo/issues/1',
4762
+ thresholdForAutoReject: 3,
4763
+ workflowBlockerResolvedWebhookUrl: null,
4764
+ allowedIssueAuthors: ['test-user'],
4765
+ agents: null,
4766
+ });
4767
+
4768
+ expect(mockIssueRepository.update).toHaveBeenCalledWith(
4769
+ expect.objectContaining({ status: 'Awaiting Workspace' }),
4770
+ mockProject,
4771
+ );
4772
+ expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
4773
+ expect.objectContaining({ status: 'Failed Preparation' }),
4774
+ mockProject,
4775
+ );
4776
+ });
4777
+
4778
+ it('should skip nextStepAgent validation when agents list is empty', async () => {
4779
+ const issue = createMockIssue({
4780
+ url: 'https://github.com/user/repo/issues/1',
4781
+ status: 'Preparation',
4782
+ });
4783
+
4784
+ mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
4785
+ mockIssueRepository.get.mockResolvedValue(issue);
4786
+ mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
4787
+ createMockComment({
4788
+ content:
4789
+ 'From: :robot: test-agent (model)\n```json\n{"nextStepAgent": "any-arbitrary-agent"}\n```',
4790
+ }),
4791
+ ]);
4792
+
4793
+ await useCase.run({
4794
+ projectUrl: 'https://github.com/users/user/projects/1',
4795
+ issueUrl: 'https://github.com/user/repo/issues/1',
4796
+ thresholdForAutoReject: 3,
4797
+ workflowBlockerResolvedWebhookUrl: null,
4798
+ allowedIssueAuthors: ['test-user'],
4799
+ agents: [],
4800
+ });
4801
+
4802
+ expect(mockIssueRepository.update).not.toHaveBeenCalledWith(
4803
+ expect.objectContaining({ status: 'Failed Preparation' }),
4804
+ mockProject,
4805
+ );
4806
+ });
4807
+ });
4808
+
4809
+ describe('allowedIssueAuthors fail-closed behavior', () => {
4810
+ it('should reject agent reports from any author when allowedIssueAuthors is null (fail-closed)', async () => {
4811
+ const issue = createMockIssue({
4812
+ url: 'https://github.com/user/repo/issues/1',
4813
+ status: 'Preparation',
4814
+ });
4815
+
4816
+ mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
4817
+ mockIssueRepository.get.mockResolvedValue(issue);
4818
+ mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
4819
+ createMockComment({
4820
+ author: 'any-author',
4821
+ content: 'From: :robot: Real report',
4822
+ }),
4823
+ ]);
4824
+ mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([]);
4825
+
4826
+ await useCase.run({
4827
+ projectUrl: 'https://github.com/users/user/projects/1',
4828
+ issueUrl: 'https://github.com/user/repo/issues/1',
4829
+ thresholdForAutoReject: 3,
4830
+ workflowBlockerResolvedWebhookUrl: null,
4831
+ allowedIssueAuthors: null,
4832
+ });
4833
+
4834
+ expect(mockIssueRepository.update).toHaveBeenCalledWith(
4835
+ expect.objectContaining({ status: 'Awaiting Workspace' }),
4836
+ mockProject,
4837
+ );
4838
+ expect(mockIssueCommentRepository.createComment).toHaveBeenCalledWith(
4839
+ expect.objectContaining({
4840
+ url: 'https://github.com/user/repo/issues/1',
4841
+ }),
4842
+ expect.stringContaining('NO_REPORT_FROM_AGENT_BOT'),
4843
+ );
4844
+ });
4845
+ });
4846
+
4675
4847
  describe('waitingForOwnerApproval', () => {
4676
4848
  const issueUrl = 'https://github.com/user/repo/issues/1';
4677
4849
 
@@ -4692,7 +4864,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4692
4864
  issueUrl,
4693
4865
  thresholdForAutoReject: 3,
4694
4866
  workflowBlockerResolvedWebhookUrl: null,
4695
- allowedIssueAuthors: null,
4867
+ allowedIssueAuthors: ['test-user'],
4696
4868
  });
4697
4869
 
4698
4870
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -4732,7 +4904,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4732
4904
  issueUrl,
4733
4905
  thresholdForAutoReject: 3,
4734
4906
  workflowBlockerResolvedWebhookUrl: null,
4735
- allowedIssueAuthors: null,
4907
+ allowedIssueAuthors: ['test-user'],
4736
4908
  });
4737
4909
 
4738
4910
  expect(mockIssueRepository.updateStatus).not.toHaveBeenCalledWith(
@@ -4770,7 +4942,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4770
4942
  issueUrl,
4771
4943
  thresholdForAutoReject: 3,
4772
4944
  workflowBlockerResolvedWebhookUrl: null,
4773
- allowedIssueAuthors: null,
4945
+ allowedIssueAuthors: ['test-user'],
4774
4946
  });
4775
4947
 
4776
4948
  expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
@@ -4801,7 +4973,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4801
4973
  issueUrl,
4802
4974
  thresholdForAutoReject: 3,
4803
4975
  workflowBlockerResolvedWebhookUrl: null,
4804
- allowedIssueAuthors: null,
4976
+ allowedIssueAuthors: ['test-user'],
4805
4977
  ownerApprovalTimeoutCycles: 2,
4806
4978
  });
4807
4979
 
@@ -4924,7 +5096,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4924
5096
  issueUrl: 'https://github.com/user/repo/issues/1',
4925
5097
  thresholdForAutoReject: 3,
4926
5098
  workflowBlockerResolvedWebhookUrl: null,
4927
- allowedIssueAuthors: null,
5099
+ allowedIssueAuthors: ['test-user'],
4928
5100
  });
4929
5101
 
4930
5102
  expect(mockIssueRepository.update).toHaveBeenCalledWith(
@@ -4953,7 +5125,7 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
4953
5125
  issueUrl: 'https://github.com/user/repo/issues/1',
4954
5126
  thresholdForAutoReject: 3,
4955
5127
  workflowBlockerResolvedWebhookUrl: null,
4956
- allowedIssueAuthors: null,
5128
+ allowedIssueAuthors: ['test-user'],
4957
5129
  });
4958
5130
 
4959
5131
  expect(mockIssueRepository.setIssueAgentField).not.toHaveBeenCalled();