github-issue-tower-defence-management 1.44.4 → 1.44.6
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/.github/workflows/api-created_issue_pr.yml +8 -1
- package/.github/workflows/umino-project.yml +55 -18
- package/CHANGELOG.md +15 -0
- package/README.md +2 -2
- package/bin/adapter/entry-points/cli/index.js +4 -1
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +2 -2
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +2 -0
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js +2 -2
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js +65 -3
- package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/StartPreparationUseCase.js +4 -6
- package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/index.test.ts +2 -0
- package/src/adapter/entry-points/cli/index.ts +6 -0
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +1 -0
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +5 -2
- package/src/domain/usecases/HandleScheduledEventUseCase.ts +3 -0
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.ts +8 -4
- package/src/domain/usecases/RevertOrphanedPreparationUseCase.test.ts +316 -11
- package/src/domain/usecases/RevertOrphanedPreparationUseCase.ts +107 -11
- package/src/domain/usecases/StartPreparationUseCase.test.ts +76 -79
- package/src/domain/usecases/StartPreparationUseCase.ts +10 -8
- package/src/domain/usecases/adapter-interfaces/IssueRepository.ts +4 -1
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +1 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/RevertOrphanedPreparationUseCase.d.ts +8 -2
- package/types/domain/usecases/RevertOrphanedPreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/StartPreparationUseCase.d.ts +2 -1
- package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts.map +1 -1
|
@@ -83,7 +83,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
83
83
|
let mockIssueRepository: Mocked<
|
|
84
84
|
Pick<
|
|
85
85
|
IssueRepository,
|
|
86
|
-
| 'getAllOpened'
|
|
87
86
|
| 'getStoryObjectMap'
|
|
88
87
|
| 'updateStatus'
|
|
89
88
|
| 'findRelatedOpenPRs'
|
|
@@ -105,7 +104,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
105
104
|
),
|
|
106
105
|
};
|
|
107
106
|
mockIssueRepository = {
|
|
108
|
-
getAllOpened: jest.fn(),
|
|
109
107
|
getStoryObjectMap: jest.fn().mockResolvedValue(new Map()),
|
|
110
108
|
updateStatus: jest.fn(),
|
|
111
109
|
findRelatedOpenPRs: jest.fn().mockResolvedValue([]),
|
|
@@ -134,7 +132,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
134
132
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
135
133
|
createMockStoryObjectMap([]),
|
|
136
134
|
);
|
|
137
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([]);
|
|
138
135
|
|
|
139
136
|
await useCase.run({
|
|
140
137
|
projectUrl: 'https://github.com/user/repo',
|
|
@@ -148,6 +145,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
148
145
|
utilizationPercentageThreshold: 90,
|
|
149
146
|
allowedIssueAuthors: null,
|
|
150
147
|
codexHomeCandidates: null,
|
|
148
|
+
allowIssueCacheMinutes: 0,
|
|
151
149
|
});
|
|
152
150
|
|
|
153
151
|
expect(mockProjectRepository.prepareStatus).toHaveBeenCalledTimes(2);
|
|
@@ -175,7 +173,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
175
173
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
176
174
|
createMockStoryObjectMap(awaitingIssues),
|
|
177
175
|
);
|
|
178
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
179
176
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
180
177
|
stdout: '',
|
|
181
178
|
stderr: '',
|
|
@@ -193,6 +190,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
193
190
|
utilizationPercentageThreshold: 90,
|
|
194
191
|
allowedIssueAuthors: null,
|
|
195
192
|
codexHomeCandidates: null,
|
|
193
|
+
allowIssueCacheMinutes: 0,
|
|
196
194
|
});
|
|
197
195
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
198
196
|
expect(mockIssueRepository.updateStatus.mock.calls[0][0]).toBe(mockProject);
|
|
@@ -238,7 +236,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
238
236
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
239
237
|
createMockStoryObjectMap(awaitingIssues),
|
|
240
238
|
);
|
|
241
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
242
239
|
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([existingPR]);
|
|
243
240
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
244
241
|
stdout: '',
|
|
@@ -257,6 +254,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
257
254
|
utilizationPercentageThreshold: 90,
|
|
258
255
|
allowedIssueAuthors: null,
|
|
259
256
|
codexHomeCandidates: null,
|
|
257
|
+
allowIssueCacheMinutes: 0,
|
|
260
258
|
});
|
|
261
259
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
262
260
|
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
@@ -285,7 +283,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
285
283
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
286
284
|
createMockStoryObjectMap(awaitingIssues),
|
|
287
285
|
);
|
|
288
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
289
286
|
mockIssueRepository.getOpenPullRequest.mockResolvedValue({
|
|
290
287
|
url: 'https://github.com/user/repo/pull/354',
|
|
291
288
|
branchName: 'dependabot/npm_and_yarn/multi-cc382f683c',
|
|
@@ -313,6 +310,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
313
310
|
utilizationPercentageThreshold: 90,
|
|
314
311
|
allowedIssueAuthors: null,
|
|
315
312
|
codexHomeCandidates: null,
|
|
313
|
+
allowIssueCacheMinutes: 0,
|
|
316
314
|
});
|
|
317
315
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
318
316
|
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
@@ -345,7 +343,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
345
343
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
346
344
|
createMockStoryObjectMap(awaitingIssues),
|
|
347
345
|
);
|
|
348
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
349
346
|
mockIssueRepository.getOpenPullRequest.mockResolvedValue(null);
|
|
350
347
|
const consoleWarnSpy = jest
|
|
351
348
|
.spyOn(console, 'warn')
|
|
@@ -362,6 +359,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
362
359
|
utilizationPercentageThreshold: 90,
|
|
363
360
|
allowedIssueAuthors: null,
|
|
364
361
|
codexHomeCandidates: null,
|
|
362
|
+
allowIssueCacheMinutes: 0,
|
|
365
363
|
});
|
|
366
364
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(0);
|
|
367
365
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -384,7 +382,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
384
382
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
385
383
|
createMockStoryObjectMap(awaitingIssues),
|
|
386
384
|
);
|
|
387
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
388
385
|
mockIssueRepository.getOpenPullRequest.mockResolvedValue({
|
|
389
386
|
url: 'https://github.com/user/repo/pull/999',
|
|
390
387
|
branchName: null,
|
|
@@ -410,6 +407,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
410
407
|
utilizationPercentageThreshold: 90,
|
|
411
408
|
allowedIssueAuthors: null,
|
|
412
409
|
codexHomeCandidates: null,
|
|
410
|
+
allowIssueCacheMinutes: 0,
|
|
413
411
|
});
|
|
414
412
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(0);
|
|
415
413
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -431,7 +429,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
431
429
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
432
430
|
createMockStoryObjectMap(awaitingIssues),
|
|
433
431
|
);
|
|
434
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
435
432
|
mockIssueRepository.getOpenPullRequest.mockResolvedValue({
|
|
436
433
|
url: 'https://github.com/user/repo/pull/999',
|
|
437
434
|
branchName: 'evil$(rm -rf /)',
|
|
@@ -457,6 +454,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
457
454
|
utilizationPercentageThreshold: 90,
|
|
458
455
|
allowedIssueAuthors: null,
|
|
459
456
|
codexHomeCandidates: null,
|
|
457
|
+
allowIssueCacheMinutes: 0,
|
|
460
458
|
});
|
|
461
459
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(0);
|
|
462
460
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -498,7 +496,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
498
496
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
499
497
|
createMockStoryObjectMap(awaitingIssues),
|
|
500
498
|
);
|
|
501
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
502
499
|
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([pr1, pr2]);
|
|
503
500
|
const consoleWarnSpy = jest
|
|
504
501
|
.spyOn(console, 'warn')
|
|
@@ -515,6 +512,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
515
512
|
utilizationPercentageThreshold: 90,
|
|
516
513
|
allowedIssueAuthors: null,
|
|
517
514
|
codexHomeCandidates: null,
|
|
515
|
+
allowIssueCacheMinutes: 0,
|
|
518
516
|
});
|
|
519
517
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(0);
|
|
520
518
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -546,7 +544,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
546
544
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
547
545
|
createMockStoryObjectMap(awaitingIssues),
|
|
548
546
|
);
|
|
549
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
550
547
|
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
|
|
551
548
|
prWithNullBranch,
|
|
552
549
|
]);
|
|
@@ -565,6 +562,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
565
562
|
utilizationPercentageThreshold: 90,
|
|
566
563
|
allowedIssueAuthors: null,
|
|
567
564
|
codexHomeCandidates: null,
|
|
565
|
+
allowIssueCacheMinutes: 0,
|
|
568
566
|
});
|
|
569
567
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(0);
|
|
570
568
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -592,7 +590,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
592
590
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
593
591
|
createMockStoryObjectMap(awaitingIssues),
|
|
594
592
|
);
|
|
595
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
596
593
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
597
594
|
stdout: '',
|
|
598
595
|
stderr: '',
|
|
@@ -610,6 +607,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
610
607
|
utilizationPercentageThreshold: 90,
|
|
611
608
|
allowedIssueAuthors: null,
|
|
612
609
|
codexHomeCandidates: null,
|
|
610
|
+
allowIssueCacheMinutes: 0,
|
|
613
611
|
});
|
|
614
612
|
// Both awaiting issues should be updated (forward iteration: url1 first, then url2)
|
|
615
613
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(2);
|
|
@@ -650,10 +648,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
650
648
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
651
649
|
createMockStoryObjectMap([...preparationIssues, ...awaitingIssues]),
|
|
652
650
|
);
|
|
653
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
654
|
-
...preparationIssues,
|
|
655
|
-
...awaitingIssues,
|
|
656
|
-
]);
|
|
657
651
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
658
652
|
stdout: '',
|
|
659
653
|
stderr: '',
|
|
@@ -671,6 +665,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
671
665
|
utilizationPercentageThreshold: 90,
|
|
672
666
|
allowedIssueAuthors: null,
|
|
673
667
|
codexHomeCandidates: null,
|
|
668
|
+
allowIssueCacheMinutes: 0,
|
|
674
669
|
});
|
|
675
670
|
// Loop doesn't run because we're already at max (6 >= 6)
|
|
676
671
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -689,7 +684,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
689
684
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
690
685
|
createMockStoryObjectMap(awaitingIssues),
|
|
691
686
|
);
|
|
692
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
693
687
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
694
688
|
stdout: '',
|
|
695
689
|
stderr: '',
|
|
@@ -707,6 +701,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
707
701
|
utilizationPercentageThreshold: 90,
|
|
708
702
|
allowedIssueAuthors: null,
|
|
709
703
|
codexHomeCandidates: null,
|
|
704
|
+
allowIssueCacheMinutes: 0,
|
|
710
705
|
});
|
|
711
706
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
712
707
|
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
@@ -735,7 +730,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
735
730
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
736
731
|
createMockStoryObjectMap(awaitingIssues),
|
|
737
732
|
);
|
|
738
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
739
733
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
740
734
|
stdout: '',
|
|
741
735
|
stderr: '',
|
|
@@ -753,6 +747,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
753
747
|
utilizationPercentageThreshold: 90,
|
|
754
748
|
allowedIssueAuthors: null,
|
|
755
749
|
codexHomeCandidates: null,
|
|
750
|
+
allowIssueCacheMinutes: 0,
|
|
756
751
|
});
|
|
757
752
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
758
753
|
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
@@ -781,7 +776,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
781
776
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
782
777
|
createMockStoryObjectMap(awaitingIssues),
|
|
783
778
|
);
|
|
784
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
785
779
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
786
780
|
stdout: '',
|
|
787
781
|
stderr: '',
|
|
@@ -799,6 +793,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
799
793
|
utilizationPercentageThreshold: 90,
|
|
800
794
|
allowedIssueAuthors: null,
|
|
801
795
|
codexHomeCandidates: null,
|
|
796
|
+
allowIssueCacheMinutes: 0,
|
|
802
797
|
});
|
|
803
798
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
804
799
|
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
@@ -827,7 +822,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
827
822
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
828
823
|
createMockStoryObjectMap(awaitingIssues),
|
|
829
824
|
);
|
|
830
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
831
825
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
832
826
|
stdout: '',
|
|
833
827
|
stderr: '',
|
|
@@ -845,6 +839,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
845
839
|
utilizationPercentageThreshold: 90,
|
|
846
840
|
allowedIssueAuthors: null,
|
|
847
841
|
codexHomeCandidates: null,
|
|
842
|
+
allowIssueCacheMinutes: 0,
|
|
848
843
|
});
|
|
849
844
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
850
845
|
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
@@ -873,7 +868,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
873
868
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
874
869
|
createMockStoryObjectMap(awaitingIssues),
|
|
875
870
|
);
|
|
876
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
877
871
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
878
872
|
stdout: '',
|
|
879
873
|
stderr: '',
|
|
@@ -891,6 +885,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
891
885
|
utilizationPercentageThreshold: 90,
|
|
892
886
|
allowedIssueAuthors: null,
|
|
893
887
|
codexHomeCandidates: null,
|
|
888
|
+
allowIssueCacheMinutes: 0,
|
|
894
889
|
});
|
|
895
890
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
896
891
|
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
@@ -919,7 +914,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
919
914
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
920
915
|
createMockStoryObjectMap(awaitingIssues),
|
|
921
916
|
);
|
|
922
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
923
917
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
924
918
|
stdout: '',
|
|
925
919
|
stderr: '',
|
|
@@ -937,6 +931,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
937
931
|
utilizationPercentageThreshold: 90,
|
|
938
932
|
allowedIssueAuthors: null,
|
|
939
933
|
codexHomeCandidates: null,
|
|
934
|
+
allowIssueCacheMinutes: 0,
|
|
940
935
|
});
|
|
941
936
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
942
937
|
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
@@ -965,7 +960,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
965
960
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
966
961
|
createMockStoryObjectMap(awaitingIssues),
|
|
967
962
|
);
|
|
968
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
969
963
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
970
964
|
stdout: '',
|
|
971
965
|
stderr: '',
|
|
@@ -986,6 +980,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
986
980
|
utilizationPercentageThreshold: 90,
|
|
987
981
|
allowedIssueAuthors: null,
|
|
988
982
|
codexHomeCandidates: null,
|
|
983
|
+
allowIssueCacheMinutes: 0,
|
|
989
984
|
});
|
|
990
985
|
expect(consoleErrorSpy).toHaveBeenCalledWith(
|
|
991
986
|
'No LLM model configured for issue url1. Provide --defaultLlmModelName or add an llm-model: label.',
|
|
@@ -1014,7 +1009,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1014
1009
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1015
1010
|
createMockStoryObjectMap(awaitingIssues),
|
|
1016
1011
|
);
|
|
1017
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1018
1012
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1019
1013
|
stdout: '',
|
|
1020
1014
|
stderr: '',
|
|
@@ -1035,6 +1029,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1035
1029
|
utilizationPercentageThreshold: 90,
|
|
1036
1030
|
allowedIssueAuthors: null,
|
|
1037
1031
|
codexHomeCandidates: null,
|
|
1032
|
+
allowIssueCacheMinutes: 0,
|
|
1038
1033
|
});
|
|
1039
1034
|
expect(consoleErrorSpy).toHaveBeenCalledWith(
|
|
1040
1035
|
'No LLM model configured for issue url1. Provide --defaultLlmModelName or add an llm-model: label.',
|
|
@@ -1068,7 +1063,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1068
1063
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1069
1064
|
createMockStoryObjectMap(preparationIssues),
|
|
1070
1065
|
);
|
|
1071
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(preparationIssues);
|
|
1072
1066
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1073
1067
|
stdout: '',
|
|
1074
1068
|
stderr: '',
|
|
@@ -1086,6 +1080,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1086
1080
|
utilizationPercentageThreshold: 90,
|
|
1087
1081
|
allowedIssueAuthors: null,
|
|
1088
1082
|
codexHomeCandidates: null,
|
|
1083
|
+
allowIssueCacheMinutes: 0,
|
|
1089
1084
|
});
|
|
1090
1085
|
// No issues are in 'Awaiting Workspace' status, so no updates should happen
|
|
1091
1086
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -1104,7 +1099,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1104
1099
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1105
1100
|
createMockStoryObjectMap(awaitingIssues),
|
|
1106
1101
|
);
|
|
1107
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1108
1102
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1109
1103
|
stdout: '',
|
|
1110
1104
|
stderr: '',
|
|
@@ -1122,6 +1116,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1122
1116
|
utilizationPercentageThreshold: 90,
|
|
1123
1117
|
allowedIssueAuthors: null,
|
|
1124
1118
|
codexHomeCandidates: null,
|
|
1119
|
+
allowIssueCacheMinutes: 0,
|
|
1125
1120
|
});
|
|
1126
1121
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(3);
|
|
1127
1122
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(3);
|
|
@@ -1139,7 +1134,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1139
1134
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1140
1135
|
createMockStoryObjectMap(awaitingIssues),
|
|
1141
1136
|
);
|
|
1142
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1143
1137
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1144
1138
|
stdout: '',
|
|
1145
1139
|
stderr: '',
|
|
@@ -1157,6 +1151,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1157
1151
|
utilizationPercentageThreshold: 90,
|
|
1158
1152
|
allowedIssueAuthors: null,
|
|
1159
1153
|
codexHomeCandidates: null,
|
|
1154
|
+
allowIssueCacheMinutes: 0,
|
|
1160
1155
|
});
|
|
1161
1156
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(6);
|
|
1162
1157
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(6);
|
|
@@ -1203,10 +1198,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1203
1198
|
|
|
1204
1199
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1205
1200
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(workflowBlockerMap);
|
|
1206
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
1207
|
-
blockerIssue,
|
|
1208
|
-
issueInBlockedRepo,
|
|
1209
|
-
]);
|
|
1210
1201
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1211
1202
|
stdout: '',
|
|
1212
1203
|
stderr: '',
|
|
@@ -1225,6 +1216,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1225
1216
|
utilizationPercentageThreshold: 90,
|
|
1226
1217
|
allowedIssueAuthors: null,
|
|
1227
1218
|
codexHomeCandidates: null,
|
|
1219
|
+
allowIssueCacheMinutes: 0,
|
|
1228
1220
|
});
|
|
1229
1221
|
|
|
1230
1222
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(2);
|
|
@@ -1252,7 +1244,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1252
1244
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1253
1245
|
createMockStoryObjectMap(awaitingIssues),
|
|
1254
1246
|
);
|
|
1255
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1256
1247
|
|
|
1257
1248
|
await useCase.run({
|
|
1258
1249
|
projectUrl: 'https://github.com/user/repo',
|
|
@@ -1266,6 +1257,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1266
1257
|
utilizationPercentageThreshold: 90,
|
|
1267
1258
|
allowedIssueAuthors: null,
|
|
1268
1259
|
codexHomeCandidates: null,
|
|
1260
|
+
allowIssueCacheMinutes: 0,
|
|
1269
1261
|
});
|
|
1270
1262
|
|
|
1271
1263
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -1291,7 +1283,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1291
1283
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1292
1284
|
createMockStoryObjectMap(awaitingIssues),
|
|
1293
1285
|
);
|
|
1294
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1295
1286
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1296
1287
|
stdout: '',
|
|
1297
1288
|
stderr: '',
|
|
@@ -1310,6 +1301,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1310
1301
|
utilizationPercentageThreshold: 90,
|
|
1311
1302
|
allowedIssueAuthors: null,
|
|
1312
1303
|
codexHomeCandidates: null,
|
|
1304
|
+
allowIssueCacheMinutes: 0,
|
|
1313
1305
|
});
|
|
1314
1306
|
|
|
1315
1307
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -1334,7 +1326,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1334
1326
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1335
1327
|
createMockStoryObjectMap(awaitingIssues),
|
|
1336
1328
|
);
|
|
1337
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1338
1329
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1339
1330
|
stdout: '',
|
|
1340
1331
|
stderr: '',
|
|
@@ -1353,6 +1344,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1353
1344
|
utilizationPercentageThreshold: 90,
|
|
1354
1345
|
allowedIssueAuthors: null,
|
|
1355
1346
|
codexHomeCandidates: null,
|
|
1347
|
+
allowIssueCacheMinutes: 0,
|
|
1356
1348
|
});
|
|
1357
1349
|
|
|
1358
1350
|
const weeklyUtilization = 91;
|
|
@@ -1388,7 +1380,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1388
1380
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1389
1381
|
createMockStoryObjectMap(awaitingIssues),
|
|
1390
1382
|
);
|
|
1391
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1392
1383
|
|
|
1393
1384
|
await useCase.run({
|
|
1394
1385
|
projectUrl: 'https://github.com/user/repo',
|
|
@@ -1402,6 +1393,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1402
1393
|
utilizationPercentageThreshold: 90,
|
|
1403
1394
|
allowedIssueAuthors: null,
|
|
1404
1395
|
codexHomeCandidates: null,
|
|
1396
|
+
allowIssueCacheMinutes: 0,
|
|
1405
1397
|
});
|
|
1406
1398
|
|
|
1407
1399
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -1425,7 +1417,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1425
1417
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1426
1418
|
createMockStoryObjectMap(awaitingIssues),
|
|
1427
1419
|
);
|
|
1428
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1429
1420
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1430
1421
|
stdout: '',
|
|
1431
1422
|
stderr: '',
|
|
@@ -1444,6 +1435,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1444
1435
|
utilizationPercentageThreshold: 100,
|
|
1445
1436
|
allowedIssueAuthors: null,
|
|
1446
1437
|
codexHomeCandidates: null,
|
|
1438
|
+
allowIssueCacheMinutes: 0,
|
|
1447
1439
|
});
|
|
1448
1440
|
|
|
1449
1441
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(6);
|
|
@@ -1467,7 +1459,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1467
1459
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1468
1460
|
createMockStoryObjectMap(awaitingIssues),
|
|
1469
1461
|
);
|
|
1470
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1471
1462
|
|
|
1472
1463
|
await useCase.run({
|
|
1473
1464
|
projectUrl: 'https://github.com/user/repo',
|
|
@@ -1481,6 +1472,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1481
1472
|
utilizationPercentageThreshold: 90,
|
|
1482
1473
|
allowedIssueAuthors: null,
|
|
1483
1474
|
codexHomeCandidates: null,
|
|
1475
|
+
allowIssueCacheMinutes: 0,
|
|
1484
1476
|
});
|
|
1485
1477
|
|
|
1486
1478
|
expect(mockProjectRepository.getByUrl).not.toHaveBeenCalled();
|
|
@@ -1506,7 +1498,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1506
1498
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1507
1499
|
createMockStoryObjectMap(awaitingIssues),
|
|
1508
1500
|
);
|
|
1509
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1510
1501
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1511
1502
|
stdout: '',
|
|
1512
1503
|
stderr: '',
|
|
@@ -1525,6 +1516,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1525
1516
|
utilizationPercentageThreshold: 90,
|
|
1526
1517
|
allowedIssueAuthors: null,
|
|
1527
1518
|
codexHomeCandidates: null,
|
|
1519
|
+
allowIssueCacheMinutes: 0,
|
|
1528
1520
|
});
|
|
1529
1521
|
|
|
1530
1522
|
const normalizedUtilizationBeyondThreshold = (95 - 90) / (100 - 90);
|
|
@@ -1557,6 +1549,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1557
1549
|
utilizationPercentageThreshold: 90,
|
|
1558
1550
|
allowedIssueAuthors: null,
|
|
1559
1551
|
codexHomeCandidates: null,
|
|
1552
|
+
allowIssueCacheMinutes: 0,
|
|
1560
1553
|
}),
|
|
1561
1554
|
).rejects.toThrow('Claude credentials file not found');
|
|
1562
1555
|
|
|
@@ -1581,7 +1574,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1581
1574
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1582
1575
|
createMockStoryObjectMap(awaitingIssues),
|
|
1583
1576
|
);
|
|
1584
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1585
1577
|
|
|
1586
1578
|
await useCase.run({
|
|
1587
1579
|
projectUrl: 'https://github.com/user/repo',
|
|
@@ -1595,6 +1587,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1595
1587
|
utilizationPercentageThreshold: 70,
|
|
1596
1588
|
allowedIssueAuthors: null,
|
|
1597
1589
|
codexHomeCandidates: null,
|
|
1590
|
+
allowIssueCacheMinutes: 0,
|
|
1598
1591
|
});
|
|
1599
1592
|
|
|
1600
1593
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -1619,7 +1612,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1619
1612
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1620
1613
|
createMockStoryObjectMap(awaitingIssues),
|
|
1621
1614
|
);
|
|
1622
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
1623
1615
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1624
1616
|
stdout: '',
|
|
1625
1617
|
stderr: '',
|
|
@@ -1638,6 +1630,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1638
1630
|
utilizationPercentageThreshold: 80,
|
|
1639
1631
|
allowedIssueAuthors: null,
|
|
1640
1632
|
codexHomeCandidates: null,
|
|
1633
|
+
allowIssueCacheMinutes: 0,
|
|
1641
1634
|
});
|
|
1642
1635
|
|
|
1643
1636
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -1664,10 +1657,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1664
1657
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1665
1658
|
createMockStoryObjectMap([issueWithDependency, issueWithoutDependency]),
|
|
1666
1659
|
);
|
|
1667
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
1668
|
-
issueWithDependency,
|
|
1669
|
-
issueWithoutDependency,
|
|
1670
|
-
]);
|
|
1671
1660
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1672
1661
|
stdout: '',
|
|
1673
1662
|
stderr: '',
|
|
@@ -1686,6 +1675,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1686
1675
|
utilizationPercentageThreshold: 90,
|
|
1687
1676
|
allowedIssueAuthors: null,
|
|
1688
1677
|
codexHomeCandidates: null,
|
|
1678
|
+
allowIssueCacheMinutes: 0,
|
|
1689
1679
|
});
|
|
1690
1680
|
|
|
1691
1681
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -1723,10 +1713,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1723
1713
|
issueWithoutNextActionHour,
|
|
1724
1714
|
]),
|
|
1725
1715
|
);
|
|
1726
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
1727
|
-
issueWithFutureNextActionHour,
|
|
1728
|
-
issueWithoutNextActionHour,
|
|
1729
|
-
]);
|
|
1730
1716
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1731
1717
|
stdout: '',
|
|
1732
1718
|
stderr: '',
|
|
@@ -1745,6 +1731,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1745
1731
|
utilizationPercentageThreshold: 90,
|
|
1746
1732
|
allowedIssueAuthors: null,
|
|
1747
1733
|
codexHomeCandidates: null,
|
|
1734
|
+
allowIssueCacheMinutes: 0,
|
|
1748
1735
|
});
|
|
1749
1736
|
|
|
1750
1737
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -1785,10 +1772,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1785
1772
|
issueWithoutNextActionDate,
|
|
1786
1773
|
]),
|
|
1787
1774
|
);
|
|
1788
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
1789
|
-
issueWithFutureNextActionDate,
|
|
1790
|
-
issueWithoutNextActionDate,
|
|
1791
|
-
]);
|
|
1792
1775
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1793
1776
|
stdout: '',
|
|
1794
1777
|
stderr: '',
|
|
@@ -1807,6 +1790,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1807
1790
|
utilizationPercentageThreshold: 90,
|
|
1808
1791
|
allowedIssueAuthors: null,
|
|
1809
1792
|
codexHomeCandidates: null,
|
|
1793
|
+
allowIssueCacheMinutes: 0,
|
|
1810
1794
|
});
|
|
1811
1795
|
|
|
1812
1796
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -1837,9 +1821,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1837
1821
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1838
1822
|
createMockStoryObjectMap([issueWithTodayNextActionDate]),
|
|
1839
1823
|
);
|
|
1840
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
1841
|
-
issueWithTodayNextActionDate,
|
|
1842
|
-
]);
|
|
1843
1824
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1844
1825
|
stdout: '',
|
|
1845
1826
|
stderr: '',
|
|
@@ -1858,6 +1839,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1858
1839
|
utilizationPercentageThreshold: 90,
|
|
1859
1840
|
allowedIssueAuthors: null,
|
|
1860
1841
|
codexHomeCandidates: null,
|
|
1842
|
+
allowIssueCacheMinutes: 0,
|
|
1861
1843
|
});
|
|
1862
1844
|
|
|
1863
1845
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -1888,9 +1870,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1888
1870
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1889
1871
|
createMockStoryObjectMap([issueWithPastNextActionDate]),
|
|
1890
1872
|
);
|
|
1891
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
1892
|
-
issueWithPastNextActionDate,
|
|
1893
|
-
]);
|
|
1894
1873
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1895
1874
|
stdout: '',
|
|
1896
1875
|
stderr: '',
|
|
@@ -1909,6 +1888,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1909
1888
|
utilizationPercentageThreshold: 90,
|
|
1910
1889
|
allowedIssueAuthors: null,
|
|
1911
1890
|
codexHomeCandidates: null,
|
|
1891
|
+
allowIssueCacheMinutes: 0,
|
|
1912
1892
|
});
|
|
1913
1893
|
|
|
1914
1894
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -1939,9 +1919,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1939
1919
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
1940
1920
|
createMockStoryObjectMap([issueWithPastNextActionHour]),
|
|
1941
1921
|
);
|
|
1942
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
1943
|
-
issueWithPastNextActionHour,
|
|
1944
|
-
]);
|
|
1945
1922
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1946
1923
|
stdout: '',
|
|
1947
1924
|
stderr: '',
|
|
@@ -1960,6 +1937,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1960
1937
|
utilizationPercentageThreshold: 90,
|
|
1961
1938
|
allowedIssueAuthors: null,
|
|
1962
1939
|
codexHomeCandidates: null,
|
|
1940
|
+
allowIssueCacheMinutes: 0,
|
|
1963
1941
|
});
|
|
1964
1942
|
|
|
1965
1943
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -1996,10 +1974,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1996
1974
|
issueFromNonAllowedAuthor,
|
|
1997
1975
|
]),
|
|
1998
1976
|
);
|
|
1999
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
2000
|
-
issueFromAllowedAuthor,
|
|
2001
|
-
issueFromNonAllowedAuthor,
|
|
2002
|
-
]);
|
|
2003
1977
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2004
1978
|
stdout: '',
|
|
2005
1979
|
stderr: '',
|
|
@@ -2018,6 +1992,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2018
1992
|
utilizationPercentageThreshold: 90,
|
|
2019
1993
|
allowedIssueAuthors: ['user1', 'user2'],
|
|
2020
1994
|
codexHomeCandidates: null,
|
|
1995
|
+
allowIssueCacheMinutes: 0,
|
|
2021
1996
|
});
|
|
2022
1997
|
|
|
2023
1998
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -2048,7 +2023,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2048
2023
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2049
2024
|
createMockStoryObjectMap([issue1, issue2]),
|
|
2050
2025
|
);
|
|
2051
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([issue1, issue2]);
|
|
2052
2026
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2053
2027
|
stdout: '',
|
|
2054
2028
|
stderr: '',
|
|
@@ -2067,6 +2041,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2067
2041
|
utilizationPercentageThreshold: 90,
|
|
2068
2042
|
allowedIssueAuthors: null,
|
|
2069
2043
|
codexHomeCandidates: null,
|
|
2044
|
+
allowIssueCacheMinutes: 0,
|
|
2070
2045
|
});
|
|
2071
2046
|
|
|
2072
2047
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(2);
|
|
@@ -2093,10 +2068,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2093
2068
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2094
2069
|
createMockStoryObjectMap([towerDefenceIssue, normalIssue]),
|
|
2095
2070
|
);
|
|
2096
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
2097
|
-
towerDefenceIssue,
|
|
2098
|
-
normalIssue,
|
|
2099
|
-
]);
|
|
2100
2071
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2101
2072
|
stdout: '',
|
|
2102
2073
|
stderr: '',
|
|
@@ -2115,6 +2086,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2115
2086
|
utilizationPercentageThreshold: 90,
|
|
2116
2087
|
allowedIssueAuthors: ['user1', 'user2'],
|
|
2117
2088
|
codexHomeCandidates: null,
|
|
2089
|
+
allowIssueCacheMinutes: 0,
|
|
2118
2090
|
});
|
|
2119
2091
|
|
|
2120
2092
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(2);
|
|
@@ -2144,9 +2116,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2144
2116
|
|
|
2145
2117
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2146
2118
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(storyObjectMap);
|
|
2147
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([
|
|
2148
|
-
issueWithoutAuthor,
|
|
2149
|
-
]);
|
|
2150
2119
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2151
2120
|
stdout: '',
|
|
2152
2121
|
stderr: '',
|
|
@@ -2165,6 +2134,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2165
2134
|
utilizationPercentageThreshold: 90,
|
|
2166
2135
|
allowedIssueAuthors: ['user1'],
|
|
2167
2136
|
codexHomeCandidates: null,
|
|
2137
|
+
allowIssueCacheMinutes: 0,
|
|
2168
2138
|
});
|
|
2169
2139
|
|
|
2170
2140
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -2184,7 +2154,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2184
2154
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2185
2155
|
createMockStoryObjectMap(awaitingIssues),
|
|
2186
2156
|
);
|
|
2187
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
2188
2157
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2189
2158
|
stdout: '',
|
|
2190
2159
|
stderr: '',
|
|
@@ -2203,6 +2172,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2203
2172
|
utilizationPercentageThreshold: 90,
|
|
2204
2173
|
allowedIssueAuthors: null,
|
|
2205
2174
|
codexHomeCandidates: null,
|
|
2175
|
+
allowIssueCacheMinutes: 0,
|
|
2206
2176
|
});
|
|
2207
2177
|
|
|
2208
2178
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
@@ -2233,7 +2203,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2233
2203
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2234
2204
|
createMockStoryObjectMap(awaitingIssues),
|
|
2235
2205
|
);
|
|
2236
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
2237
2206
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2238
2207
|
stdout: '',
|
|
2239
2208
|
stderr: '',
|
|
@@ -2252,6 +2221,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2252
2221
|
utilizationPercentageThreshold: 90,
|
|
2253
2222
|
allowedIssueAuthors: null,
|
|
2254
2223
|
codexHomeCandidates: [],
|
|
2224
|
+
allowIssueCacheMinutes: 0,
|
|
2255
2225
|
});
|
|
2256
2226
|
|
|
2257
2227
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
@@ -2282,7 +2252,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2282
2252
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2283
2253
|
createMockStoryObjectMap(awaitingIssues),
|
|
2284
2254
|
);
|
|
2285
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
2286
2255
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2287
2256
|
stdout: '',
|
|
2288
2257
|
stderr: '',
|
|
@@ -2301,6 +2270,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2301
2270
|
utilizationPercentageThreshold: 90,
|
|
2302
2271
|
allowedIssueAuthors: null,
|
|
2303
2272
|
codexHomeCandidates: ['.codex-dev1'],
|
|
2273
|
+
allowIssueCacheMinutes: 0,
|
|
2304
2274
|
});
|
|
2305
2275
|
|
|
2306
2276
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
@@ -2351,7 +2321,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2351
2321
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2352
2322
|
createMockStoryObjectMap(awaitingIssues),
|
|
2353
2323
|
);
|
|
2354
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce(awaitingIssues);
|
|
2355
2324
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2356
2325
|
stdout: '',
|
|
2357
2326
|
stderr: '',
|
|
@@ -2370,6 +2339,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2370
2339
|
utilizationPercentageThreshold: 90,
|
|
2371
2340
|
allowedIssueAuthors: null,
|
|
2372
2341
|
codexHomeCandidates: ['.codex-dev1', '.codex-dev2'],
|
|
2342
|
+
allowIssueCacheMinutes: 0,
|
|
2373
2343
|
});
|
|
2374
2344
|
|
|
2375
2345
|
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(3);
|
|
@@ -2417,7 +2387,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2417
2387
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2418
2388
|
createMockStoryObjectMap([awaitingIssue]),
|
|
2419
2389
|
);
|
|
2420
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([awaitingIssue]);
|
|
2421
2390
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2422
2391
|
stdout: '',
|
|
2423
2392
|
stderr: '',
|
|
@@ -2436,6 +2405,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2436
2405
|
utilizationPercentageThreshold: 90,
|
|
2437
2406
|
allowedIssueAuthors: null,
|
|
2438
2407
|
codexHomeCandidates: null,
|
|
2408
|
+
allowIssueCacheMinutes: 0,
|
|
2439
2409
|
});
|
|
2440
2410
|
|
|
2441
2411
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
@@ -2482,7 +2452,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2482
2452
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2483
2453
|
createMockStoryObjectMap([awaitingIssue]),
|
|
2484
2454
|
);
|
|
2485
|
-
mockIssueRepository.getAllOpened.mockResolvedValueOnce([awaitingIssue]);
|
|
2486
2455
|
const consoleErrorSpy = jest
|
|
2487
2456
|
.spyOn(console, 'error')
|
|
2488
2457
|
.mockImplementation(() => {});
|
|
@@ -2499,6 +2468,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2499
2468
|
utilizationPercentageThreshold: 90,
|
|
2500
2469
|
allowedIssueAuthors: null,
|
|
2501
2470
|
codexHomeCandidates: null,
|
|
2471
|
+
allowIssueCacheMinutes: 0,
|
|
2502
2472
|
});
|
|
2503
2473
|
|
|
2504
2474
|
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(0);
|
|
@@ -2508,4 +2478,31 @@ describe('StartPreparationUseCase', () => {
|
|
|
2508
2478
|
);
|
|
2509
2479
|
consoleErrorSpy.mockRestore();
|
|
2510
2480
|
});
|
|
2481
|
+
|
|
2482
|
+
it('should pass allowIssueCacheMinutes to getStoryObjectMap', async () => {
|
|
2483
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2484
|
+
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2485
|
+
createMockStoryObjectMap([]),
|
|
2486
|
+
);
|
|
2487
|
+
|
|
2488
|
+
await useCase.run({
|
|
2489
|
+
projectUrl: 'https://github.com/user/repo',
|
|
2490
|
+
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2491
|
+
preparationStatus: 'Preparation',
|
|
2492
|
+
defaultAgentName: 'agent1',
|
|
2493
|
+
defaultLlmModelName: null,
|
|
2494
|
+
defaultLlmAgentName: null,
|
|
2495
|
+
configFilePath: '/path/to/config.yml',
|
|
2496
|
+
maximumPreparingIssuesCount: null,
|
|
2497
|
+
utilizationPercentageThreshold: 90,
|
|
2498
|
+
allowedIssueAuthors: null,
|
|
2499
|
+
codexHomeCandidates: null,
|
|
2500
|
+
allowIssueCacheMinutes: 5,
|
|
2501
|
+
});
|
|
2502
|
+
|
|
2503
|
+
expect(mockIssueRepository.getStoryObjectMap).toHaveBeenCalledWith(
|
|
2504
|
+
expect.objectContaining({ id: 'project-1' }),
|
|
2505
|
+
5,
|
|
2506
|
+
);
|
|
2507
|
+
});
|
|
2511
2508
|
});
|