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
|
@@ -80,7 +80,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
80
80
|
let useCase: NotifyFinishedIssuePreparationUseCase;
|
|
81
81
|
let mockProjectRepository: {
|
|
82
82
|
getByUrl: jest.Mock;
|
|
83
|
-
prepareStatus: jest.Mock;
|
|
84
83
|
};
|
|
85
84
|
let mockIssueRepository: {
|
|
86
85
|
get: jest.Mock;
|
|
@@ -107,11 +106,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
107
106
|
|
|
108
107
|
mockProjectRepository = {
|
|
109
108
|
getByUrl: jest.fn(),
|
|
110
|
-
prepareStatus: jest
|
|
111
|
-
.fn()
|
|
112
|
-
.mockImplementation((_name: string, project: Project) =>
|
|
113
|
-
Promise.resolve(project),
|
|
114
|
-
),
|
|
115
109
|
};
|
|
116
110
|
|
|
117
111
|
mockIssueRepository = {
|
|
@@ -141,64 +135,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
141
135
|
);
|
|
142
136
|
});
|
|
143
137
|
|
|
144
|
-
it('should call prepareStatus for preparationStatus, awaitingWorkspaceStatus, and awaitingQualityCheckStatus with chained project objects', async () => {
|
|
145
|
-
const projectAfterFirstPrepare = createMockProject();
|
|
146
|
-
const projectAfterSecondPrepare = createMockProject();
|
|
147
|
-
const projectAfterThirdPrepare = createMockProject();
|
|
148
|
-
const issue = createMockIssue({
|
|
149
|
-
url: 'https://github.com/user/repo/issues/1',
|
|
150
|
-
status: 'Preparation',
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
154
|
-
mockProjectRepository.prepareStatus
|
|
155
|
-
.mockResolvedValueOnce(projectAfterFirstPrepare)
|
|
156
|
-
.mockResolvedValueOnce(projectAfterSecondPrepare)
|
|
157
|
-
.mockResolvedValueOnce(projectAfterThirdPrepare);
|
|
158
|
-
mockIssueRepository.get.mockResolvedValue(issue);
|
|
159
|
-
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
160
|
-
createMockComment({ content: 'From: Test report' }),
|
|
161
|
-
]);
|
|
162
|
-
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
|
|
163
|
-
{
|
|
164
|
-
url: 'https://github.com/user/repo/pull/1',
|
|
165
|
-
isConflicted: false,
|
|
166
|
-
isPassedAllCiJob: true,
|
|
167
|
-
isCiStateSuccess: true,
|
|
168
|
-
isResolvedAllReviewComments: true,
|
|
169
|
-
isBranchOutOfDate: false,
|
|
170
|
-
missingRequiredCheckNames: [],
|
|
171
|
-
},
|
|
172
|
-
]);
|
|
173
|
-
|
|
174
|
-
await useCase.run({
|
|
175
|
-
projectUrl: 'https://github.com/users/user/projects/1',
|
|
176
|
-
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
177
|
-
preparationStatus: 'Preparation',
|
|
178
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
179
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
180
|
-
thresholdForAutoReject: 3,
|
|
181
|
-
workflowBlockerResolvedWebhookUrl: null,
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
expect(mockProjectRepository.prepareStatus).toHaveBeenCalledTimes(3);
|
|
185
|
-
expect(mockProjectRepository.prepareStatus).toHaveBeenNthCalledWith(
|
|
186
|
-
1,
|
|
187
|
-
'Preparation',
|
|
188
|
-
mockProject,
|
|
189
|
-
);
|
|
190
|
-
expect(mockProjectRepository.prepareStatus).toHaveBeenNthCalledWith(
|
|
191
|
-
2,
|
|
192
|
-
'Awaiting Workspace',
|
|
193
|
-
projectAfterFirstPrepare,
|
|
194
|
-
);
|
|
195
|
-
expect(mockProjectRepository.prepareStatus).toHaveBeenNthCalledWith(
|
|
196
|
-
3,
|
|
197
|
-
'Awaiting Quality Check',
|
|
198
|
-
projectAfterSecondPrepare,
|
|
199
|
-
);
|
|
200
|
-
});
|
|
201
|
-
|
|
202
138
|
it('should update issue status from Preparation to Awaiting Quality Check when last comment starts with From:', async () => {
|
|
203
139
|
jest.useFakeTimers();
|
|
204
140
|
jest.setSystemTime(new Date('2026-01-01T00:00:00Z'));
|
|
@@ -228,9 +164,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
228
164
|
await useCase.run({
|
|
229
165
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
230
166
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
231
|
-
preparationStatus: 'Preparation',
|
|
232
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
233
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
234
167
|
thresholdForAutoReject: 3,
|
|
235
168
|
workflowBlockerResolvedWebhookUrl: null,
|
|
236
169
|
});
|
|
@@ -295,9 +228,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
295
228
|
await useCase.run({
|
|
296
229
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
297
230
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
298
|
-
preparationStatus: 'Preparation',
|
|
299
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
300
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
301
231
|
thresholdForAutoReject: 3,
|
|
302
232
|
workflowBlockerResolvedWebhookUrl: null,
|
|
303
233
|
});
|
|
@@ -321,9 +251,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
321
251
|
useCase.run({
|
|
322
252
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
323
253
|
issueUrl: 'https://github.com/user/repo/issues/999',
|
|
324
|
-
preparationStatus: 'Preparation',
|
|
325
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
326
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
327
254
|
thresholdForAutoReject: 3,
|
|
328
255
|
workflowBlockerResolvedWebhookUrl: null,
|
|
329
256
|
}),
|
|
@@ -345,9 +272,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
345
272
|
useCase.run({
|
|
346
273
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
347
274
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
348
|
-
preparationStatus: 'Preparation',
|
|
349
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
350
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
351
275
|
thresholdForAutoReject: 3,
|
|
352
276
|
workflowBlockerResolvedWebhookUrl: null,
|
|
353
277
|
}),
|
|
@@ -372,9 +296,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
372
296
|
await useCase.run({
|
|
373
297
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
374
298
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
375
|
-
preparationStatus: 'Preparation',
|
|
376
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
377
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
378
299
|
thresholdForAutoReject: 3,
|
|
379
300
|
workflowBlockerResolvedWebhookUrl: null,
|
|
380
301
|
});
|
|
@@ -427,9 +348,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
427
348
|
await useCase.run({
|
|
428
349
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
429
350
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
430
|
-
preparationStatus: 'Preparation',
|
|
431
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
432
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
433
351
|
thresholdForAutoReject: 3,
|
|
434
352
|
workflowBlockerResolvedWebhookUrl: null,
|
|
435
353
|
});
|
|
@@ -457,9 +375,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
457
375
|
await useCase.run({
|
|
458
376
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
459
377
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
460
|
-
preparationStatus: 'Preparation',
|
|
461
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
462
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
463
378
|
thresholdForAutoReject: 3,
|
|
464
379
|
workflowBlockerResolvedWebhookUrl: null,
|
|
465
380
|
});
|
|
@@ -492,9 +407,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
492
407
|
await useCase.run({
|
|
493
408
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
494
409
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
495
|
-
preparationStatus: 'Preparation',
|
|
496
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
497
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
498
410
|
thresholdForAutoReject: 3,
|
|
499
411
|
workflowBlockerResolvedWebhookUrl: null,
|
|
500
412
|
});
|
|
@@ -542,9 +454,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
542
454
|
await useCase.run({
|
|
543
455
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
544
456
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
545
|
-
preparationStatus: 'Preparation',
|
|
546
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
547
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
548
457
|
thresholdForAutoReject: 3,
|
|
549
458
|
workflowBlockerResolvedWebhookUrl: null,
|
|
550
459
|
});
|
|
@@ -594,9 +503,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
594
503
|
await useCase.run({
|
|
595
504
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
596
505
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
597
|
-
preparationStatus: 'Preparation',
|
|
598
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
599
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
600
506
|
thresholdForAutoReject: 3,
|
|
601
507
|
workflowBlockerResolvedWebhookUrl: null,
|
|
602
508
|
});
|
|
@@ -639,9 +545,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
639
545
|
await useCase.run({
|
|
640
546
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
641
547
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
642
|
-
preparationStatus: 'Preparation',
|
|
643
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
644
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
645
548
|
thresholdForAutoReject: 3,
|
|
646
549
|
workflowBlockerResolvedWebhookUrl: null,
|
|
647
550
|
});
|
|
@@ -684,9 +587,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
684
587
|
await useCase.run({
|
|
685
588
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
686
589
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
687
|
-
preparationStatus: 'Preparation',
|
|
688
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
689
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
690
590
|
thresholdForAutoReject: 3,
|
|
691
591
|
workflowBlockerResolvedWebhookUrl: null,
|
|
692
592
|
});
|
|
@@ -729,9 +629,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
729
629
|
await useCase.run({
|
|
730
630
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
731
631
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
732
|
-
preparationStatus: 'Preparation',
|
|
733
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
734
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
735
632
|
thresholdForAutoReject: 3,
|
|
736
633
|
workflowBlockerResolvedWebhookUrl: null,
|
|
737
634
|
});
|
|
@@ -760,9 +657,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
760
657
|
await useCase.run({
|
|
761
658
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
762
659
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
763
|
-
preparationStatus: 'Preparation',
|
|
764
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
765
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
766
660
|
thresholdForAutoReject: 3,
|
|
767
661
|
workflowBlockerResolvedWebhookUrl: null,
|
|
768
662
|
});
|
|
@@ -828,9 +722,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
828
722
|
await useCase.run({
|
|
829
723
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
830
724
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
831
|
-
preparationStatus: 'Preparation',
|
|
832
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
833
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
834
725
|
thresholdForAutoReject: 3,
|
|
835
726
|
workflowBlockerResolvedWebhookUrl: null,
|
|
836
727
|
});
|
|
@@ -889,9 +780,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
889
780
|
await useCase.run({
|
|
890
781
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
891
782
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
892
|
-
preparationStatus: 'Preparation',
|
|
893
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
894
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
895
783
|
thresholdForAutoReject: 3,
|
|
896
784
|
workflowBlockerResolvedWebhookUrl: null,
|
|
897
785
|
});
|
|
@@ -936,9 +824,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
936
824
|
await useCase.run({
|
|
937
825
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
938
826
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
939
|
-
preparationStatus: 'Preparation',
|
|
940
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
941
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
942
827
|
thresholdForAutoReject: 3,
|
|
943
828
|
workflowBlockerResolvedWebhookUrl: null,
|
|
944
829
|
});
|
|
@@ -985,9 +870,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
985
870
|
await useCase.run({
|
|
986
871
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
987
872
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
988
|
-
preparationStatus: 'Preparation',
|
|
989
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
990
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
991
873
|
thresholdForAutoReject: 3,
|
|
992
874
|
workflowBlockerResolvedWebhookUrl: null,
|
|
993
875
|
});
|
|
@@ -1032,9 +914,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1032
914
|
await useCase.run({
|
|
1033
915
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1034
916
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1035
|
-
preparationStatus: 'Preparation',
|
|
1036
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1037
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1038
917
|
thresholdForAutoReject: 3,
|
|
1039
918
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1040
919
|
});
|
|
@@ -1061,9 +940,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1061
940
|
await useCase.run({
|
|
1062
941
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1063
942
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1064
|
-
preparationStatus: 'Preparation',
|
|
1065
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1066
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1067
943
|
thresholdForAutoReject: 3,
|
|
1068
944
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1069
945
|
});
|
|
@@ -1117,9 +993,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1117
993
|
await useCase.run({
|
|
1118
994
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1119
995
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1120
|
-
preparationStatus: 'Preparation',
|
|
1121
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1122
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1123
996
|
thresholdForAutoReject: 3,
|
|
1124
997
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1125
998
|
});
|
|
@@ -1164,9 +1037,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1164
1037
|
await useCase.run({
|
|
1165
1038
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1166
1039
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1167
|
-
preparationStatus: 'Preparation',
|
|
1168
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1169
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1170
1040
|
thresholdForAutoReject: 3,
|
|
1171
1041
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1172
1042
|
});
|
|
@@ -1211,9 +1081,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1211
1081
|
await useCase.run({
|
|
1212
1082
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1213
1083
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1214
|
-
preparationStatus: 'Preparation',
|
|
1215
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1216
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1217
1084
|
thresholdForAutoReject: 3,
|
|
1218
1085
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1219
1086
|
});
|
|
@@ -1258,9 +1125,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1258
1125
|
await useCase.run({
|
|
1259
1126
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1260
1127
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1261
|
-
preparationStatus: 'Preparation',
|
|
1262
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1263
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1264
1128
|
thresholdForAutoReject: 3,
|
|
1265
1129
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1266
1130
|
});
|
|
@@ -1311,9 +1175,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1311
1175
|
await useCase.run({
|
|
1312
1176
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1313
1177
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1314
|
-
preparationStatus: 'Preparation',
|
|
1315
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1316
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1317
1178
|
thresholdForAutoReject: 3,
|
|
1318
1179
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1319
1180
|
});
|
|
@@ -1364,9 +1225,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1364
1225
|
await useCase.run({
|
|
1365
1226
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1366
1227
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1367
|
-
preparationStatus: 'Preparation',
|
|
1368
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1369
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1370
1228
|
thresholdForAutoReject: 3,
|
|
1371
1229
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1372
1230
|
});
|
|
@@ -1405,9 +1263,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1405
1263
|
await useCase.run({
|
|
1406
1264
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1407
1265
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1408
|
-
preparationStatus: 'Preparation',
|
|
1409
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1410
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1411
1266
|
thresholdForAutoReject: 3,
|
|
1412
1267
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1413
1268
|
});
|
|
@@ -1442,9 +1297,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1442
1297
|
await useCase.run({
|
|
1443
1298
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1444
1299
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1445
|
-
preparationStatus: 'Preparation',
|
|
1446
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1447
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1448
1300
|
thresholdForAutoReject: 3,
|
|
1449
1301
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1450
1302
|
});
|
|
@@ -1485,9 +1337,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1485
1337
|
await useCase.run({
|
|
1486
1338
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1487
1339
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1488
|
-
preparationStatus: 'Preparation',
|
|
1489
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1490
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1491
1340
|
thresholdForAutoReject: 3,
|
|
1492
1341
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1493
1342
|
});
|
|
@@ -1519,9 +1368,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1519
1368
|
await useCase.run({
|
|
1520
1369
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1521
1370
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1522
|
-
preparationStatus: 'Preparation',
|
|
1523
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1524
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1525
1371
|
thresholdForAutoReject: 3,
|
|
1526
1372
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1527
1373
|
});
|
|
@@ -1557,9 +1403,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1557
1403
|
await useCase.run({
|
|
1558
1404
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1559
1405
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1560
|
-
preparationStatus: 'Preparation',
|
|
1561
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1562
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1563
1406
|
thresholdForAutoReject: 3,
|
|
1564
1407
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1565
1408
|
});
|
|
@@ -1587,9 +1430,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1587
1430
|
await useCase.run({
|
|
1588
1431
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1589
1432
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1590
|
-
preparationStatus: 'Preparation',
|
|
1591
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1592
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1593
1433
|
thresholdForAutoReject: 3,
|
|
1594
1434
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1595
1435
|
});
|
|
@@ -1619,9 +1459,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1619
1459
|
await useCase.run({
|
|
1620
1460
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1621
1461
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1622
|
-
preparationStatus: 'Preparation',
|
|
1623
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1624
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1625
1462
|
thresholdForAutoReject: 3,
|
|
1626
1463
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1627
1464
|
});
|
|
@@ -1662,9 +1499,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1662
1499
|
await useCase.run({
|
|
1663
1500
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1664
1501
|
issueUrl: 'https://github.com/user/repo/pull/10',
|
|
1665
|
-
preparationStatus: 'Preparation',
|
|
1666
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1667
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1668
1502
|
thresholdForAutoReject: 3,
|
|
1669
1503
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1670
1504
|
});
|
|
@@ -1747,9 +1581,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1747
1581
|
await useCase.run({
|
|
1748
1582
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1749
1583
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1750
|
-
preparationStatus: 'Preparation',
|
|
1751
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1752
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1753
1584
|
thresholdForAutoReject: 3,
|
|
1754
1585
|
workflowBlockerResolvedWebhookUrl:
|
|
1755
1586
|
'https://example.com/webhook?url={URL}&msg={MESSAGE}',
|
|
@@ -1789,9 +1620,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1789
1620
|
await useCase.run({
|
|
1790
1621
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1791
1622
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1792
|
-
preparationStatus: 'Preparation',
|
|
1793
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1794
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1795
1623
|
thresholdForAutoReject: 3,
|
|
1796
1624
|
workflowBlockerResolvedWebhookUrl:
|
|
1797
1625
|
'https://example.com/notify={MESSAGE}',
|
|
@@ -1832,9 +1660,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1832
1660
|
await useCase.run({
|
|
1833
1661
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1834
1662
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1835
|
-
preparationStatus: 'Preparation',
|
|
1836
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1837
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1838
1663
|
thresholdForAutoReject: 3,
|
|
1839
1664
|
workflowBlockerResolvedWebhookUrl:
|
|
1840
1665
|
'https://example.com/webhook?msg={MESSAGE}',
|
|
@@ -1869,9 +1694,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1869
1694
|
await useCase.run({
|
|
1870
1695
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1871
1696
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1872
|
-
preparationStatus: 'Preparation',
|
|
1873
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1874
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1875
1697
|
thresholdForAutoReject: 3,
|
|
1876
1698
|
workflowBlockerResolvedWebhookUrl: null,
|
|
1877
1699
|
});
|
|
@@ -1915,9 +1737,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1915
1737
|
await useCase.run({
|
|
1916
1738
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1917
1739
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1918
|
-
preparationStatus: 'Preparation',
|
|
1919
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1920
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1921
1740
|
thresholdForAutoReject: 3,
|
|
1922
1741
|
workflowBlockerResolvedWebhookUrl:
|
|
1923
1742
|
'https://example.com/webhook?msg={MESSAGE}',
|
|
@@ -1968,9 +1787,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1968
1787
|
await useCase.run({
|
|
1969
1788
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1970
1789
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
1971
|
-
preparationStatus: 'Preparation',
|
|
1972
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
1973
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
1974
1790
|
thresholdForAutoReject: 3,
|
|
1975
1791
|
workflowBlockerResolvedWebhookUrl:
|
|
1976
1792
|
'https://example.com/runTasker/notify=:={MESSAGE}',
|
|
@@ -2023,9 +1839,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2023
1839
|
await useCase.run({
|
|
2024
1840
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2025
1841
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2026
|
-
preparationStatus: 'Preparation',
|
|
2027
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2028
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
2029
1842
|
thresholdForAutoReject: 3,
|
|
2030
1843
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2031
1844
|
});
|
|
@@ -2059,9 +1872,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2059
1872
|
await useCase.run({
|
|
2060
1873
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2061
1874
|
issueUrl: 'https://github.com/user/repo/pull/10',
|
|
2062
|
-
preparationStatus: 'Preparation',
|
|
2063
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2064
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
2065
1875
|
thresholdForAutoReject: 3,
|
|
2066
1876
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2067
1877
|
});
|
|
@@ -2107,9 +1917,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2107
1917
|
await useCase.run({
|
|
2108
1918
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2109
1919
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2110
|
-
preparationStatus: 'Preparation',
|
|
2111
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2112
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
2113
1920
|
thresholdForAutoReject: 3,
|
|
2114
1921
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2115
1922
|
});
|
|
@@ -2148,9 +1955,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2148
1955
|
await useCase.run({
|
|
2149
1956
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2150
1957
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2151
|
-
preparationStatus: 'Preparation',
|
|
2152
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2153
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
2154
1958
|
thresholdForAutoReject: 3,
|
|
2155
1959
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2156
1960
|
});
|
|
@@ -2190,9 +1994,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2190
1994
|
await useCase.run({
|
|
2191
1995
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2192
1996
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2193
|
-
preparationStatus: 'Preparation',
|
|
2194
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2195
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
2196
1997
|
thresholdForAutoReject: 3,
|
|
2197
1998
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2198
1999
|
});
|
|
@@ -2231,9 +2032,6 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
2231
2032
|
await useCase.run({
|
|
2232
2033
|
projectUrl: 'https://github.com/users/user/projects/1',
|
|
2233
2034
|
issueUrl: 'https://github.com/user/repo/issues/1',
|
|
2234
|
-
preparationStatus: 'Preparation',
|
|
2235
|
-
awaitingWorkspaceStatus: 'Awaiting Workspace',
|
|
2236
|
-
awaitingQualityCheckStatus: 'Awaiting Quality Check',
|
|
2237
2035
|
thresholdForAutoReject: 3,
|
|
2238
2036
|
workflowBlockerResolvedWebhookUrl: null,
|
|
2239
2037
|
});
|
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
import { ProjectRepository } from './adapter-interfaces/ProjectRepository';
|
|
6
6
|
import { IssueCommentRepository } from './adapter-interfaces/IssueCommentRepository';
|
|
7
7
|
import { WebhookRepository } from './adapter-interfaces/WebhookRepository';
|
|
8
|
+
import {
|
|
9
|
+
AWAITING_QUALITY_CHECK_STATUS_NAME,
|
|
10
|
+
AWAITING_WORKSPACE_STATUS_NAME,
|
|
11
|
+
PREPARATION_STATUS_NAME,
|
|
12
|
+
} from '../entities/WorkflowStatus';
|
|
8
13
|
|
|
9
14
|
export class IssueNotFoundError extends Error {
|
|
10
15
|
constructor(issueUrl: string) {
|
|
@@ -36,10 +41,7 @@ type RejectedReasonType =
|
|
|
36
41
|
|
|
37
42
|
export class NotifyFinishedIssuePreparationUseCase {
|
|
38
43
|
constructor(
|
|
39
|
-
private readonly projectRepository: Pick<
|
|
40
|
-
ProjectRepository,
|
|
41
|
-
'getByUrl' | 'prepareStatus'
|
|
42
|
-
>,
|
|
44
|
+
private readonly projectRepository: Pick<ProjectRepository, 'getByUrl'>,
|
|
43
45
|
private readonly issueRepository: Pick<
|
|
44
46
|
IssueRepository,
|
|
45
47
|
| 'get'
|
|
@@ -63,41 +65,26 @@ export class NotifyFinishedIssuePreparationUseCase {
|
|
|
63
65
|
run = async (params: {
|
|
64
66
|
projectUrl: string;
|
|
65
67
|
issueUrl: string;
|
|
66
|
-
preparationStatus: string;
|
|
67
|
-
awaitingWorkspaceStatus: string;
|
|
68
|
-
awaitingQualityCheckStatus: string;
|
|
69
68
|
thresholdForAutoReject: number;
|
|
70
69
|
workflowBlockerResolvedWebhookUrl: string | null;
|
|
71
70
|
}): Promise<void> => {
|
|
72
|
-
|
|
73
|
-
project = await this.projectRepository.prepareStatus(
|
|
74
|
-
params.preparationStatus,
|
|
75
|
-
project,
|
|
76
|
-
);
|
|
77
|
-
project = await this.projectRepository.prepareStatus(
|
|
78
|
-
params.awaitingWorkspaceStatus,
|
|
79
|
-
project,
|
|
80
|
-
);
|
|
81
|
-
project = await this.projectRepository.prepareStatus(
|
|
82
|
-
params.awaitingQualityCheckStatus,
|
|
83
|
-
project,
|
|
84
|
-
);
|
|
71
|
+
const project = await this.projectRepository.getByUrl(params.projectUrl);
|
|
85
72
|
|
|
86
73
|
const awaitingWorkspaceStatusOption = project.status.statuses.find(
|
|
87
|
-
(s) => s.name ===
|
|
74
|
+
(s) => s.name === AWAITING_WORKSPACE_STATUS_NAME,
|
|
88
75
|
);
|
|
89
76
|
if (!awaitingWorkspaceStatusOption) {
|
|
90
77
|
console.error(
|
|
91
|
-
`Awaiting workspace status option '${
|
|
78
|
+
`Awaiting workspace status option '${AWAITING_WORKSPACE_STATUS_NAME}' not found in project.`,
|
|
92
79
|
);
|
|
93
80
|
return;
|
|
94
81
|
}
|
|
95
82
|
const awaitingQualityCheckStatusOption = project.status.statuses.find(
|
|
96
|
-
(s) => s.name ===
|
|
83
|
+
(s) => s.name === AWAITING_QUALITY_CHECK_STATUS_NAME,
|
|
97
84
|
);
|
|
98
85
|
if (!awaitingQualityCheckStatusOption) {
|
|
99
86
|
console.error(
|
|
100
|
-
`Awaiting quality check status option '${
|
|
87
|
+
`Awaiting quality check status option '${AWAITING_QUALITY_CHECK_STATUS_NAME}' not found in project.`,
|
|
101
88
|
);
|
|
102
89
|
return;
|
|
103
90
|
}
|
|
@@ -106,11 +93,11 @@ export class NotifyFinishedIssuePreparationUseCase {
|
|
|
106
93
|
|
|
107
94
|
if (!issue) {
|
|
108
95
|
throw new IssueNotFoundError(params.issueUrl);
|
|
109
|
-
} else if (issue.status !==
|
|
96
|
+
} else if (issue.status !== PREPARATION_STATUS_NAME) {
|
|
110
97
|
throw new IllegalIssueStatusError(
|
|
111
98
|
params.issueUrl,
|
|
112
99
|
issue.status,
|
|
113
|
-
|
|
100
|
+
PREPARATION_STATUS_NAME,
|
|
114
101
|
);
|
|
115
102
|
}
|
|
116
103
|
|
|
@@ -138,7 +125,7 @@ export class NotifyFinishedIssuePreparationUseCase {
|
|
|
138
125
|
}
|
|
139
126
|
|
|
140
127
|
if (issue.dependedIssueUrls.length > 0) {
|
|
141
|
-
issue.status =
|
|
128
|
+
issue.status = AWAITING_WORKSPACE_STATUS_NAME;
|
|
142
129
|
await this.issueRepository.update(issue, project);
|
|
143
130
|
await this.issueRepository.updateStatus(
|
|
144
131
|
project,
|
|
@@ -153,7 +140,7 @@ export class NotifyFinishedIssuePreparationUseCase {
|
|
|
153
140
|
}
|
|
154
141
|
|
|
155
142
|
if (issue.nextActionDate !== null || issue.nextActionHour !== null) {
|
|
156
|
-
issue.status =
|
|
143
|
+
issue.status = AWAITING_WORKSPACE_STATUS_NAME;
|
|
157
144
|
await this.issueRepository.update(issue, project);
|
|
158
145
|
await this.issueRepository.updateStatus(
|
|
159
146
|
project,
|
|
@@ -193,7 +180,7 @@ export class NotifyFinishedIssuePreparationUseCase {
|
|
|
193
180
|
.includes('failed to pass the check automatically'),
|
|
194
181
|
)
|
|
195
182
|
) {
|
|
196
|
-
issue.status =
|
|
183
|
+
issue.status = AWAITING_QUALITY_CHECK_STATUS_NAME;
|
|
197
184
|
await this.issueRepository.update(issue, project);
|
|
198
185
|
await this.issueRepository.updateStatus(
|
|
199
186
|
project,
|
|
@@ -220,7 +207,7 @@ export class NotifyFinishedIssuePreparationUseCase {
|
|
|
220
207
|
}
|
|
221
208
|
|
|
222
209
|
if (rejections.length <= 0) {
|
|
223
|
-
issue.status =
|
|
210
|
+
issue.status = AWAITING_QUALITY_CHECK_STATUS_NAME;
|
|
224
211
|
await this.issueRepository.update(issue, project);
|
|
225
212
|
await this.issueRepository.updateStatus(
|
|
226
213
|
project,
|
|
@@ -238,7 +225,7 @@ export class NotifyFinishedIssuePreparationUseCase {
|
|
|
238
225
|
return;
|
|
239
226
|
}
|
|
240
227
|
|
|
241
|
-
issue.status =
|
|
228
|
+
issue.status = AWAITING_WORKSPACE_STATUS_NAME;
|
|
242
229
|
await this.issueRepository.update(issue, project);
|
|
243
230
|
await this.issueRepository.updateStatus(
|
|
244
231
|
project,
|