github-issue-tower-defence-management 1.47.0 → 1.48.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.
- package/CHANGELOG.md +12 -0
- package/README.md +6 -25
- package/bin/adapter/entry-points/cli/index.js +2 -55
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/cli/projectConfig.js +0 -15
- package/bin/adapter/entry-points/cli/projectConfig.js.map +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +12 -53
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/repositories/GraphqlProjectRepository.js +37 -0
- package/bin/adapter/repositories/GraphqlProjectRepository.js.map +1 -1
- package/bin/domain/entities/WorkflowStatus.js +36 -0
- package/bin/domain/entities/WorkflowStatus.js.map +1 -0
- package/bin/domain/usecases/AnalyzeStoriesUseCase.js +2 -1
- package/bin/domain/usecases/AnalyzeStoriesUseCase.js.map +1 -1
- package/bin/domain/usecases/ChangeStatusByStoryColorUseCase.js +4 -3
- package/bin/domain/usecases/ChangeStatusByStoryColorUseCase.js.map +1 -1
- package/bin/domain/usecases/ConvertCheckboxToIssueInStoryIssueUseCase.js +2 -1
- package/bin/domain/usecases/ConvertCheckboxToIssueInStoryIssueUseCase.js.map +1 -1
- package/bin/domain/usecases/CreateEstimationIssueUseCase.js +2 -1
- package/bin/domain/usecases/CreateEstimationIssueUseCase.js.map +1 -1
- package/bin/domain/usecases/CreateNewStoryByLabelUseCase.js.map +1 -1
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +9 -17
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js +13 -15
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js +4 -5
- package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/SetupTowerDefenceProjectUseCase.js +47 -0
- package/bin/domain/usecases/SetupTowerDefenceProjectUseCase.js.map +1 -0
- package/bin/domain/usecases/StartPreparationUseCase.js +7 -8
- package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/UpdateIssueStatusByLabelUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/index.test.ts +8 -212
- package/src/adapter/entry-points/cli/index.ts +6 -88
- package/src/adapter/entry-points/cli/projectConfig.ts +0 -33
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.test.ts +5 -17
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +16 -32
- package/src/adapter/repositories/GraphqlProjectRepository.ts +55 -1
- package/src/domain/entities/WorkflowStatus.ts +41 -0
- package/src/domain/usecases/AnalyzeStoriesUseCase.ts +2 -2
- package/src/domain/usecases/ChangeStatusByStoryColorUseCase.test.ts +5 -10
- package/src/domain/usecases/ChangeStatusByStoryColorUseCase.ts +4 -4
- package/src/domain/usecases/ConvertCheckboxToIssueInStoryIssueUseCase.test.ts +0 -11
- package/src/domain/usecases/ConvertCheckboxToIssueInStoryIssueUseCase.ts +2 -2
- package/src/domain/usecases/CreateEstimationIssueUseCase.ts +2 -2
- package/src/domain/usecases/CreateNewStoryByLabelUseCase.test.ts +0 -4
- package/src/domain/usecases/CreateNewStoryByLabelUseCase.ts +0 -1
- package/src/domain/usecases/HandleScheduledEventUseCase.test.ts +4 -41
- package/src/domain/usecases/HandleScheduledEventUseCase.ts +9 -27
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.test.ts +0 -202
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.ts +18 -31
- package/src/domain/usecases/RevertOrphanedPreparationUseCase.test.ts +13 -101
- package/src/domain/usecases/RevertOrphanedPreparationUseCase.ts +10 -10
- package/src/domain/usecases/SetupTowerDefenceProjectUseCase.test.ts +187 -0
- package/src/domain/usecases/SetupTowerDefenceProjectUseCase.ts +69 -0
- package/src/domain/usecases/StartPreparationUseCase.test.ts +1 -151
- package/src/domain/usecases/StartPreparationUseCase.ts +11 -20
- package/src/domain/usecases/UpdateIssueStatusByLabelUseCase.test.ts +2 -47
- package/src/domain/usecases/UpdateIssueStatusByLabelUseCase.ts +1 -5
- package/src/domain/usecases/adapter-interfaces/ProjectRepository.ts +6 -1
- package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
- package/types/adapter/entry-points/cli/projectConfig.d.ts +0 -3
- package/types/adapter/entry-points/cli/projectConfig.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/repositories/GraphqlProjectRepository.d.ts +4 -1
- package/types/adapter/repositories/GraphqlProjectRepository.d.ts.map +1 -1
- package/types/domain/entities/WorkflowStatus.d.ts +13 -0
- package/types/domain/entities/WorkflowStatus.d.ts.map +1 -0
- package/types/domain/usecases/AnalyzeStoriesUseCase.d.ts +0 -1
- package/types/domain/usecases/AnalyzeStoriesUseCase.d.ts.map +1 -1
- package/types/domain/usecases/ChangeStatusByStoryColorUseCase.d.ts +0 -1
- package/types/domain/usecases/ChangeStatusByStoryColorUseCase.d.ts.map +1 -1
- package/types/domain/usecases/ConvertCheckboxToIssueInStoryIssueUseCase.d.ts +0 -1
- package/types/domain/usecases/ConvertCheckboxToIssueInStoryIssueUseCase.d.ts.map +1 -1
- package/types/domain/usecases/CreateEstimationIssueUseCase.d.ts +0 -1
- package/types/domain/usecases/CreateEstimationIssueUseCase.d.ts.map +1 -1
- package/types/domain/usecases/CreateNewStoryByLabelUseCase.d.ts +0 -1
- package/types/domain/usecases/CreateNewStoryByLabelUseCase.d.ts.map +1 -1
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts +3 -8
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts +1 -4
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/RevertOrphanedPreparationUseCase.d.ts +0 -3
- package/types/domain/usecases/RevertOrphanedPreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/SetupTowerDefenceProjectUseCase.d.ts +10 -0
- package/types/domain/usecases/SetupTowerDefenceProjectUseCase.d.ts.map +1 -0
- package/types/domain/usecases/StartPreparationUseCase.d.ts +1 -3
- package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/UpdateIssueStatusByLabelUseCase.d.ts +0 -1
- package/types/domain/usecases/UpdateIssueStatusByLabelUseCase.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/ProjectRepository.d.ts +3 -1
- package/types/domain/usecases/adapter-interfaces/ProjectRepository.d.ts.map +1 -1
|
@@ -77,9 +77,7 @@ const createMockProject = (): Project => ({
|
|
|
77
77
|
|
|
78
78
|
describe('StartPreparationUseCase', () => {
|
|
79
79
|
let useCase: StartPreparationUseCase;
|
|
80
|
-
let mockProjectRepository: Mocked<
|
|
81
|
-
Pick<ProjectRepository, 'getByUrl' | 'prepareStatus'>
|
|
82
|
-
>;
|
|
80
|
+
let mockProjectRepository: Mocked<Pick<ProjectRepository, 'getByUrl'>>;
|
|
83
81
|
let mockIssueRepository: Mocked<
|
|
84
82
|
Pick<
|
|
85
83
|
IssueRepository,
|
|
@@ -100,11 +98,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
100
98
|
mockProject = createMockProject();
|
|
101
99
|
mockProjectRepository = {
|
|
102
100
|
getByUrl: jest.fn(),
|
|
103
|
-
prepareStatus: jest
|
|
104
|
-
.fn()
|
|
105
|
-
.mockImplementation((_name: string, project: Project) =>
|
|
106
|
-
Promise.resolve(project),
|
|
107
|
-
),
|
|
108
101
|
};
|
|
109
102
|
mockIssueRepository = {
|
|
110
103
|
getStoryObjectMap: jest.fn().mockResolvedValue(new Map()),
|
|
@@ -128,44 +121,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
128
121
|
mockLocalCommandRunner,
|
|
129
122
|
);
|
|
130
123
|
});
|
|
131
|
-
it('should call prepareStatus for awaitingWorkspaceStatus and preparationStatus with chained project objects', async () => {
|
|
132
|
-
const projectAfterFirstPrepare = createMockProject();
|
|
133
|
-
const projectAfterSecondPrepare = createMockProject();
|
|
134
|
-
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
135
|
-
mockProjectRepository.prepareStatus
|
|
136
|
-
.mockResolvedValueOnce(projectAfterFirstPrepare)
|
|
137
|
-
.mockResolvedValueOnce(projectAfterSecondPrepare);
|
|
138
|
-
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
139
|
-
createMockStoryObjectMap([]),
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
await useCase.run({
|
|
143
|
-
projectUrl: 'https://github.com/user/repo',
|
|
144
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
145
|
-
preparationStatus: 'Preparation',
|
|
146
|
-
defaultAgentName: 'agent1',
|
|
147
|
-
defaultLlmModelName: null,
|
|
148
|
-
defaultLlmAgentName: null,
|
|
149
|
-
configFilePath: '/path/to/config.yml',
|
|
150
|
-
maximumPreparingIssuesCount: null,
|
|
151
|
-
utilizationPercentageThreshold: 90,
|
|
152
|
-
allowedIssueAuthors: null,
|
|
153
|
-
codexHomeCandidates: null,
|
|
154
|
-
allowIssueCacheMinutes: 0,
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
expect(mockProjectRepository.prepareStatus).toHaveBeenCalledTimes(2);
|
|
158
|
-
expect(mockProjectRepository.prepareStatus).toHaveBeenNthCalledWith(
|
|
159
|
-
1,
|
|
160
|
-
'Awaiting Workspace',
|
|
161
|
-
mockProject,
|
|
162
|
-
);
|
|
163
|
-
expect(mockProjectRepository.prepareStatus).toHaveBeenNthCalledWith(
|
|
164
|
-
2,
|
|
165
|
-
'Preparation',
|
|
166
|
-
projectAfterFirstPrepare,
|
|
167
|
-
);
|
|
168
|
-
});
|
|
169
124
|
it('should run aw command for awaiting workspace issues', async () => {
|
|
170
125
|
const awaitingIssues: Issue[] = [
|
|
171
126
|
createMockIssue({
|
|
@@ -186,8 +141,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
186
141
|
});
|
|
187
142
|
await useCase.run({
|
|
188
143
|
projectUrl: 'https://github.com/user/repo',
|
|
189
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
190
|
-
preparationStatus: 'Preparation',
|
|
191
144
|
defaultAgentName: 'agent1',
|
|
192
145
|
defaultLlmModelName: 'claude-opus',
|
|
193
146
|
defaultLlmAgentName: null,
|
|
@@ -251,8 +204,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
251
204
|
});
|
|
252
205
|
await useCase.run({
|
|
253
206
|
projectUrl: 'https://github.com/user/repo',
|
|
254
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
255
|
-
preparationStatus: 'Preparation',
|
|
256
207
|
defaultAgentName: 'agent1',
|
|
257
208
|
defaultLlmModelName: 'claude-opus',
|
|
258
209
|
defaultLlmAgentName: null,
|
|
@@ -308,8 +259,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
308
259
|
});
|
|
309
260
|
await useCase.run({
|
|
310
261
|
projectUrl: 'https://github.com/user/repo',
|
|
311
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
312
|
-
preparationStatus: 'Preparation',
|
|
313
262
|
defaultAgentName: 'agent1',
|
|
314
263
|
defaultLlmModelName: 'claude-opus',
|
|
315
264
|
defaultLlmAgentName: null,
|
|
@@ -357,8 +306,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
357
306
|
.mockImplementation(() => {});
|
|
358
307
|
await useCase.run({
|
|
359
308
|
projectUrl: 'https://github.com/user/repo',
|
|
360
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
361
|
-
preparationStatus: 'Preparation',
|
|
362
309
|
defaultAgentName: 'agent1',
|
|
363
310
|
defaultLlmModelName: 'claude-opus',
|
|
364
311
|
defaultLlmAgentName: null,
|
|
@@ -406,8 +353,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
406
353
|
.mockImplementation(() => {});
|
|
407
354
|
await useCase.run({
|
|
408
355
|
projectUrl: 'https://github.com/user/repo',
|
|
409
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
410
|
-
preparationStatus: 'Preparation',
|
|
411
356
|
defaultAgentName: 'agent1',
|
|
412
357
|
defaultLlmModelName: 'claude-opus',
|
|
413
358
|
defaultLlmAgentName: null,
|
|
@@ -454,8 +399,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
454
399
|
.mockImplementation(() => {});
|
|
455
400
|
await useCase.run({
|
|
456
401
|
projectUrl: 'https://github.com/user/repo',
|
|
457
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
458
|
-
preparationStatus: 'Preparation',
|
|
459
402
|
defaultAgentName: 'agent1',
|
|
460
403
|
defaultLlmModelName: 'claude-opus',
|
|
461
404
|
defaultLlmAgentName: null,
|
|
@@ -519,8 +462,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
519
462
|
});
|
|
520
463
|
await useCase.run({
|
|
521
464
|
projectUrl: 'https://github.com/user/repo',
|
|
522
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
523
|
-
preparationStatus: 'Preparation',
|
|
524
465
|
defaultAgentName: 'agent1',
|
|
525
466
|
defaultLlmModelName: 'claude-opus',
|
|
526
467
|
defaultLlmAgentName: null,
|
|
@@ -607,8 +548,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
607
548
|
.mockImplementation(() => {});
|
|
608
549
|
await useCase.run({
|
|
609
550
|
projectUrl: 'https://github.com/user/repo',
|
|
610
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
611
|
-
preparationStatus: 'Preparation',
|
|
612
551
|
defaultAgentName: 'agent1',
|
|
613
552
|
defaultLlmModelName: 'claude-opus',
|
|
614
553
|
defaultLlmAgentName: null,
|
|
@@ -670,8 +609,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
670
609
|
.mockImplementation(() => {});
|
|
671
610
|
await useCase.run({
|
|
672
611
|
projectUrl: 'https://github.com/user/repo',
|
|
673
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
674
|
-
preparationStatus: 'Preparation',
|
|
675
612
|
defaultAgentName: 'agent1',
|
|
676
613
|
defaultLlmModelName: 'claude-opus',
|
|
677
614
|
defaultLlmAgentName: null,
|
|
@@ -715,8 +652,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
715
652
|
});
|
|
716
653
|
await useCase.run({
|
|
717
654
|
projectUrl: 'https://github.com/user/repo',
|
|
718
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
719
|
-
preparationStatus: 'Preparation',
|
|
720
655
|
defaultAgentName: 'agent1',
|
|
721
656
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
722
657
|
defaultLlmAgentName: null,
|
|
@@ -773,8 +708,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
773
708
|
});
|
|
774
709
|
await useCase.run({
|
|
775
710
|
projectUrl: 'https://github.com/user/repo',
|
|
776
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
777
|
-
preparationStatus: 'Preparation',
|
|
778
711
|
defaultAgentName: 'agent1',
|
|
779
712
|
defaultLlmModelName: null,
|
|
780
713
|
defaultLlmAgentName: null,
|
|
@@ -809,8 +742,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
809
742
|
});
|
|
810
743
|
await useCase.run({
|
|
811
744
|
projectUrl: 'https://github.com/user/repo',
|
|
812
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
813
|
-
preparationStatus: 'Preparation',
|
|
814
745
|
defaultAgentName: 'agent1',
|
|
815
746
|
defaultLlmModelName: 'claude-opus',
|
|
816
747
|
defaultLlmAgentName: null,
|
|
@@ -855,8 +786,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
855
786
|
});
|
|
856
787
|
await useCase.run({
|
|
857
788
|
projectUrl: 'https://github.com/user/repo',
|
|
858
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
859
|
-
preparationStatus: 'Preparation',
|
|
860
789
|
defaultAgentName: 'agent1',
|
|
861
790
|
defaultLlmModelName: 'claude-opus',
|
|
862
791
|
defaultLlmAgentName: null,
|
|
@@ -901,8 +830,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
901
830
|
});
|
|
902
831
|
await useCase.run({
|
|
903
832
|
projectUrl: 'https://github.com/user/repo',
|
|
904
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
905
|
-
preparationStatus: 'Preparation',
|
|
906
833
|
defaultAgentName: 'agent1',
|
|
907
834
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
908
835
|
defaultLlmAgentName: 'default-llm-agent',
|
|
@@ -947,8 +874,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
947
874
|
});
|
|
948
875
|
await useCase.run({
|
|
949
876
|
projectUrl: 'https://github.com/user/repo',
|
|
950
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
951
|
-
preparationStatus: 'Preparation',
|
|
952
877
|
defaultAgentName: 'agent1',
|
|
953
878
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
954
879
|
defaultLlmAgentName: 'default-llm-agent',
|
|
@@ -993,8 +918,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
993
918
|
});
|
|
994
919
|
await useCase.run({
|
|
995
920
|
projectUrl: 'https://github.com/user/repo',
|
|
996
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
997
|
-
preparationStatus: 'Preparation',
|
|
998
921
|
defaultAgentName: 'agent1',
|
|
999
922
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1000
923
|
defaultLlmAgentName: 'default-llm-agent',
|
|
@@ -1039,8 +962,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1039
962
|
});
|
|
1040
963
|
await useCase.run({
|
|
1041
964
|
projectUrl: 'https://github.com/user/repo',
|
|
1042
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1043
|
-
preparationStatus: 'Preparation',
|
|
1044
965
|
defaultAgentName: 'agent1',
|
|
1045
966
|
defaultLlmModelName: 'claude-opus',
|
|
1046
967
|
defaultLlmAgentName: null,
|
|
@@ -1088,8 +1009,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1088
1009
|
.mockImplementation(() => {});
|
|
1089
1010
|
await useCase.run({
|
|
1090
1011
|
projectUrl: 'https://github.com/user/repo',
|
|
1091
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1092
|
-
preparationStatus: 'Preparation',
|
|
1093
1012
|
defaultAgentName: 'agent1',
|
|
1094
1013
|
defaultLlmModelName: null,
|
|
1095
1014
|
defaultLlmAgentName: null,
|
|
@@ -1137,8 +1056,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1137
1056
|
.mockImplementation(() => {});
|
|
1138
1057
|
await useCase.run({
|
|
1139
1058
|
projectUrl: 'https://github.com/user/repo',
|
|
1140
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1141
|
-
preparationStatus: 'Preparation',
|
|
1142
1059
|
defaultAgentName: 'agent1',
|
|
1143
1060
|
defaultLlmModelName: null,
|
|
1144
1061
|
defaultLlmAgentName: null,
|
|
@@ -1188,8 +1105,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1188
1105
|
});
|
|
1189
1106
|
await useCase.run({
|
|
1190
1107
|
projectUrl: 'https://github.com/user/repo',
|
|
1191
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1192
|
-
preparationStatus: 'Preparation',
|
|
1193
1108
|
defaultAgentName: 'agent1',
|
|
1194
1109
|
defaultLlmModelName: null,
|
|
1195
1110
|
defaultLlmAgentName: null,
|
|
@@ -1224,8 +1139,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1224
1139
|
});
|
|
1225
1140
|
await useCase.run({
|
|
1226
1141
|
projectUrl: 'https://github.com/user/repo',
|
|
1227
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1228
|
-
preparationStatus: 'Preparation',
|
|
1229
1142
|
defaultAgentName: 'agent1',
|
|
1230
1143
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1231
1144
|
defaultLlmAgentName: null,
|
|
@@ -1259,8 +1172,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1259
1172
|
});
|
|
1260
1173
|
await useCase.run({
|
|
1261
1174
|
projectUrl: 'https://github.com/user/repo',
|
|
1262
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1263
|
-
preparationStatus: 'Preparation',
|
|
1264
1175
|
defaultAgentName: 'agent1',
|
|
1265
1176
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1266
1177
|
defaultLlmAgentName: null,
|
|
@@ -1324,8 +1235,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1324
1235
|
|
|
1325
1236
|
await useCase.run({
|
|
1326
1237
|
projectUrl: 'https://github.com/user/repo',
|
|
1327
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1328
|
-
preparationStatus: 'Preparation',
|
|
1329
1238
|
defaultAgentName: 'agent1',
|
|
1330
1239
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1331
1240
|
defaultLlmAgentName: null,
|
|
@@ -1365,8 +1274,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1365
1274
|
|
|
1366
1275
|
await useCase.run({
|
|
1367
1276
|
projectUrl: 'https://github.com/user/repo',
|
|
1368
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1369
|
-
preparationStatus: 'Preparation',
|
|
1370
1277
|
defaultAgentName: 'agent1',
|
|
1371
1278
|
defaultLlmModelName: null,
|
|
1372
1279
|
defaultLlmAgentName: null,
|
|
@@ -1409,8 +1316,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1409
1316
|
|
|
1410
1317
|
await useCase.run({
|
|
1411
1318
|
projectUrl: 'https://github.com/user/repo',
|
|
1412
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1413
|
-
preparationStatus: 'Preparation',
|
|
1414
1319
|
defaultAgentName: 'agent1',
|
|
1415
1320
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1416
1321
|
defaultLlmAgentName: null,
|
|
@@ -1452,8 +1357,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1452
1357
|
|
|
1453
1358
|
await useCase.run({
|
|
1454
1359
|
projectUrl: 'https://github.com/user/repo',
|
|
1455
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1456
|
-
preparationStatus: 'Preparation',
|
|
1457
1360
|
defaultAgentName: 'agent1',
|
|
1458
1361
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1459
1362
|
defaultLlmAgentName: null,
|
|
@@ -1501,8 +1404,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1501
1404
|
|
|
1502
1405
|
await useCase.run({
|
|
1503
1406
|
projectUrl: 'https://github.com/user/repo',
|
|
1504
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1505
|
-
preparationStatus: 'Preparation',
|
|
1506
1407
|
defaultAgentName: 'agent1',
|
|
1507
1408
|
defaultLlmModelName: null,
|
|
1508
1409
|
defaultLlmAgentName: null,
|
|
@@ -1543,8 +1444,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1543
1444
|
|
|
1544
1445
|
await useCase.run({
|
|
1545
1446
|
projectUrl: 'https://github.com/user/repo',
|
|
1546
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1547
|
-
preparationStatus: 'Preparation',
|
|
1548
1447
|
defaultAgentName: 'agent1',
|
|
1549
1448
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1550
1449
|
defaultLlmAgentName: null,
|
|
@@ -1580,8 +1479,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1580
1479
|
|
|
1581
1480
|
await useCase.run({
|
|
1582
1481
|
projectUrl: 'https://github.com/user/repo',
|
|
1583
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1584
|
-
preparationStatus: 'Preparation',
|
|
1585
1482
|
defaultAgentName: 'agent1',
|
|
1586
1483
|
defaultLlmModelName: null,
|
|
1587
1484
|
defaultLlmAgentName: null,
|
|
@@ -1624,8 +1521,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1624
1521
|
|
|
1625
1522
|
await useCase.run({
|
|
1626
1523
|
projectUrl: 'https://github.com/user/repo',
|
|
1627
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1628
|
-
preparationStatus: 'Preparation',
|
|
1629
1524
|
defaultAgentName: 'agent1',
|
|
1630
1525
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1631
1526
|
defaultLlmAgentName: null,
|
|
@@ -1657,8 +1552,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1657
1552
|
await expect(
|
|
1658
1553
|
useCase.run({
|
|
1659
1554
|
projectUrl: 'https://github.com/user/repo',
|
|
1660
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1661
|
-
preparationStatus: 'Preparation',
|
|
1662
1555
|
defaultAgentName: 'agent1',
|
|
1663
1556
|
defaultLlmModelName: null,
|
|
1664
1557
|
defaultLlmAgentName: null,
|
|
@@ -1695,8 +1588,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1695
1588
|
|
|
1696
1589
|
await useCase.run({
|
|
1697
1590
|
projectUrl: 'https://github.com/user/repo',
|
|
1698
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1699
|
-
preparationStatus: 'Preparation',
|
|
1700
1591
|
defaultAgentName: 'agent1',
|
|
1701
1592
|
defaultLlmModelName: null,
|
|
1702
1593
|
defaultLlmAgentName: null,
|
|
@@ -1738,8 +1629,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1738
1629
|
|
|
1739
1630
|
await useCase.run({
|
|
1740
1631
|
projectUrl: 'https://github.com/user/repo',
|
|
1741
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1742
|
-
preparationStatus: 'Preparation',
|
|
1743
1632
|
defaultAgentName: 'agent1',
|
|
1744
1633
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1745
1634
|
defaultLlmAgentName: null,
|
|
@@ -1783,8 +1672,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1783
1672
|
|
|
1784
1673
|
await useCase.run({
|
|
1785
1674
|
projectUrl: 'https://github.com/user/repo',
|
|
1786
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1787
|
-
preparationStatus: 'Preparation',
|
|
1788
1675
|
defaultAgentName: 'agent1',
|
|
1789
1676
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1790
1677
|
defaultLlmAgentName: null,
|
|
@@ -1839,8 +1726,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1839
1726
|
|
|
1840
1727
|
await useCase.run({
|
|
1841
1728
|
projectUrl: 'https://github.com/user/repo',
|
|
1842
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1843
|
-
preparationStatus: 'Preparation',
|
|
1844
1729
|
defaultAgentName: 'agent1',
|
|
1845
1730
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1846
1731
|
defaultLlmAgentName: null,
|
|
@@ -1898,8 +1783,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1898
1783
|
|
|
1899
1784
|
await useCase.run({
|
|
1900
1785
|
projectUrl: 'https://github.com/user/repo',
|
|
1901
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1902
|
-
preparationStatus: 'Preparation',
|
|
1903
1786
|
defaultAgentName: 'agent1',
|
|
1904
1787
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1905
1788
|
defaultLlmAgentName: null,
|
|
@@ -1947,8 +1830,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1947
1830
|
|
|
1948
1831
|
await useCase.run({
|
|
1949
1832
|
projectUrl: 'https://github.com/user/repo',
|
|
1950
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1951
|
-
preparationStatus: 'Preparation',
|
|
1952
1833
|
defaultAgentName: 'agent1',
|
|
1953
1834
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
1954
1835
|
defaultLlmAgentName: null,
|
|
@@ -1996,8 +1877,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
1996
1877
|
|
|
1997
1878
|
await useCase.run({
|
|
1998
1879
|
projectUrl: 'https://github.com/user/repo',
|
|
1999
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2000
|
-
preparationStatus: 'Preparation',
|
|
2001
1880
|
defaultAgentName: 'agent1',
|
|
2002
1881
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
2003
1882
|
defaultLlmAgentName: null,
|
|
@@ -2045,8 +1924,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2045
1924
|
|
|
2046
1925
|
await useCase.run({
|
|
2047
1926
|
projectUrl: 'https://github.com/user/repo',
|
|
2048
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2049
|
-
preparationStatus: 'Preparation',
|
|
2050
1927
|
defaultAgentName: 'agent1',
|
|
2051
1928
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
2052
1929
|
defaultLlmAgentName: null,
|
|
@@ -2100,8 +1977,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2100
1977
|
|
|
2101
1978
|
await useCase.run({
|
|
2102
1979
|
projectUrl: 'https://github.com/user/repo',
|
|
2103
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2104
|
-
preparationStatus: 'Preparation',
|
|
2105
1980
|
defaultAgentName: 'agent1',
|
|
2106
1981
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
2107
1982
|
defaultLlmAgentName: null,
|
|
@@ -2149,8 +2024,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2149
2024
|
|
|
2150
2025
|
await useCase.run({
|
|
2151
2026
|
projectUrl: 'https://github.com/user/repo',
|
|
2152
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2153
|
-
preparationStatus: 'Preparation',
|
|
2154
2027
|
defaultAgentName: 'agent1',
|
|
2155
2028
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
2156
2029
|
defaultLlmAgentName: null,
|
|
@@ -2194,8 +2067,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2194
2067
|
|
|
2195
2068
|
await useCase.run({
|
|
2196
2069
|
projectUrl: 'https://github.com/user/repo',
|
|
2197
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2198
|
-
preparationStatus: 'Preparation',
|
|
2199
2070
|
defaultAgentName: 'agent1',
|
|
2200
2071
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
2201
2072
|
defaultLlmAgentName: null,
|
|
@@ -2242,8 +2113,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2242
2113
|
|
|
2243
2114
|
await useCase.run({
|
|
2244
2115
|
projectUrl: 'https://github.com/user/repo',
|
|
2245
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2246
|
-
preparationStatus: 'Preparation',
|
|
2247
2116
|
defaultAgentName: 'agent1',
|
|
2248
2117
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
2249
2118
|
defaultLlmAgentName: null,
|
|
@@ -2280,8 +2149,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2280
2149
|
|
|
2281
2150
|
await useCase.run({
|
|
2282
2151
|
projectUrl: 'https://github.com/user/repo',
|
|
2283
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2284
|
-
preparationStatus: 'Preparation',
|
|
2285
2152
|
defaultAgentName: 'agent1',
|
|
2286
2153
|
defaultLlmModelName: 'claude-opus',
|
|
2287
2154
|
defaultLlmAgentName: null,
|
|
@@ -2329,8 +2196,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2329
2196
|
|
|
2330
2197
|
await useCase.run({
|
|
2331
2198
|
projectUrl: 'https://github.com/user/repo',
|
|
2332
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2333
|
-
preparationStatus: 'Preparation',
|
|
2334
2199
|
defaultAgentName: 'agent1',
|
|
2335
2200
|
defaultLlmModelName: 'claude-opus',
|
|
2336
2201
|
defaultLlmAgentName: null,
|
|
@@ -2378,8 +2243,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2378
2243
|
|
|
2379
2244
|
await useCase.run({
|
|
2380
2245
|
projectUrl: 'https://github.com/user/repo',
|
|
2381
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2382
|
-
preparationStatus: 'Preparation',
|
|
2383
2246
|
defaultAgentName: 'agent1',
|
|
2384
2247
|
defaultLlmModelName: 'claude-opus',
|
|
2385
2248
|
defaultLlmAgentName: null,
|
|
@@ -2447,8 +2310,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2447
2310
|
|
|
2448
2311
|
await useCase.run({
|
|
2449
2312
|
projectUrl: 'https://github.com/user/repo',
|
|
2450
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2451
|
-
preparationStatus: 'Preparation',
|
|
2452
2313
|
defaultAgentName: 'agent1',
|
|
2453
2314
|
defaultLlmModelName: 'claude-opus',
|
|
2454
2315
|
defaultLlmAgentName: null,
|
|
@@ -2513,8 +2374,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2513
2374
|
|
|
2514
2375
|
await useCase.run({
|
|
2515
2376
|
projectUrl: 'https://github.com/user/repo',
|
|
2516
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2517
|
-
preparationStatus: 'Preparation',
|
|
2518
2377
|
defaultAgentName: 'agent1',
|
|
2519
2378
|
defaultLlmModelName: 'claude-opus',
|
|
2520
2379
|
defaultLlmAgentName: null,
|
|
@@ -2564,9 +2423,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2564
2423
|
status: 'Awaiting Workspace',
|
|
2565
2424
|
});
|
|
2566
2425
|
mockProjectRepository.getByUrl.mockResolvedValue(projectWithoutPreparation);
|
|
2567
|
-
mockProjectRepository.prepareStatus.mockImplementation(() =>
|
|
2568
|
-
Promise.resolve(projectWithoutPreparation),
|
|
2569
|
-
);
|
|
2570
2426
|
mockIssueRepository.getStoryObjectMap.mockResolvedValue(
|
|
2571
2427
|
createMockStoryObjectMap([awaitingIssue]),
|
|
2572
2428
|
);
|
|
@@ -2576,8 +2432,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2576
2432
|
|
|
2577
2433
|
await useCase.run({
|
|
2578
2434
|
projectUrl: 'https://github.com/user/repo',
|
|
2579
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2580
|
-
preparationStatus: 'Preparation',
|
|
2581
2435
|
defaultAgentName: 'agent1',
|
|
2582
2436
|
defaultLlmModelName: 'claude-opus',
|
|
2583
2437
|
defaultLlmAgentName: null,
|
|
@@ -2605,8 +2459,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2605
2459
|
|
|
2606
2460
|
await useCase.run({
|
|
2607
2461
|
projectUrl: 'https://github.com/user/repo',
|
|
2608
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2609
|
-
preparationStatus: 'Preparation',
|
|
2610
2462
|
defaultAgentName: 'agent1',
|
|
2611
2463
|
defaultLlmModelName: null,
|
|
2612
2464
|
defaultLlmAgentName: null,
|
|
@@ -2653,8 +2505,6 @@ describe('StartPreparationUseCase', () => {
|
|
|
2653
2505
|
|
|
2654
2506
|
await useCase.run({
|
|
2655
2507
|
projectUrl: 'https://github.com/user/repo',
|
|
2656
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2657
|
-
preparationStatus: 'Preparation',
|
|
2658
2508
|
defaultAgentName: 'agent1',
|
|
2659
2509
|
defaultLlmModelName: 'claude-sonnet-4-6',
|
|
2660
2510
|
defaultLlmAgentName: null,
|
|
@@ -2,13 +2,14 @@ import { IssueRepository } from './adapter-interfaces/IssueRepository';
|
|
|
2
2
|
import { ProjectRepository } from './adapter-interfaces/ProjectRepository';
|
|
3
3
|
import { LocalCommandRunner } from './adapter-interfaces/LocalCommandRunner';
|
|
4
4
|
import { ClaudeRepository } from './adapter-interfaces/ClaudeRepository';
|
|
5
|
+
import {
|
|
6
|
+
AWAITING_WORKSPACE_STATUS_NAME,
|
|
7
|
+
PREPARATION_STATUS_NAME,
|
|
8
|
+
} from '../entities/WorkflowStatus';
|
|
5
9
|
|
|
6
10
|
export class StartPreparationUseCase {
|
|
7
11
|
constructor(
|
|
8
|
-
private readonly projectRepository: Pick<
|
|
9
|
-
ProjectRepository,
|
|
10
|
-
'getByUrl' | 'prepareStatus'
|
|
11
|
-
>,
|
|
12
|
+
private readonly projectRepository: Pick<ProjectRepository, 'getByUrl'>,
|
|
12
13
|
private readonly issueRepository: Pick<
|
|
13
14
|
IssueRepository,
|
|
14
15
|
| 'getStoryObjectMap'
|
|
@@ -25,8 +26,6 @@ export class StartPreparationUseCase {
|
|
|
25
26
|
|
|
26
27
|
run = async (params: {
|
|
27
28
|
projectUrl: string;
|
|
28
|
-
awaitingWorkspaceStatus: string;
|
|
29
|
-
preparationStatus: string;
|
|
30
29
|
defaultAgentName: string;
|
|
31
30
|
defaultLlmModelName: string | null;
|
|
32
31
|
defaultLlmAgentName: string | null;
|
|
@@ -85,15 +84,7 @@ export class StartPreparationUseCase {
|
|
|
85
84
|
);
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
|
-
|
|
89
|
-
project = await this.projectRepository.prepareStatus(
|
|
90
|
-
params.awaitingWorkspaceStatus,
|
|
91
|
-
project,
|
|
92
|
-
);
|
|
93
|
-
project = await this.projectRepository.prepareStatus(
|
|
94
|
-
params.preparationStatus,
|
|
95
|
-
project,
|
|
96
|
-
);
|
|
87
|
+
const project = await this.projectRepository.getByUrl(params.projectUrl);
|
|
97
88
|
const storyObjectMap = await this.issueRepository.getStoryObjectMap(
|
|
98
89
|
project,
|
|
99
90
|
params.allowIssueCacheMinutes,
|
|
@@ -103,11 +94,11 @@ export class StartPreparationUseCase {
|
|
|
103
94
|
(storyObject) => storyObject.issues,
|
|
104
95
|
);
|
|
105
96
|
const preparationStatusOption = project.status.statuses.find(
|
|
106
|
-
(s) => s.name ===
|
|
97
|
+
(s) => s.name === PREPARATION_STATUS_NAME,
|
|
107
98
|
);
|
|
108
99
|
if (!preparationStatusOption) {
|
|
109
100
|
console.error(
|
|
110
|
-
`Preparation status option '${
|
|
101
|
+
`Preparation status option '${PREPARATION_STATUS_NAME}' not found in project.`,
|
|
111
102
|
);
|
|
112
103
|
return;
|
|
113
104
|
}
|
|
@@ -115,11 +106,11 @@ export class StartPreparationUseCase {
|
|
|
115
106
|
const awaitingWorkspaceIssues = allOpenedIssues
|
|
116
107
|
.filter(
|
|
117
108
|
(issue) =>
|
|
118
|
-
issue.status ===
|
|
109
|
+
issue.status === AWAITING_WORKSPACE_STATUS_NAME && !issue.isClosed,
|
|
119
110
|
)
|
|
120
111
|
.map((issue) => ({ ...issue }));
|
|
121
112
|
const currentPreparationIssueCount = allOpenedIssues.filter(
|
|
122
|
-
(issue) => issue.status ===
|
|
113
|
+
(issue) => issue.status === PREPARATION_STATUS_NAME,
|
|
123
114
|
).length;
|
|
124
115
|
let updatedCurrentPreparationIssueCount = currentPreparationIssueCount;
|
|
125
116
|
let startedInThisRunCount = 0;
|
|
@@ -260,7 +251,7 @@ export class StartPreparationUseCase {
|
|
|
260
251
|
issue,
|
|
261
252
|
preparationStatusOption.id,
|
|
262
253
|
);
|
|
263
|
-
issue.status =
|
|
254
|
+
issue.status = PREPARATION_STATUS_NAME;
|
|
264
255
|
|
|
265
256
|
const awArgs: string[] = [
|
|
266
257
|
issue.url,
|