github-issue-tower-defence-management 1.146.1 → 1.146.2
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 +7 -0
- package/bin/adapter/entry-points/cli/index.js +20 -0
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/cli/projectConfig.js +3 -0
- package/bin/adapter/entry-points/cli/projectConfig.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleGithubTokenResolver.js +41 -0
- package/bin/adapter/entry-points/console/consoleGithubTokenResolver.js.map +1 -0
- package/bin/adapter/entry-points/console/consoleOperationApi.js +34 -16
- package/bin/adapter/entry-points/console/consoleOperationApi.js.map +1 -1
- package/bin/adapter/entry-points/console/webServer.js +2 -1
- package/bin/adapter/entry-points/console/webServer.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/index.ts +46 -0
- package/src/adapter/entry-points/cli/projectConfig.ts +8 -0
- package/src/adapter/entry-points/console/consoleGithubTokenResolver.test.ts +135 -0
- package/src/adapter/entry-points/console/consoleGithubTokenResolver.ts +55 -0
- package/src/adapter/entry-points/console/consoleOperationApi.test.ts +26 -4
- package/src/adapter/entry-points/console/consoleOperationApi.ts +51 -44
- package/src/adapter/entry-points/console/webServer.ts +5 -1
- package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
- package/types/adapter/entry-points/cli/projectConfig.d.ts +1 -0
- package/types/adapter/entry-points/cli/projectConfig.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleGithubTokenResolver.d.ts +6 -0
- package/types/adapter/entry-points/console/consoleGithubTokenResolver.d.ts.map +1 -0
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts +2 -1
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts.map +1 -1
- package/types/adapter/entry-points/console/webServer.d.ts +2 -1
- package/types/adapter/entry-points/console/webServer.d.ts.map +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import fs from 'fs';
|
|
2
3
|
import { Command } from 'commander';
|
|
3
4
|
export {
|
|
4
5
|
ConfigFile,
|
|
@@ -48,6 +49,11 @@ import {
|
|
|
48
49
|
createConsoleProjectResolver,
|
|
49
50
|
createPjcodeConfigChecker,
|
|
50
51
|
} from '../console/consoleProjectResolver';
|
|
52
|
+
import {
|
|
53
|
+
createConsoleGithubTokenResolver,
|
|
54
|
+
createConsoleIssueRepositoryResolver,
|
|
55
|
+
} from '../console/consoleGithubTokenResolver';
|
|
56
|
+
import { IssueRepository } from '../../../domain/usecases/adapter-interfaces/IssueRepository';
|
|
51
57
|
import { OauthTokenSelectHandler } from '../handlers/OauthTokenSelectHandler';
|
|
52
58
|
import { LiveSessionOauthTokenSelectHandler } from '../handlers/LiveSessionOauthTokenSelectHandler';
|
|
53
59
|
import { InTmuxByHumanSessionTokenCountHandler } from '../handlers/InTmuxByHumanSessionTokenCountHandler';
|
|
@@ -754,6 +760,45 @@ const runServeWeb = async (options: ServeWebOptions): Promise<void> => {
|
|
|
754
760
|
...githubRepositoryParams,
|
|
755
761
|
);
|
|
756
762
|
|
|
763
|
+
const resolveGithubToken = createConsoleGithubTokenResolver(
|
|
764
|
+
token,
|
|
765
|
+
config.consoleGithubTokenFilesByRepositoryOwner ?? null,
|
|
766
|
+
(filePath: string) => fs.readFileSync(filePath, 'utf8'),
|
|
767
|
+
);
|
|
768
|
+
const issueRepositoryByToken = new Map<string, IssueRepository>();
|
|
769
|
+
issueRepositoryByToken.set(token, issueRepository);
|
|
770
|
+
const buildIssueRepositoryForToken = (
|
|
771
|
+
repositoryToken: string,
|
|
772
|
+
): IssueRepository => {
|
|
773
|
+
const alreadyBuilt = issueRepositoryByToken.get(repositoryToken);
|
|
774
|
+
if (alreadyBuilt !== undefined) {
|
|
775
|
+
return alreadyBuilt;
|
|
776
|
+
}
|
|
777
|
+
const repositoryParams = buildGithubRepositoryParams(
|
|
778
|
+
localStorageRepository,
|
|
779
|
+
repositoryToken,
|
|
780
|
+
);
|
|
781
|
+
const built = new ApiV3CheerioRestIssueRepository(
|
|
782
|
+
new ApiV3IssueRepository(...repositoryParams),
|
|
783
|
+
new RestIssueRepository(...repositoryParams),
|
|
784
|
+
new GraphqlProjectItemRepository(...repositoryParams),
|
|
785
|
+
localStorageCacheRepository,
|
|
786
|
+
new GraphqlProjectRepository(
|
|
787
|
+
...repositoryParams,
|
|
788
|
+
localStorageCacheRepository,
|
|
789
|
+
),
|
|
790
|
+
new SystemDateRepository(),
|
|
791
|
+
...repositoryParams,
|
|
792
|
+
);
|
|
793
|
+
issueRepositoryByToken.set(repositoryToken, built);
|
|
794
|
+
return built;
|
|
795
|
+
};
|
|
796
|
+
const resolveIssueRepository =
|
|
797
|
+
createConsoleIssueRepositoryResolver<IssueRepository>(
|
|
798
|
+
resolveGithubToken,
|
|
799
|
+
buildIssueRepositoryForToken,
|
|
800
|
+
);
|
|
801
|
+
|
|
757
802
|
const pjcodeToProjectUrl = buildPjcodeToProjectUrl(
|
|
758
803
|
projectName,
|
|
759
804
|
projectUrl,
|
|
@@ -808,6 +853,7 @@ const runServeWeb = async (options: ServeWebOptions): Promise<void> => {
|
|
|
808
853
|
dashboardProjectNames,
|
|
809
854
|
githubToken: token,
|
|
810
855
|
issueRepository,
|
|
856
|
+
resolveIssueRepository,
|
|
811
857
|
resolveProject,
|
|
812
858
|
isPjcodeConfigured,
|
|
813
859
|
issueAttachmentRepository: new LocalCommandIssueAttachmentRepository(
|
|
@@ -25,6 +25,7 @@ export type ConfigFile = {
|
|
|
25
25
|
changeTargetPathAliases?: Record<string, string>;
|
|
26
26
|
consoleAccessToken?: string;
|
|
27
27
|
consoleProjects?: Record<string, string>;
|
|
28
|
+
consoleGithubTokenFilesByRepositoryOwner?: Record<string, string>;
|
|
28
29
|
disks?: DiskConfig[];
|
|
29
30
|
};
|
|
30
31
|
|
|
@@ -184,6 +185,10 @@ export const loadConfigFile = (configFilePath: string): ConfigFile => {
|
|
|
184
185
|
),
|
|
185
186
|
consoleAccessToken: getStringValue(parsed, 'consoleAccessToken'),
|
|
186
187
|
consoleProjects: getStringRecordValue(parsed, 'consoleProjects'),
|
|
188
|
+
consoleGithubTokenFilesByRepositoryOwner: getStringRecordValue(
|
|
189
|
+
parsed,
|
|
190
|
+
'consoleGithubTokenFilesByRepositoryOwner',
|
|
191
|
+
),
|
|
187
192
|
disks: getDisksValue(parsed, 'disks'),
|
|
188
193
|
};
|
|
189
194
|
} catch (error) {
|
|
@@ -350,6 +355,9 @@ export const mergeConfigs = (
|
|
|
350
355
|
consoleAccessToken:
|
|
351
356
|
cliOverrides.consoleAccessToken ?? configFile.consoleAccessToken,
|
|
352
357
|
consoleProjects: cliOverrides.consoleProjects ?? configFile.consoleProjects,
|
|
358
|
+
consoleGithubTokenFilesByRepositoryOwner:
|
|
359
|
+
cliOverrides.consoleGithubTokenFilesByRepositoryOwner ??
|
|
360
|
+
configFile.consoleGithubTokenFilesByRepositoryOwner,
|
|
353
361
|
disks: cliOverrides.disks ?? configFile.disks,
|
|
354
362
|
});
|
|
355
363
|
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createConsoleGithubTokenResolver,
|
|
3
|
+
createConsoleIssueRepositoryResolver,
|
|
4
|
+
extractRepositoryOwner,
|
|
5
|
+
} from './consoleGithubTokenResolver';
|
|
6
|
+
|
|
7
|
+
describe('createConsoleIssueRepositoryResolver', () => {
|
|
8
|
+
it('builds the issue repository from the token of the owner in the url', () => {
|
|
9
|
+
const resolve = createConsoleIssueRepositoryResolver<string>(
|
|
10
|
+
(repositoryOwner) => `token-of-${repositoryOwner}`,
|
|
11
|
+
(githubToken) => `repository-with-${githubToken}`,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
expect(
|
|
15
|
+
resolve('https://github.com/meta-site/hr-audit-mock/issues/178'),
|
|
16
|
+
).toBe('repository-with-token-of-meta-site');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('throws when the repository owner cannot be read from the url', () => {
|
|
20
|
+
const resolve = createConsoleIssueRepositoryResolver<string>(
|
|
21
|
+
(repositoryOwner) => `token-of-${repositoryOwner}`,
|
|
22
|
+
(githubToken) => `repository-with-${githubToken}`,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
expect(() => resolve('https://github.com/meta-site/hr-audit-mock')).toThrow(
|
|
26
|
+
'The repository owner cannot be read from the operated url: https://github.com/meta-site/hr-audit-mock',
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('extractRepositoryOwner', () => {
|
|
32
|
+
it('should return the owner of an issue url', () => {
|
|
33
|
+
expect(
|
|
34
|
+
extractRepositoryOwner(
|
|
35
|
+
'https://github.com/meta-site/hr-audit-mock/issues/178',
|
|
36
|
+
),
|
|
37
|
+
).toBe('meta-site');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should return the owner of a pull request url', () => {
|
|
41
|
+
expect(
|
|
42
|
+
extractRepositoryOwner(
|
|
43
|
+
'https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/pull/1399',
|
|
44
|
+
),
|
|
45
|
+
).toBe('HiromiShikata');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should return null for a url that is not an issue or a pull request', () => {
|
|
49
|
+
expect(
|
|
50
|
+
extractRepositoryOwner('https://github.com/meta-site/hr-audit-mock'),
|
|
51
|
+
).toBeNull();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe('createConsoleGithubTokenResolver', () => {
|
|
56
|
+
it('should return the default token for an owner that has no token file configured', () => {
|
|
57
|
+
const resolve = createConsoleGithubTokenResolver(
|
|
58
|
+
'default-token',
|
|
59
|
+
null,
|
|
60
|
+
() => {
|
|
61
|
+
throw new Error('must not read any file');
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect(resolve('HiromiShikata')).toBe('default-token');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should return the token read from the file configured for that owner', () => {
|
|
69
|
+
const resolve = createConsoleGithubTokenResolver(
|
|
70
|
+
'default-token',
|
|
71
|
+
{ 'meta-site': '/creds/meta-site-token.txt' },
|
|
72
|
+
(filePath) =>
|
|
73
|
+
filePath === '/creds/meta-site-token.txt'
|
|
74
|
+
? 'fine-grained-token\n'
|
|
75
|
+
: (() => {
|
|
76
|
+
throw new Error(`unexpected file path: ${filePath}`);
|
|
77
|
+
})(),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
expect(resolve('meta-site')).toBe('fine-grained-token');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('should keep using the default token for the other owners when one owner has a token file', () => {
|
|
84
|
+
const resolve = createConsoleGithubTokenResolver(
|
|
85
|
+
'default-token',
|
|
86
|
+
{ 'meta-site': '/creds/meta-site-token.txt' },
|
|
87
|
+
() => 'fine-grained-token',
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
expect(resolve('X-Mile')).toBe('default-token');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('should read the token file only once per owner', () => {
|
|
94
|
+
let readCount = 0;
|
|
95
|
+
const resolve = createConsoleGithubTokenResolver(
|
|
96
|
+
'default-token',
|
|
97
|
+
{ 'meta-site': '/creds/meta-site-token.txt' },
|
|
98
|
+
() => {
|
|
99
|
+
readCount += 1;
|
|
100
|
+
return 'fine-grained-token';
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
resolve('meta-site');
|
|
105
|
+
resolve('meta-site');
|
|
106
|
+
|
|
107
|
+
expect(readCount).toBe(1);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('should throw when the configured token file contains no token', () => {
|
|
111
|
+
const resolve = createConsoleGithubTokenResolver(
|
|
112
|
+
'default-token',
|
|
113
|
+
{ 'meta-site': '/creds/meta-site-token.txt' },
|
|
114
|
+
() => ' \n',
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
expect(() => resolve('meta-site')).toThrow(
|
|
118
|
+
'The GitHub token file configured for repository owner "meta-site" contains no token: /creds/meta-site-token.txt',
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should surface the read failure when the configured token file cannot be read', () => {
|
|
123
|
+
const resolve = createConsoleGithubTokenResolver(
|
|
124
|
+
'default-token',
|
|
125
|
+
{ 'meta-site': '/creds/meta-site-token.txt' },
|
|
126
|
+
() => {
|
|
127
|
+
throw new Error('ENOENT: no such file or directory');
|
|
128
|
+
},
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
expect(() => resolve('meta-site')).toThrow(
|
|
132
|
+
'ENOENT: no such file or directory',
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type ConsoleGithubTokenResolver = (repositoryOwner: string) => string;
|
|
2
|
+
|
|
3
|
+
export type GithubTokenFileReader = (filePath: string) => string;
|
|
4
|
+
|
|
5
|
+
export const extractRepositoryOwner = (
|
|
6
|
+
issueOrPullRequestUrl: string,
|
|
7
|
+
): string | null => {
|
|
8
|
+
const match = issueOrPullRequestUrl.match(
|
|
9
|
+
/^https:\/\/github\.com\/([A-Za-z0-9._-]+)\/[A-Za-z0-9._-]+\/(?:issues|pull)\/\d+/,
|
|
10
|
+
);
|
|
11
|
+
return match ? match[1] : null;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const createConsoleIssueRepositoryResolver = <IssueRepositoryType>(
|
|
15
|
+
resolveGithubToken: ConsoleGithubTokenResolver,
|
|
16
|
+
buildIssueRepositoryForToken: (githubToken: string) => IssueRepositoryType,
|
|
17
|
+
): ((issueOrPullRequestUrl: string) => IssueRepositoryType) => {
|
|
18
|
+
return (issueOrPullRequestUrl: string): IssueRepositoryType => {
|
|
19
|
+
const repositoryOwner = extractRepositoryOwner(issueOrPullRequestUrl);
|
|
20
|
+
if (repositoryOwner === null) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
`The repository owner cannot be read from the operated url: ${issueOrPullRequestUrl}`,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return buildIssueRepositoryForToken(resolveGithubToken(repositoryOwner));
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const createConsoleGithubTokenResolver = (
|
|
30
|
+
defaultToken: string,
|
|
31
|
+
githubTokenFilePathByRepositoryOwner: Record<string, string> | null,
|
|
32
|
+
readTokenFile: GithubTokenFileReader,
|
|
33
|
+
): ConsoleGithubTokenResolver => {
|
|
34
|
+
const resolvedTokenByRepositoryOwner = new Map<string, string>();
|
|
35
|
+
return (repositoryOwner: string): string => {
|
|
36
|
+
const alreadyResolved = resolvedTokenByRepositoryOwner.get(repositoryOwner);
|
|
37
|
+
if (alreadyResolved !== undefined) {
|
|
38
|
+
return alreadyResolved;
|
|
39
|
+
}
|
|
40
|
+
const filePath = githubTokenFilePathByRepositoryOwner
|
|
41
|
+
? githubTokenFilePathByRepositoryOwner[repositoryOwner]
|
|
42
|
+
: undefined;
|
|
43
|
+
if (filePath === undefined) {
|
|
44
|
+
return defaultToken;
|
|
45
|
+
}
|
|
46
|
+
const token = readTokenFile(filePath).trim();
|
|
47
|
+
if (token.length === 0) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`The GitHub token file configured for repository owner "${repositoryOwner}" contains no token: ${filePath}`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
resolvedTokenByRepositoryOwner.set(repositoryOwner, token);
|
|
53
|
+
return token;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -72,7 +72,7 @@ describe('consoleOperationApi', () => {
|
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
74
|
context = {
|
|
75
|
-
issueRepository,
|
|
75
|
+
resolveIssueRepository: () => issueRepository,
|
|
76
76
|
resolveProject: async (pjcode: string) =>
|
|
77
77
|
pjcode === 'acme' ? { pjcode, project } : null,
|
|
78
78
|
isPjcodeConfigured: (pjcode: string) => pjcode === 'acme',
|
|
@@ -84,7 +84,7 @@ describe('consoleOperationApi', () => {
|
|
|
84
84
|
const contextForProject = (
|
|
85
85
|
nextProject: Project,
|
|
86
86
|
): ConsoleOperationContext => ({
|
|
87
|
-
issueRepository,
|
|
87
|
+
resolveIssueRepository: () => issueRepository,
|
|
88
88
|
resolveProject: async (pjcode: string) =>
|
|
89
89
|
pjcode === 'acme' ? { pjcode, project: nextProject } : null,
|
|
90
90
|
isPjcodeConfigured: (pjcode: string) => pjcode === 'acme',
|
|
@@ -128,6 +128,28 @@ describe('consoleOperationApi', () => {
|
|
|
128
128
|
expectRecordedAcrossTabs('PVTI_a');
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
+
it('resolves the issue repository from the url of the operated pull request', async () => {
|
|
132
|
+
const resolvedUrls: string[] = [];
|
|
133
|
+
const contextRecordingResolvedUrls: ConsoleOperationContext = {
|
|
134
|
+
...context,
|
|
135
|
+
resolveIssueRepository: (issueOrPullRequestUrl: string) => {
|
|
136
|
+
resolvedUrls.push(issueOrPullRequestUrl);
|
|
137
|
+
return issueRepository;
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
await handleReview(contextRecordingResolvedUrls, {
|
|
142
|
+
pjcode: 'acme',
|
|
143
|
+
action: 'approve',
|
|
144
|
+
prUrl: 'https://github.com/meta-site/hr-audit-mock/pull/178',
|
|
145
|
+
projectItemId: 'PVTI_resolver',
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
expect(resolvedUrls).toContain(
|
|
149
|
+
'https://github.com/meta-site/hr-audit-mock/pull/178',
|
|
150
|
+
);
|
|
151
|
+
});
|
|
152
|
+
|
|
131
153
|
it('requests changes with the inline comment anchored to a line and side', async () => {
|
|
132
154
|
const response = await handleReview(context, {
|
|
133
155
|
pjcode: 'acme',
|
|
@@ -508,7 +530,7 @@ describe('consoleOperationApi', () => {
|
|
|
508
530
|
pjcode === 'acme' ? { pjcode, project } : null,
|
|
509
531
|
);
|
|
510
532
|
spiedContext = {
|
|
511
|
-
issueRepository,
|
|
533
|
+
resolveIssueRepository: () => issueRepository,
|
|
512
534
|
resolveProject: resolveProjectSpy,
|
|
513
535
|
isPjcodeConfigured: (pjcode: string) => pjcode === 'acme',
|
|
514
536
|
consoleDataOutputDir: baseDir,
|
|
@@ -744,7 +766,7 @@ describe('consoleOperationApi', () => {
|
|
|
744
766
|
it('records the .done exclusion under the resolved pjcode', async () => {
|
|
745
767
|
const otherProject: Project = { ...project, id: 'PVT_other' };
|
|
746
768
|
const multiContext: ConsoleOperationContext = {
|
|
747
|
-
issueRepository,
|
|
769
|
+
resolveIssueRepository: () => issueRepository,
|
|
748
770
|
resolveProject: async (pjcode: string) => {
|
|
749
771
|
if (pjcode === 'acme') {
|
|
750
772
|
return { pjcode, project };
|
|
@@ -22,8 +22,12 @@ export type ConsoleProjectResolver = (
|
|
|
22
22
|
|
|
23
23
|
export type ConsolePjcodeValidator = (pjcode: string) => boolean;
|
|
24
24
|
|
|
25
|
+
export type ConsoleIssueRepositoryResolver = (
|
|
26
|
+
issueOrPullRequestUrl: string,
|
|
27
|
+
) => IssueRepository;
|
|
28
|
+
|
|
25
29
|
export type ConsoleOperationContext = {
|
|
26
|
-
|
|
30
|
+
resolveIssueRepository: ConsoleIssueRepositoryResolver;
|
|
27
31
|
resolveProject: ConsoleProjectResolver;
|
|
28
32
|
isPjcodeConfigured: ConsolePjcodeValidator;
|
|
29
33
|
consoleDataOutputDir: string | null;
|
|
@@ -210,9 +214,11 @@ export const handleReview = async (
|
|
|
210
214
|
if (typeof pjcodeResult !== 'string') {
|
|
211
215
|
return pjcodeResult;
|
|
212
216
|
}
|
|
213
|
-
await context.
|
|
217
|
+
await context.resolveIssueRepository(prUrl).closePullRequest(prUrl);
|
|
214
218
|
if (isNonEmptyString(body.commentBody)) {
|
|
215
|
-
await context
|
|
219
|
+
await context
|
|
220
|
+
.resolveIssueRepository(prUrl)
|
|
221
|
+
.createCommentByUrl(prUrl, body.commentBody);
|
|
216
222
|
}
|
|
217
223
|
recordDone(context, pjcodeResult, projectItemId);
|
|
218
224
|
return ok();
|
|
@@ -225,9 +231,9 @@ export const handleReview = async (
|
|
|
225
231
|
const { project, pjcode } = binding;
|
|
226
232
|
|
|
227
233
|
if (action === 'approve') {
|
|
228
|
-
await context.
|
|
234
|
+
await context.resolveIssueRepository(prUrl).approvePullRequest(prUrl);
|
|
229
235
|
const failure = await updateStatusByName(
|
|
230
|
-
context.
|
|
236
|
+
context.resolveIssueRepository(prUrl),
|
|
231
237
|
project,
|
|
232
238
|
prUrl,
|
|
233
239
|
projectItemId,
|
|
@@ -254,14 +260,16 @@ export const handleReview = async (
|
|
|
254
260
|
isReviewCommentSide(body.side)
|
|
255
261
|
? { line: body.line, side: body.side }
|
|
256
262
|
: null;
|
|
257
|
-
await context
|
|
258
|
-
prUrl
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
+
await context
|
|
264
|
+
.resolveIssueRepository(prUrl)
|
|
265
|
+
.requestChangesWithInlineComment(
|
|
266
|
+
prUrl,
|
|
267
|
+
changedFilePath,
|
|
268
|
+
commentBody,
|
|
269
|
+
inlineCommentLocation,
|
|
270
|
+
);
|
|
263
271
|
const failure = await updateStatusByName(
|
|
264
|
-
context.
|
|
272
|
+
context.resolveIssueRepository(prUrl),
|
|
265
273
|
project,
|
|
266
274
|
prUrl,
|
|
267
275
|
projectItemId,
|
|
@@ -300,18 +308,19 @@ export const handleTriage = async (
|
|
|
300
308
|
return pjcodeResult;
|
|
301
309
|
}
|
|
302
310
|
if (isNonEmptyString(body.commentBody)) {
|
|
303
|
-
await context
|
|
304
|
-
issueUrl
|
|
305
|
-
body.commentBody
|
|
306
|
-
);
|
|
311
|
+
await context
|
|
312
|
+
.resolveIssueRepository(issueUrl)
|
|
313
|
+
.createCommentByUrl(issueUrl, body.commentBody);
|
|
307
314
|
}
|
|
308
315
|
if (isPullRequestUrl(issueUrl)) {
|
|
309
|
-
await context.
|
|
316
|
+
await context.resolveIssueRepository(issueUrl).closePullRequest(issueUrl);
|
|
310
317
|
} else {
|
|
311
|
-
await context
|
|
312
|
-
issueUrl
|
|
313
|
-
|
|
314
|
-
|
|
318
|
+
await context
|
|
319
|
+
.resolveIssueRepository(issueUrl)
|
|
320
|
+
.closeIssueByUrl(
|
|
321
|
+
issueUrl,
|
|
322
|
+
action === 'close_not_planned' ? 'not_planned' : 'completed',
|
|
323
|
+
);
|
|
315
324
|
}
|
|
316
325
|
recordDone(context, pjcodeResult, projectItemId);
|
|
317
326
|
return ok();
|
|
@@ -329,7 +338,7 @@ export const handleTriage = async (
|
|
|
329
338
|
return badRequest('statusName is required for set_status');
|
|
330
339
|
}
|
|
331
340
|
const failure = await updateStatusByName(
|
|
332
|
-
context.
|
|
341
|
+
context.resolveIssueRepository(issueUrl),
|
|
333
342
|
project,
|
|
334
343
|
issueUrl,
|
|
335
344
|
projectItemId,
|
|
@@ -350,11 +359,13 @@ export const handleTriage = async (
|
|
|
350
359
|
if (project.story === null) {
|
|
351
360
|
return badRequest('project does not have a story field');
|
|
352
361
|
}
|
|
353
|
-
await context
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
362
|
+
await context
|
|
363
|
+
.resolveIssueRepository(issueUrl)
|
|
364
|
+
.updateStory(
|
|
365
|
+
{ ...project, story: project.story },
|
|
366
|
+
projectItemReference(issueUrl, projectItemId),
|
|
367
|
+
storyOptionId,
|
|
368
|
+
);
|
|
358
369
|
recordDone(context, pjcode, projectItemId);
|
|
359
370
|
return ok();
|
|
360
371
|
}
|
|
@@ -362,12 +373,9 @@ export const handleTriage = async (
|
|
|
362
373
|
if (action === 'snooze_1day' || action === 'snooze_1week') {
|
|
363
374
|
const days = action === 'snooze_1day' ? 1 : 7;
|
|
364
375
|
const target = new Date(Date.now() + days * 24 * 60 * 60 * 1000);
|
|
365
|
-
await context
|
|
366
|
-
issueUrl
|
|
367
|
-
project,
|
|
368
|
-
target,
|
|
369
|
-
projectItemId,
|
|
370
|
-
);
|
|
376
|
+
await context
|
|
377
|
+
.resolveIssueRepository(issueUrl)
|
|
378
|
+
.updateNextActionDate(issueUrl, project, target, projectItemId);
|
|
371
379
|
recordDone(context, pjcode, projectItemId);
|
|
372
380
|
return ok();
|
|
373
381
|
}
|
|
@@ -387,9 +395,12 @@ export const handleComment = async (
|
|
|
387
395
|
if (!isNonEmptyString(commentBody)) {
|
|
388
396
|
return badRequest('body is required');
|
|
389
397
|
}
|
|
390
|
-
await context
|
|
391
|
-
|
|
392
|
-
|
|
398
|
+
await context
|
|
399
|
+
.resolveIssueRepository(url)
|
|
400
|
+
.createCommentByUrl(url, commentBody);
|
|
401
|
+
const comments = await context
|
|
402
|
+
.resolveIssueRepository(url)
|
|
403
|
+
.getIssueOrPullRequestComments(url);
|
|
393
404
|
const posted = comments[comments.length - 1] ?? null;
|
|
394
405
|
return {
|
|
395
406
|
statusCode: 200,
|
|
@@ -480,13 +491,9 @@ export const handleReviewComment = async (
|
|
|
480
491
|
return badRequest('body is required');
|
|
481
492
|
}
|
|
482
493
|
try {
|
|
483
|
-
await context
|
|
484
|
-
url
|
|
485
|
-
path,
|
|
486
|
-
line,
|
|
487
|
-
side,
|
|
488
|
-
commentBody,
|
|
489
|
-
);
|
|
494
|
+
await context
|
|
495
|
+
.resolveIssueRepository(url)
|
|
496
|
+
.createPullRequestReviewComment(url, path, line, side, commentBody);
|
|
490
497
|
} catch (error) {
|
|
491
498
|
return badGateway(error instanceof Error ? error.message : 'unknown error');
|
|
492
499
|
}
|
|
@@ -518,7 +525,7 @@ export const handleIntmux = async (
|
|
|
518
525
|
}
|
|
519
526
|
const { project, pjcode } = binding;
|
|
520
527
|
const failure = await updateStatusByName(
|
|
521
|
-
context.
|
|
528
|
+
context.resolveIssueRepository(issueUrl),
|
|
522
529
|
project,
|
|
523
530
|
issueUrl,
|
|
524
531
|
projectItemId,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
handleRelatedPrs,
|
|
21
21
|
} from './consoleReadApi';
|
|
22
22
|
import {
|
|
23
|
+
ConsoleIssueRepositoryResolver,
|
|
23
24
|
ConsoleOperationContext,
|
|
24
25
|
ConsolePjcodeValidator,
|
|
25
26
|
ConsoleProjectResolver,
|
|
@@ -214,6 +215,7 @@ export type WebServerOptions = {
|
|
|
214
215
|
githubToken?: string | null;
|
|
215
216
|
imageFetcher?: ImageFetcher | null;
|
|
216
217
|
issueRepository?: IssueRepository | null;
|
|
218
|
+
resolveIssueRepository?: ConsoleIssueRepositoryResolver | null;
|
|
217
219
|
resolveProject?: ConsoleProjectResolver | null;
|
|
218
220
|
isPjcodeConfigured?: ConsolePjcodeValidator | null;
|
|
219
221
|
issueAttachmentRepository?: IssueAttachmentRepository | null;
|
|
@@ -500,8 +502,10 @@ const handleOperationApi = async (
|
|
|
500
502
|
) {
|
|
501
503
|
return null;
|
|
502
504
|
}
|
|
505
|
+
const resolveIssueRepository =
|
|
506
|
+
options.resolveIssueRepository ?? ((): IssueRepository => issueRepository);
|
|
503
507
|
const context: ConsoleOperationContext = {
|
|
504
|
-
|
|
508
|
+
resolveIssueRepository,
|
|
505
509
|
resolveProject,
|
|
506
510
|
isPjcodeConfigured,
|
|
507
511
|
consoleDataOutputDir: options.consoleDataOutputDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AA6JzB,eAAO,MAAM,OAAO,SAAgB,CAAC"}
|
|
@@ -21,6 +21,7 @@ export type ConfigFile = {
|
|
|
21
21
|
changeTargetPathAliases?: Record<string, string>;
|
|
22
22
|
consoleAccessToken?: string;
|
|
23
23
|
consoleProjects?: Record<string, string>;
|
|
24
|
+
consoleGithubTokenFilesByRepositoryOwner?: Record<string, string>;
|
|
24
25
|
disks?: DiskConfig[];
|
|
25
26
|
};
|
|
26
27
|
export type DiskConfig = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectConfig.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/projectConfig.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,kBAAkB,CAAC,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ACpC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,wCAAwC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClE,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAsDF,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACH,CAAC;AA4CvE,eAAO,MAAM,cAAc,GAAI,gBAAgB,MAAM,KAAG,UAmEvD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,MAAM,EACd,aAAa,MAAM,KAClB,UAuEF,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,YAAY,UAAU,EACtB,cAAc,UAAU,EACxB,iBAAiB,UAAU,KAC1B,UA+ED,CAAC;AAkBH,eAAO,MAAM,kBAAkB,GAC7B,YAAY,MAAM,EAClB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,GAAG,IAAI,CAoDvB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ConsoleGithubTokenResolver = (repositoryOwner: string) => string;
|
|
2
|
+
export type GithubTokenFileReader = (filePath: string) => string;
|
|
3
|
+
export declare const extractRepositoryOwner: (issueOrPullRequestUrl: string) => string | null;
|
|
4
|
+
export declare const createConsoleIssueRepositoryResolver: <IssueRepositoryType>(resolveGithubToken: ConsoleGithubTokenResolver, buildIssueRepositoryForToken: (githubToken: string) => IssueRepositoryType) => ((issueOrPullRequestUrl: string) => IssueRepositoryType);
|
|
5
|
+
export declare const createConsoleGithubTokenResolver: (defaultToken: string, githubTokenFilePathByRepositoryOwner: Record<string, string> | null, readTokenFile: GithubTokenFileReader) => ConsoleGithubTokenResolver;
|
|
6
|
+
//# sourceMappingURL=consoleGithubTokenResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consoleGithubTokenResolver.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleGithubTokenResolver.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,CAAC,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC;AAE7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;AAEjE,eAAO,MAAM,sBAAsB,GACjC,uBAAuB,MAAM,KAC5B,MAAM,GAAG,IAKX,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAAI,mBAAmB,EACtE,oBAAoB,0BAA0B,EAC9C,8BAA8B,CAAC,WAAW,EAAE,MAAM,KAAK,mBAAmB,KACzE,CAAC,CAAC,qBAAqB,EAAE,MAAM,KAAK,mBAAmB,CAUzD,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAC3C,cAAc,MAAM,EACpB,sCAAsC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EACnE,eAAe,qBAAqB,KACnC,0BAsBF,CAAC"}
|
|
@@ -9,8 +9,9 @@ export type ConsoleProjectBinding = {
|
|
|
9
9
|
};
|
|
10
10
|
export type ConsoleProjectResolver = (pjcode: string) => Promise<ConsoleProjectBinding | null>;
|
|
11
11
|
export type ConsolePjcodeValidator = (pjcode: string) => boolean;
|
|
12
|
+
export type ConsoleIssueRepositoryResolver = (issueOrPullRequestUrl: string) => IssueRepository;
|
|
12
13
|
export type ConsoleOperationContext = {
|
|
13
|
-
|
|
14
|
+
resolveIssueRepository: ConsoleIssueRepositoryResolver;
|
|
14
15
|
resolveProject: ConsoleProjectResolver;
|
|
15
16
|
isPjcodeConfigured: ConsolePjcodeValidator;
|
|
16
17
|
consoleDataOutputDir: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleOperationApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleOperationApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEhB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAC;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAK3D,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AACnE,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CACnC,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;AAE3C,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG;IACpC,
|
|
1
|
+
{"version":3,"file":"consoleOperationApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleOperationApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEhB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAC;AAClH,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAK3D,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AACnE,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AA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AAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA6BlC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAiClC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import * as http from 'http';
|
|
|
2
2
|
import { IssueAttachmentRepository } from '../../../domain/usecases/adapter-interfaces/IssueAttachmentRepository';
|
|
3
3
|
import { IssueRepository } from '../../../domain/usecases/adapter-interfaces/IssueRepository';
|
|
4
4
|
import { IssueTitleStateCache, PullRequestStatusCache } from './consoleReadApi';
|
|
5
|
-
import { ConsolePjcodeValidator, ConsoleProjectResolver } from './consoleOperationApi';
|
|
5
|
+
import { ConsoleIssueRepositoryResolver, ConsolePjcodeValidator, ConsoleProjectResolver } from './consoleOperationApi';
|
|
6
6
|
import { ImageFetcher } from './consoleImageProxy';
|
|
7
7
|
export declare const DEFAULT_WEB_PORT = 9980;
|
|
8
8
|
export declare const CONSOLE_TOKEN_HEADER = "x-pv-token";
|
|
@@ -26,6 +26,7 @@ export type WebServerOptions = {
|
|
|
26
26
|
githubToken?: string | null;
|
|
27
27
|
imageFetcher?: ImageFetcher | null;
|
|
28
28
|
issueRepository?: IssueRepository | null;
|
|
29
|
+
resolveIssueRepository?: ConsoleIssueRepositoryResolver | null;
|
|
29
30
|
resolveProject?: ConsoleProjectResolver | null;
|
|
30
31
|
isPjcodeConfigured?: ConsolePjcodeValidator | null;
|
|
31
32
|
issueAttachmentRepository?: IssueAttachmentRepository | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webServer.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/webServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,MA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