github-issue-tower-defence-management 1.145.0 → 1.146.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -8
- package/README.md +1 -1
- package/bin/adapter/entry-points/cli/index.js +9 -7
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/console/ensureConsoleRunning.js +6 -1
- package/bin/adapter/entry-points/console/ensureConsoleRunning.js.map +1 -1
- package/bin/adapter/entry-points/console/webServer.js +1 -3
- package/bin/adapter/entry-points/console/webServer.js.map +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +3 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/repositories/GraphqlProjectRepository.js +75 -4
- package/bin/adapter/repositories/GraphqlProjectRepository.js.map +1 -1
- package/bin/adapter/repositories/utils.js +2 -4
- package/bin/adapter/repositories/utils.js.map +1 -1
- package/bin/domain/entities/ProjectFieldName.js +6 -0
- package/bin/domain/entities/ProjectFieldName.js.map +1 -0
- package/bin/domain/entities/RequiredProjectField.js +47 -0
- package/bin/domain/entities/RequiredProjectField.js.map +1 -0
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +5 -1
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/ProjectRequiredFieldCreateUseCase.js +25 -0
- package/bin/domain/usecases/ProjectRequiredFieldCreateUseCase.js.map +1 -0
- package/bin/domain/usecases/SetupTowerDefenceProjectUseCase.js +6 -1
- package/bin/domain/usecases/SetupTowerDefenceProjectUseCase.js.map +1 -1
- package/bin/domain/usecases/dashboard/DashboardProjectCode.js +17 -12
- package/bin/domain/usecases/dashboard/DashboardProjectCode.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/index.test.ts +62 -2
- package/src/adapter/entry-points/cli/index.ts +12 -11
- package/src/adapter/entry-points/console/consoleDataDelivery.test.ts +37 -39
- package/src/adapter/entry-points/console/consoleDoneStore.test.ts +33 -33
- package/src/adapter/entry-points/console/consoleItemUrlLookup.test.ts +6 -6
- package/src/adapter/entry-points/console/consoleOperationApi.test.ts +66 -66
- package/src/adapter/entry-points/console/consoleProjectResolver.test.ts +35 -35
- package/src/adapter/entry-points/console/dashboardComposeService.test.ts +28 -28
- package/src/adapter/entry-points/console/dashboardEmitterComposerKey.test.ts +26 -18
- package/src/adapter/entry-points/console/ensureConsoleRunning.test.ts +19 -2
- package/src/adapter/entry-points/console/ensureConsoleRunning.ts +8 -0
- package/src/adapter/entry-points/console/ui/e2e/consoleScenario.spec.ts +1 -1
- package/src/adapter/entry-points/console/ui/e2e/consoleTestHarness.ts +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.stories.tsx +2 -2
- package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.test.tsx +3 -3
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleNavigation.test.ts +19 -31
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOperations.test.ts +24 -32
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleOverlay.test.ts +6 -6
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsolePjcode.test.ts +4 -4
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleTabData.test.ts +8 -8
- package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.test.ts +5 -5
- package/src/adapter/entry-points/console/ui/src/features/console/logic/overlay.test.ts +1 -1
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.test.tsx +13 -13
- package/src/adapter/entry-points/console/webServer.test.ts +55 -52
- package/src/adapter/entry-points/console/webServer.ts +0 -3
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.test.ts +2 -2
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +4 -0
- package/src/adapter/entry-points/handlers/dashboardRowWriter.test.ts +5 -5
- package/src/adapter/entry-points/handlers/inTmuxByHumanDataWriter.test.ts +5 -5
- package/src/adapter/repositories/GraphqlProjectRepository.ts +110 -4
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.test.ts +1 -1
- package/src/adapter/repositories/utils.ts +3 -3
- package/src/domain/entities/ProjectFieldName.ts +2 -0
- package/src/domain/entities/RequiredProjectField.ts +64 -0
- package/src/domain/usecases/HandleScheduledEventUseCase.test.ts +4 -0
- package/src/domain/usecases/HandleScheduledEventUseCase.ts +5 -0
- package/src/domain/usecases/NotifySilentLiveSessionsUseCase.test.ts +3 -3
- package/src/domain/usecases/ProjectRequiredFieldCreateUseCase.test.ts +159 -0
- package/src/domain/usecases/ProjectRequiredFieldCreateUseCase.ts +32 -0
- package/src/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.test.ts +19 -19
- package/src/domain/usecases/SetupTowerDefenceProjectUseCase.test.ts +24 -14
- package/src/domain/usecases/SetupTowerDefenceProjectUseCase.ts +10 -1
- package/src/domain/usecases/adapter-interfaces/ProjectRepository.ts +6 -0
- package/src/domain/usecases/dashboard/ComposeDashboardUseCase.test.ts +28 -28
- package/src/domain/usecases/dashboard/DashboardProjectCode.test.ts +21 -19
- package/src/domain/usecases/dashboard/DashboardProjectCode.ts +21 -14
- package/types/adapter/entry-points/console/ensureConsoleRunning.d.ts +1 -1
- package/types/adapter/entry-points/console/ensureConsoleRunning.d.ts.map +1 -1
- package/types/adapter/entry-points/console/webServer.d.ts +0 -1
- package/types/adapter/entry-points/console/webServer.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/adapter/repositories/utils.d.ts.map +1 -1
- package/types/domain/entities/ProjectFieldName.d.ts +2 -0
- package/types/domain/entities/ProjectFieldName.d.ts.map +1 -0
- package/types/domain/entities/RequiredProjectField.d.ts +13 -0
- package/types/domain/entities/RequiredProjectField.d.ts.map +1 -0
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts +3 -1
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/ProjectRequiredFieldCreateUseCase.d.ts +10 -0
- package/types/domain/usecases/ProjectRequiredFieldCreateUseCase.d.ts.map +1 -0
- package/types/domain/usecases/SetupTowerDefenceProjectUseCase.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/ProjectRepository.d.ts +3 -0
- package/types/domain/usecases/adapter-interfaces/ProjectRepository.d.ts.map +1 -1
- package/types/domain/usecases/dashboard/DashboardProjectCode.d.ts +2 -2
- package/types/domain/usecases/dashboard/DashboardProjectCode.d.ts.map +1 -1
|
@@ -74,8 +74,8 @@ describe('consoleOperationApi', () => {
|
|
|
74
74
|
context = {
|
|
75
75
|
issueRepository,
|
|
76
76
|
resolveProject: async (pjcode: string) =>
|
|
77
|
-
pjcode === '
|
|
78
|
-
isPjcodeConfigured: (pjcode: string) => pjcode === '
|
|
77
|
+
pjcode === 'acme' ? { pjcode, project } : null,
|
|
78
|
+
isPjcodeConfigured: (pjcode: string) => pjcode === 'acme',
|
|
79
79
|
consoleDataOutputDir: baseDir,
|
|
80
80
|
issueAttachmentRepository: null,
|
|
81
81
|
};
|
|
@@ -86,8 +86,8 @@ describe('consoleOperationApi', () => {
|
|
|
86
86
|
): ConsoleOperationContext => ({
|
|
87
87
|
issueRepository,
|
|
88
88
|
resolveProject: async (pjcode: string) =>
|
|
89
|
-
pjcode === '
|
|
90
|
-
isPjcodeConfigured: (pjcode: string) => pjcode === '
|
|
89
|
+
pjcode === 'acme' ? { pjcode, project: nextProject } : null,
|
|
90
|
+
isPjcodeConfigured: (pjcode: string) => pjcode === 'acme',
|
|
91
91
|
consoleDataOutputDir: baseDir,
|
|
92
92
|
issueAttachmentRepository: null,
|
|
93
93
|
});
|
|
@@ -98,7 +98,7 @@ describe('consoleOperationApi', () => {
|
|
|
98
98
|
|
|
99
99
|
const expectRecordedAcrossTabs = (projectItemId: string): void => {
|
|
100
100
|
for (const tab of CONSOLE_DONE_TAB_NAMES) {
|
|
101
|
-
expect(readDoneProjectItemIds(baseDir, '
|
|
101
|
+
expect(readDoneProjectItemIds(baseDir, 'acme', tab)).toContain(
|
|
102
102
|
projectItemId,
|
|
103
103
|
);
|
|
104
104
|
}
|
|
@@ -107,7 +107,7 @@ describe('consoleOperationApi', () => {
|
|
|
107
107
|
describe('handleReview', () => {
|
|
108
108
|
it('approves and sets Awaiting workspace then records done', async () => {
|
|
109
109
|
const response = await handleReview(context, {
|
|
110
|
-
pjcode: '
|
|
110
|
+
pjcode: 'acme',
|
|
111
111
|
action: 'approve',
|
|
112
112
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
113
113
|
projectItemId: 'PVTI_a',
|
|
@@ -130,7 +130,7 @@ describe('consoleOperationApi', () => {
|
|
|
130
130
|
|
|
131
131
|
it('requests changes with the inline comment anchored to a line and side', async () => {
|
|
132
132
|
const response = await handleReview(context, {
|
|
133
|
-
pjcode: '
|
|
133
|
+
pjcode: 'acme',
|
|
134
134
|
action: 'request_changes',
|
|
135
135
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
136
136
|
projectItemId: 'PVTI_b',
|
|
@@ -156,7 +156,7 @@ describe('consoleOperationApi', () => {
|
|
|
156
156
|
|
|
157
157
|
it('requests changes without a line anchor when line and side are missing', async () => {
|
|
158
158
|
const response = await handleReview(context, {
|
|
159
|
-
pjcode: '
|
|
159
|
+
pjcode: 'acme',
|
|
160
160
|
action: 'request_changes',
|
|
161
161
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
162
162
|
projectItemId: 'PVTI_b',
|
|
@@ -177,7 +177,7 @@ describe('consoleOperationApi', () => {
|
|
|
177
177
|
|
|
178
178
|
it('rejects request_changes without a comment body', async () => {
|
|
179
179
|
const response = await handleReview(context, {
|
|
180
|
-
pjcode: '
|
|
180
|
+
pjcode: 'acme',
|
|
181
181
|
action: 'request_changes',
|
|
182
182
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
183
183
|
projectItemId: 'PVTI_b',
|
|
@@ -190,7 +190,7 @@ describe('consoleOperationApi', () => {
|
|
|
190
190
|
|
|
191
191
|
it('closes a pull request and posts a comment', async () => {
|
|
192
192
|
const response = await handleReview(context, {
|
|
193
|
-
pjcode: '
|
|
193
|
+
pjcode: 'acme',
|
|
194
194
|
action: 'close',
|
|
195
195
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
196
196
|
projectItemId: 'PVTI_c',
|
|
@@ -209,7 +209,7 @@ describe('consoleOperationApi', () => {
|
|
|
209
209
|
|
|
210
210
|
it('rejects an unknown review action', async () => {
|
|
211
211
|
const response = await handleReview(context, {
|
|
212
|
-
pjcode: '
|
|
212
|
+
pjcode: 'acme',
|
|
213
213
|
action: 'frobnicate',
|
|
214
214
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
215
215
|
projectItemId: 'PVTI_c',
|
|
@@ -219,7 +219,7 @@ describe('consoleOperationApi', () => {
|
|
|
219
219
|
|
|
220
220
|
it('rejects a missing prUrl', async () => {
|
|
221
221
|
const response = await handleReview(context, {
|
|
222
|
-
pjcode: '
|
|
222
|
+
pjcode: 'acme',
|
|
223
223
|
action: 'approve',
|
|
224
224
|
projectItemId: 'PVTI_c',
|
|
225
225
|
});
|
|
@@ -228,7 +228,7 @@ describe('consoleOperationApi', () => {
|
|
|
228
228
|
|
|
229
229
|
it('rejects a missing action', async () => {
|
|
230
230
|
const response = await handleReview(context, {
|
|
231
|
-
pjcode: '
|
|
231
|
+
pjcode: 'acme',
|
|
232
232
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
233
233
|
projectItemId: 'PVTI_c',
|
|
234
234
|
});
|
|
@@ -237,7 +237,7 @@ describe('consoleOperationApi', () => {
|
|
|
237
237
|
|
|
238
238
|
it('rejects a missing projectItemId', async () => {
|
|
239
239
|
const response = await handleReview(context, {
|
|
240
|
-
pjcode: '
|
|
240
|
+
pjcode: 'acme',
|
|
241
241
|
action: 'approve',
|
|
242
242
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
243
243
|
});
|
|
@@ -247,7 +247,7 @@ describe('consoleOperationApi', () => {
|
|
|
247
247
|
it('approves using the request project item id without a GraphQL item fetch', async () => {
|
|
248
248
|
issueRepository.get.mockResolvedValue(null);
|
|
249
249
|
const response = await handleReview(context, {
|
|
250
|
-
pjcode: '
|
|
250
|
+
pjcode: 'acme',
|
|
251
251
|
action: 'approve',
|
|
252
252
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
253
253
|
projectItemId: 'PVTI_c',
|
|
@@ -267,7 +267,7 @@ describe('consoleOperationApi', () => {
|
|
|
267
267
|
status: { name: 'Status', fieldId: 'f', statuses: [] },
|
|
268
268
|
});
|
|
269
269
|
const response = await handleReview(contextWithoutStatus, {
|
|
270
|
-
pjcode: '
|
|
270
|
+
pjcode: 'acme',
|
|
271
271
|
action: 'approve',
|
|
272
272
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
273
273
|
projectItemId: 'PVTI_c',
|
|
@@ -279,7 +279,7 @@ describe('consoleOperationApi', () => {
|
|
|
279
279
|
describe('handleTriage', () => {
|
|
280
280
|
it('sets the status by name', async () => {
|
|
281
281
|
const response = await handleTriage(context, {
|
|
282
|
-
pjcode: '
|
|
282
|
+
pjcode: 'acme',
|
|
283
283
|
action: 'set_status',
|
|
284
284
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
285
285
|
projectItemId: 'PVTI_d',
|
|
@@ -300,7 +300,7 @@ describe('consoleOperationApi', () => {
|
|
|
300
300
|
|
|
301
301
|
it('rejects an unknown status name', async () => {
|
|
302
302
|
const response = await handleTriage(context, {
|
|
303
|
-
pjcode: '
|
|
303
|
+
pjcode: 'acme',
|
|
304
304
|
action: 'set_status',
|
|
305
305
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
306
306
|
projectItemId: 'PVTI_d',
|
|
@@ -312,7 +312,7 @@ describe('consoleOperationApi', () => {
|
|
|
312
312
|
|
|
313
313
|
it('sets the story option', async () => {
|
|
314
314
|
const response = await handleTriage(context, {
|
|
315
|
-
pjcode: '
|
|
315
|
+
pjcode: 'acme',
|
|
316
316
|
action: 'set_story',
|
|
317
317
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
318
318
|
projectItemId: 'PVTI_e',
|
|
@@ -330,7 +330,7 @@ describe('consoleOperationApi', () => {
|
|
|
330
330
|
|
|
331
331
|
it('snoozes for one day via updateNextActionDate', async () => {
|
|
332
332
|
const response = await handleTriage(context, {
|
|
333
|
-
pjcode: '
|
|
333
|
+
pjcode: 'acme',
|
|
334
334
|
action: 'snooze_1day',
|
|
335
335
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
336
336
|
projectItemId: 'PVTI_f',
|
|
@@ -346,7 +346,7 @@ describe('consoleOperationApi', () => {
|
|
|
346
346
|
|
|
347
347
|
it('snoozes for one week via updateNextActionDate', async () => {
|
|
348
348
|
const response = await handleTriage(context, {
|
|
349
|
-
pjcode: '
|
|
349
|
+
pjcode: 'acme',
|
|
350
350
|
action: 'snooze_1week',
|
|
351
351
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
352
352
|
projectItemId: 'PVTI_g',
|
|
@@ -358,7 +358,7 @@ describe('consoleOperationApi', () => {
|
|
|
358
358
|
|
|
359
359
|
it('closes an issue as completed via the triage close action', async () => {
|
|
360
360
|
const response = await handleTriage(context, {
|
|
361
|
-
pjcode: '
|
|
361
|
+
pjcode: 'acme',
|
|
362
362
|
action: 'close',
|
|
363
363
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
364
364
|
projectItemId: 'PVTI_h',
|
|
@@ -378,7 +378,7 @@ describe('consoleOperationApi', () => {
|
|
|
378
378
|
|
|
379
379
|
it('closes an issue as not planned via the triage close_not_planned action', async () => {
|
|
380
380
|
const response = await handleTriage(context, {
|
|
381
|
-
pjcode: '
|
|
381
|
+
pjcode: 'acme',
|
|
382
382
|
action: 'close_not_planned',
|
|
383
383
|
issueUrl: 'https://github.com/o/r/issues/2',
|
|
384
384
|
projectItemId: 'PVTI_np',
|
|
@@ -393,7 +393,7 @@ describe('consoleOperationApi', () => {
|
|
|
393
393
|
|
|
394
394
|
it('closes a pull request via the triage close action without an invalid state_reason', async () => {
|
|
395
395
|
const response = await handleTriage(context, {
|
|
396
|
-
pjcode: '
|
|
396
|
+
pjcode: 'acme',
|
|
397
397
|
action: 'close',
|
|
398
398
|
issueUrl: 'https://github.com/o/r/pull/7',
|
|
399
399
|
projectItemId: 'PVTI_prclose',
|
|
@@ -408,7 +408,7 @@ describe('consoleOperationApi', () => {
|
|
|
408
408
|
|
|
409
409
|
it('closes a pull request via the triage close_not_planned action through the pull-request close path', async () => {
|
|
410
410
|
const response = await handleTriage(context, {
|
|
411
|
-
pjcode: '
|
|
411
|
+
pjcode: 'acme',
|
|
412
412
|
action: 'close_not_planned',
|
|
413
413
|
issueUrl: 'https://github.com/o/r/pull/8',
|
|
414
414
|
projectItemId: 'PVTI_prnp',
|
|
@@ -423,7 +423,7 @@ describe('consoleOperationApi', () => {
|
|
|
423
423
|
|
|
424
424
|
it('rejects an unknown triage action', async () => {
|
|
425
425
|
const response = await handleTriage(context, {
|
|
426
|
-
pjcode: '
|
|
426
|
+
pjcode: 'acme',
|
|
427
427
|
action: 'unknown',
|
|
428
428
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
429
429
|
projectItemId: 'PVTI_h',
|
|
@@ -433,7 +433,7 @@ describe('consoleOperationApi', () => {
|
|
|
433
433
|
|
|
434
434
|
it('rejects set_status without a status name', async () => {
|
|
435
435
|
const response = await handleTriage(context, {
|
|
436
|
-
pjcode: '
|
|
436
|
+
pjcode: 'acme',
|
|
437
437
|
action: 'set_status',
|
|
438
438
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
439
439
|
projectItemId: 'PVTI_h',
|
|
@@ -443,7 +443,7 @@ describe('consoleOperationApi', () => {
|
|
|
443
443
|
|
|
444
444
|
it('rejects set_story without a story option id', async () => {
|
|
445
445
|
const response = await handleTriage(context, {
|
|
446
|
-
pjcode: '
|
|
446
|
+
pjcode: 'acme',
|
|
447
447
|
action: 'set_story',
|
|
448
448
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
449
449
|
projectItemId: 'PVTI_h',
|
|
@@ -457,7 +457,7 @@ describe('consoleOperationApi', () => {
|
|
|
457
457
|
story: null,
|
|
458
458
|
});
|
|
459
459
|
const response = await handleTriage(contextWithoutStory, {
|
|
460
|
-
pjcode: '
|
|
460
|
+
pjcode: 'acme',
|
|
461
461
|
action: 'set_story',
|
|
462
462
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
463
463
|
projectItemId: 'PVTI_h',
|
|
@@ -469,7 +469,7 @@ describe('consoleOperationApi', () => {
|
|
|
469
469
|
|
|
470
470
|
it('rejects a missing issueUrl', async () => {
|
|
471
471
|
const response = await handleTriage(context, {
|
|
472
|
-
pjcode: '
|
|
472
|
+
pjcode: 'acme',
|
|
473
473
|
action: 'set_status',
|
|
474
474
|
projectItemId: 'PVTI_h',
|
|
475
475
|
statusName: 'Todo',
|
|
@@ -480,7 +480,7 @@ describe('consoleOperationApi', () => {
|
|
|
480
480
|
it('sets the story using the request project item id without a GraphQL item fetch', async () => {
|
|
481
481
|
issueRepository.get.mockResolvedValue(null);
|
|
482
482
|
const response = await handleTriage(context, {
|
|
483
|
-
pjcode: '
|
|
483
|
+
pjcode: 'acme',
|
|
484
484
|
action: 'set_story',
|
|
485
485
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
486
486
|
projectItemId: 'PVTI_h',
|
|
@@ -505,12 +505,12 @@ describe('consoleOperationApi', () => {
|
|
|
505
505
|
|
|
506
506
|
beforeEach(() => {
|
|
507
507
|
resolveProjectSpy = jest.fn(async (pjcode: string) =>
|
|
508
|
-
pjcode === '
|
|
508
|
+
pjcode === 'acme' ? { pjcode, project } : null,
|
|
509
509
|
);
|
|
510
510
|
spiedContext = {
|
|
511
511
|
issueRepository,
|
|
512
512
|
resolveProject: resolveProjectSpy,
|
|
513
|
-
isPjcodeConfigured: (pjcode: string) => pjcode === '
|
|
513
|
+
isPjcodeConfigured: (pjcode: string) => pjcode === 'acme',
|
|
514
514
|
consoleDataOutputDir: baseDir,
|
|
515
515
|
issueAttachmentRepository: null,
|
|
516
516
|
};
|
|
@@ -518,7 +518,7 @@ describe('consoleOperationApi', () => {
|
|
|
518
518
|
|
|
519
519
|
it('closes an issue via triage without resolving the project', async () => {
|
|
520
520
|
const response = await handleTriage(spiedContext, {
|
|
521
|
-
pjcode: '
|
|
521
|
+
pjcode: 'acme',
|
|
522
522
|
action: 'close',
|
|
523
523
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
524
524
|
projectItemId: 'PVTI_noproj_close',
|
|
@@ -539,7 +539,7 @@ describe('consoleOperationApi', () => {
|
|
|
539
539
|
|
|
540
540
|
it('closes not planned via triage without resolving the project', async () => {
|
|
541
541
|
const response = await handleTriage(spiedContext, {
|
|
542
|
-
pjcode: '
|
|
542
|
+
pjcode: 'acme',
|
|
543
543
|
action: 'close_not_planned',
|
|
544
544
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
545
545
|
projectItemId: 'PVTI_noproj_np',
|
|
@@ -554,7 +554,7 @@ describe('consoleOperationApi', () => {
|
|
|
554
554
|
|
|
555
555
|
it('closes a pull request via review without resolving the project', async () => {
|
|
556
556
|
const response = await handleReview(spiedContext, {
|
|
557
|
-
pjcode: '
|
|
557
|
+
pjcode: 'acme',
|
|
558
558
|
action: 'close',
|
|
559
559
|
prUrl: 'https://github.com/o/r/pull/1',
|
|
560
560
|
projectItemId: 'PVTI_noproj_reviewclose',
|
|
@@ -580,7 +580,7 @@ describe('consoleOperationApi', () => {
|
|
|
580
580
|
|
|
581
581
|
it('sets intmux without a GraphQL item fetch while resolving the project', async () => {
|
|
582
582
|
const response = await handleIntmux(spiedContext, {
|
|
583
|
-
pjcode: '
|
|
583
|
+
pjcode: 'acme',
|
|
584
584
|
action: 'set_intmux',
|
|
585
585
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
586
586
|
projectItemId: 'PVTI_needproj_intmux',
|
|
@@ -597,7 +597,7 @@ describe('consoleOperationApi', () => {
|
|
|
597
597
|
|
|
598
598
|
it('resolves the project for set_status but performs no GraphQL item fetch', async () => {
|
|
599
599
|
const response = await handleTriage(spiedContext, {
|
|
600
|
-
pjcode: '
|
|
600
|
+
pjcode: 'acme',
|
|
601
601
|
action: 'set_status',
|
|
602
602
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
603
603
|
projectItemId: 'PVTI_needproj_status',
|
|
@@ -611,7 +611,7 @@ describe('consoleOperationApi', () => {
|
|
|
611
611
|
|
|
612
612
|
it('resolves the project for set_story but performs no GraphQL item fetch', async () => {
|
|
613
613
|
const response = await handleTriage(spiedContext, {
|
|
614
|
-
pjcode: '
|
|
614
|
+
pjcode: 'acme',
|
|
615
615
|
action: 'set_story',
|
|
616
616
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
617
617
|
projectItemId: 'PVTI_needproj_story',
|
|
@@ -625,7 +625,7 @@ describe('consoleOperationApi', () => {
|
|
|
625
625
|
|
|
626
626
|
it('resolves the project for snooze and passes the item id without a GraphQL item fetch', async () => {
|
|
627
627
|
const response = await handleTriage(spiedContext, {
|
|
628
|
-
pjcode: '
|
|
628
|
+
pjcode: 'acme',
|
|
629
629
|
action: 'snooze_1day',
|
|
630
630
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
631
631
|
projectItemId: 'PVTI_needproj_snooze',
|
|
@@ -644,7 +644,7 @@ describe('consoleOperationApi', () => {
|
|
|
644
644
|
describe('handleIntmux', () => {
|
|
645
645
|
it('sets the In Tmux by human status and records done', async () => {
|
|
646
646
|
const response = await handleIntmux(context, {
|
|
647
|
-
pjcode: '
|
|
647
|
+
pjcode: 'acme',
|
|
648
648
|
action: 'set_intmux',
|
|
649
649
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
650
650
|
projectItemId: 'PVTI_i',
|
|
@@ -664,7 +664,7 @@ describe('consoleOperationApi', () => {
|
|
|
664
664
|
|
|
665
665
|
it('rejects an unknown intmux action', async () => {
|
|
666
666
|
const response = await handleIntmux(context, {
|
|
667
|
-
pjcode: '
|
|
667
|
+
pjcode: 'acme',
|
|
668
668
|
action: 'unset_intmux',
|
|
669
669
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
670
670
|
projectItemId: 'PVTI_i',
|
|
@@ -675,7 +675,7 @@ describe('consoleOperationApi', () => {
|
|
|
675
675
|
it('sets intmux using the request project item id without a GraphQL item fetch', async () => {
|
|
676
676
|
issueRepository.get.mockResolvedValue(null);
|
|
677
677
|
const response = await handleIntmux(context, {
|
|
678
|
-
pjcode: '
|
|
678
|
+
pjcode: 'acme',
|
|
679
679
|
action: 'set_intmux',
|
|
680
680
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
681
681
|
projectItemId: 'PVTI_i',
|
|
@@ -691,7 +691,7 @@ describe('consoleOperationApi', () => {
|
|
|
691
691
|
|
|
692
692
|
it('rejects a missing issueUrl', async () => {
|
|
693
693
|
const response = await handleIntmux(context, {
|
|
694
|
-
pjcode: '
|
|
694
|
+
pjcode: 'acme',
|
|
695
695
|
action: 'set_intmux',
|
|
696
696
|
projectItemId: 'PVTI_i',
|
|
697
697
|
});
|
|
@@ -700,7 +700,7 @@ describe('consoleOperationApi', () => {
|
|
|
700
700
|
|
|
701
701
|
it('rejects a missing projectItemId', async () => {
|
|
702
702
|
const response = await handleIntmux(context, {
|
|
703
|
-
pjcode: '
|
|
703
|
+
pjcode: 'acme',
|
|
704
704
|
action: 'set_intmux',
|
|
705
705
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
706
706
|
});
|
|
@@ -709,7 +709,7 @@ describe('consoleOperationApi', () => {
|
|
|
709
709
|
|
|
710
710
|
it('rejects a missing action', async () => {
|
|
711
711
|
const response = await handleIntmux(context, {
|
|
712
|
-
pjcode: '
|
|
712
|
+
pjcode: 'acme',
|
|
713
713
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
714
714
|
projectItemId: 'PVTI_i',
|
|
715
715
|
});
|
|
@@ -746,21 +746,21 @@ describe('consoleOperationApi', () => {
|
|
|
746
746
|
const multiContext: ConsoleOperationContext = {
|
|
747
747
|
issueRepository,
|
|
748
748
|
resolveProject: async (pjcode: string) => {
|
|
749
|
-
if (pjcode === '
|
|
749
|
+
if (pjcode === 'acme') {
|
|
750
750
|
return { pjcode, project };
|
|
751
751
|
}
|
|
752
|
-
if (pjcode === '
|
|
752
|
+
if (pjcode === 'globex') {
|
|
753
753
|
return { pjcode, project: otherProject };
|
|
754
754
|
}
|
|
755
755
|
return null;
|
|
756
756
|
},
|
|
757
757
|
isPjcodeConfigured: (pjcode: string) =>
|
|
758
|
-
pjcode === '
|
|
758
|
+
pjcode === 'acme' || pjcode === 'globex',
|
|
759
759
|
consoleDataOutputDir: baseDir,
|
|
760
760
|
issueAttachmentRepository: null,
|
|
761
761
|
};
|
|
762
762
|
const response = await handleTriage(multiContext, {
|
|
763
|
-
pjcode: '
|
|
763
|
+
pjcode: 'globex',
|
|
764
764
|
action: 'set_status',
|
|
765
765
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
766
766
|
projectItemId: 'PVTI_x',
|
|
@@ -773,10 +773,10 @@ describe('consoleOperationApi', () => {
|
|
|
773
773
|
'status_todo',
|
|
774
774
|
);
|
|
775
775
|
for (const tab of CONSOLE_DONE_TAB_NAMES) {
|
|
776
|
-
expect(readDoneProjectItemIds(baseDir, '
|
|
776
|
+
expect(readDoneProjectItemIds(baseDir, 'globex', tab)).toContain(
|
|
777
777
|
'PVTI_x',
|
|
778
778
|
);
|
|
779
|
-
expect(readDoneProjectItemIds(baseDir, '
|
|
779
|
+
expect(readDoneProjectItemIds(baseDir, 'acme', tab)).not.toContain(
|
|
780
780
|
'PVTI_x',
|
|
781
781
|
);
|
|
782
782
|
}
|
|
@@ -790,7 +790,7 @@ describe('consoleOperationApi', () => {
|
|
|
790
790
|
consoleDataOutputDir: null,
|
|
791
791
|
};
|
|
792
792
|
const response = await handleIntmux(noStorageContext, {
|
|
793
|
-
pjcode: '
|
|
793
|
+
pjcode: 'acme',
|
|
794
794
|
action: 'set_intmux',
|
|
795
795
|
issueUrl: 'https://github.com/o/r/issues/1',
|
|
796
796
|
projectItemId: 'PVTI_j',
|
|
@@ -814,7 +814,7 @@ describe('consoleOperationApi', () => {
|
|
|
814
814
|
},
|
|
815
815
|
]);
|
|
816
816
|
const response = await handleComment(context, {
|
|
817
|
-
pjcode: '
|
|
817
|
+
pjcode: 'acme',
|
|
818
818
|
url: 'https://github.com/o/r/issues/1',
|
|
819
819
|
body: 'Please rebase onto the latest main branch.',
|
|
820
820
|
});
|
|
@@ -836,7 +836,7 @@ describe('consoleOperationApi', () => {
|
|
|
836
836
|
it('falls back to the posted body when no comment is returned', async () => {
|
|
837
837
|
issueRepository.getIssueOrPullRequestComments.mockResolvedValue([]);
|
|
838
838
|
const response = await handleComment(context, {
|
|
839
|
-
pjcode: '
|
|
839
|
+
pjcode: 'acme',
|
|
840
840
|
url: 'https://github.com/o/r/issues/1',
|
|
841
841
|
body: 'A first comment on this issue.',
|
|
842
842
|
});
|
|
@@ -853,7 +853,7 @@ describe('consoleOperationApi', () => {
|
|
|
853
853
|
|
|
854
854
|
it('rejects when url is missing', async () => {
|
|
855
855
|
const response = await handleComment(context, {
|
|
856
|
-
pjcode: '
|
|
856
|
+
pjcode: 'acme',
|
|
857
857
|
body: 'A comment without a target url.',
|
|
858
858
|
});
|
|
859
859
|
expect(response.statusCode).toBe(400);
|
|
@@ -862,7 +862,7 @@ describe('consoleOperationApi', () => {
|
|
|
862
862
|
|
|
863
863
|
it('rejects when body is missing', async () => {
|
|
864
864
|
const response = await handleComment(context, {
|
|
865
|
-
pjcode: '
|
|
865
|
+
pjcode: 'acme',
|
|
866
866
|
url: 'https://github.com/o/r/issues/1',
|
|
867
867
|
});
|
|
868
868
|
expect(response.statusCode).toBe(400);
|
|
@@ -872,7 +872,7 @@ describe('consoleOperationApi', () => {
|
|
|
872
872
|
|
|
873
873
|
describe('handleReviewComment', () => {
|
|
874
874
|
const validRequest = {
|
|
875
|
-
pjcode: '
|
|
875
|
+
pjcode: 'acme',
|
|
876
876
|
url: 'https://github.com/o/r/pull/1',
|
|
877
877
|
path: 'src/index.ts',
|
|
878
878
|
line: 42,
|
|
@@ -969,7 +969,7 @@ describe('consoleOperationApi', () => {
|
|
|
969
969
|
const listItemUrl = 'https://github.com/o/r/issues/1';
|
|
970
970
|
|
|
971
971
|
const writeListWithItem = (url: string): void => {
|
|
972
|
-
const dir = path.join(baseDir, '
|
|
972
|
+
const dir = path.join(baseDir, 'acme', 'prs');
|
|
973
973
|
fs.mkdirSync(dir, { recursive: true });
|
|
974
974
|
fs.writeFileSync(
|
|
975
975
|
path.join(dir, 'list.json'),
|
|
@@ -1004,7 +1004,7 @@ describe('consoleOperationApi', () => {
|
|
|
1004
1004
|
return '';
|
|
1005
1005
|
}),
|
|
1006
1006
|
{
|
|
1007
|
-
pjcode: '
|
|
1007
|
+
pjcode: 'acme',
|
|
1008
1008
|
url: 'https://github.com/o/r/issues/1',
|
|
1009
1009
|
fileName: 'shot.png',
|
|
1010
1010
|
contentBase64: Buffer.from([1, 2, 3]).toString('base64'),
|
|
@@ -1028,7 +1028,7 @@ describe('consoleOperationApi', () => {
|
|
|
1028
1028
|
it('rejects a request without a url', async () => {
|
|
1029
1029
|
const response = await handleAttachmentUpload(
|
|
1030
1030
|
uploadContext(async () => 'unused'),
|
|
1031
|
-
{ pjcode: '
|
|
1031
|
+
{ pjcode: 'acme', fileName: 'shot.png', contentBase64: 'AAEC' },
|
|
1032
1032
|
);
|
|
1033
1033
|
expect(response).toEqual({
|
|
1034
1034
|
statusCode: 400,
|
|
@@ -1040,7 +1040,7 @@ describe('consoleOperationApi', () => {
|
|
|
1040
1040
|
const response = await handleAttachmentUpload(
|
|
1041
1041
|
uploadContext(async () => 'unused'),
|
|
1042
1042
|
{
|
|
1043
|
-
pjcode: '
|
|
1043
|
+
pjcode: 'acme',
|
|
1044
1044
|
url: 'https://example.com/o/r/issues/1; rm -rf /',
|
|
1045
1045
|
fileName: 'shot.png',
|
|
1046
1046
|
contentBase64: 'AAEC',
|
|
@@ -1056,7 +1056,7 @@ describe('consoleOperationApi', () => {
|
|
|
1056
1056
|
const response = await handleAttachmentUpload(
|
|
1057
1057
|
uploadContext(async () => 'unused'),
|
|
1058
1058
|
{
|
|
1059
|
-
pjcode: '
|
|
1059
|
+
pjcode: 'acme',
|
|
1060
1060
|
url: 'https://github.com/o/r/issues/1',
|
|
1061
1061
|
contentBase64: 'AAEC',
|
|
1062
1062
|
},
|
|
@@ -1071,7 +1071,7 @@ describe('consoleOperationApi', () => {
|
|
|
1071
1071
|
const response = await handleAttachmentUpload(
|
|
1072
1072
|
uploadContext(async () => 'unused'),
|
|
1073
1073
|
{
|
|
1074
|
-
pjcode: '
|
|
1074
|
+
pjcode: 'acme',
|
|
1075
1075
|
url: 'https://github.com/o/r/issues/1',
|
|
1076
1076
|
fileName: 'shot.png',
|
|
1077
1077
|
},
|
|
@@ -1086,7 +1086,7 @@ describe('consoleOperationApi', () => {
|
|
|
1086
1086
|
const response = await handleAttachmentUpload(
|
|
1087
1087
|
{ ...context, issueAttachmentRepository: null },
|
|
1088
1088
|
{
|
|
1089
|
-
pjcode: '
|
|
1089
|
+
pjcode: 'acme',
|
|
1090
1090
|
url: 'https://github.com/o/r/issues/1',
|
|
1091
1091
|
fileName: 'shot.png',
|
|
1092
1092
|
contentBase64: 'AAEC',
|
|
@@ -1102,7 +1102,7 @@ describe('consoleOperationApi', () => {
|
|
|
1102
1102
|
const response = await handleAttachmentUpload(
|
|
1103
1103
|
uploadContext(async () => 'unused'),
|
|
1104
1104
|
{
|
|
1105
|
-
pjcode: '
|
|
1105
|
+
pjcode: 'acme',
|
|
1106
1106
|
url: 'https://github.com/o/r/issues/9999',
|
|
1107
1107
|
fileName: 'shot.png',
|
|
1108
1108
|
contentBase64: 'AAEC',
|