plugin-git-manager 1.2.26 → 1.2.28
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/README.md +133 -108
- package/client-v2.d.ts +2 -2
- package/client-v2.js +1 -1
- package/client.d.ts +3 -3
- package/client.js +1 -1
- package/dist/client/{326.90c276058682b536.js → 313.d38fc1d40c4589b9.js} +1 -1
- package/dist/client/900.a48beac7e2ebee7d.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/156.445366026c1cc9a8.js +10 -0
- package/dist/client-v2/{326.42b7b53651ffab3a.js → 313.3c867179c3a1e817.js} +1 -1
- package/dist/client-v2/434.19c7579c06b9077c.js +10 -0
- package/dist/client-v2/900.e6155002a9c97e7f.js +10 -0
- package/dist/client-v2/928.bba701b5a1ece58e.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +9 -8
- package/dist/locale/en-US.json +307 -297
- package/dist/locale/vi-VN.json +295 -292
- package/dist/locale/zh-CN.json +61 -51
- package/dist/node_modules/simple-git/dist/cjs/index.js +25 -25
- package/dist/node_modules/simple-git/package.json +1 -1
- package/dist/node_modules/zod/index.cjs +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/actions/git-actions.js +90 -36
- package/dist/server/actions/gitlab-api.js +4 -2
- package/dist/server/actions/poller.js +5 -2
- package/dist/server/actions/review.js +20 -10
- package/dist/server/plugin.js +6 -4
- package/dist/server/poller.js +46 -45
- package/dist/server/request-method-policy.js +75 -0
- package/dist/server/services/registry-content-service.js +23 -10
- package/dist/server/utils/get-repo-account.js +3 -2
- package/dist/server/utils/url-security.js +24 -0
- package/package.json +61 -43
- package/server.d.ts +2 -2
- package/server.js +1 -1
- package/src/client/__tests__/RunReviewButton.test.tsx +73 -0
- package/src/client/ai-context.tsx +114 -114
- package/src/client/components/AIEmployeeSelect.tsx +63 -63
- package/src/client/components/CommitHistory.tsx +374 -374
- package/src/client/components/FileExplorer.tsx +386 -386
- package/src/client/components/GitAccounts.tsx +179 -179
- package/src/client/components/GitManagerSettings.tsx +160 -160
- package/src/client/components/GitOperations.tsx +220 -220
- package/src/client/components/LLMModelSelect.tsx +63 -63
- package/src/client/components/LLMServiceSelect.tsx +58 -58
- package/src/client/components/MarkdownView.tsx +80 -80
- package/src/client/components/MergeRequests.tsx +790 -790
- package/src/client/components/PollingStatus.tsx +225 -225
- package/src/client/components/RepositoryConfig.tsx +335 -335
- package/src/client/components/RepositoryPermissions.tsx +123 -123
- package/src/client/components/ReviewFlows.tsx +303 -303
- package/src/client/components/ReviewHistory.tsx +566 -566
- package/src/client/components/RunReviewButton.tsx +63 -55
- package/src/client/context/GitManagerContext.tsx +92 -92
- package/src/client/index.tsx +91 -82
- package/src/client/locale.ts +9 -9
- package/src/client/promptTemplates.ts +31 -31
- package/src/client-v2/ai-context.tsx +99 -0
- package/src/client-v2/components/SubtreeSplits.tsx +547 -547
- package/src/client-v2/index.tsx +1 -1
- package/src/client-v2/locale.ts +8 -8
- package/src/client-v2/plugin.tsx +67 -39
- package/src/index.ts +2 -2
- package/src/locale/en-US.json +307 -297
- package/src/locale/vi-VN.json +295 -292
- package/src/locale/zh-CN.json +61 -51
- package/src/server/__tests__/git-actions.test.ts +24 -24
- package/src/server/__tests__/git-security.test.ts +170 -0
- package/src/server/__tests__/plugin-url-security.test.ts +17 -17
- package/src/server/__tests__/poller-lifecycle.test.ts +71 -0
- package/src/server/__tests__/poller.test.ts +37 -37
- package/src/server/__tests__/repository-access.test.ts +752 -752
- package/src/server/__tests__/review.test.ts +137 -137
- package/src/server/__tests__/role-permissions.test.ts +147 -147
- package/src/server/__tests__/smoke.test.ts +139 -17
- package/src/server/__tests__/subtree.test.ts +85 -85
- package/src/server/actions/git-actions.ts +540 -480
- package/src/server/actions/gitlab-api.ts +422 -411
- package/src/server/actions/poller.ts +39 -27
- package/src/server/actions/review.ts +1388 -1369
- package/src/server/actions/role-permissions.ts +321 -321
- package/src/server/actions/subtree.ts +508 -508
- package/src/server/ai-tools.ts +319 -319
- package/src/server/collections/gitAccounts.ts +56 -56
- package/src/server/collections/gitCodeReviews.ts +199 -199
- package/src/server/collections/gitRepositories.ts +87 -87
- package/src/server/collections/gitReviewFlows.ts +108 -108
- package/src/server/collections/gitSubtreeConfigs.ts +38 -38
- package/src/server/collections/gitSubtreeRuns.ts +30 -30
- package/src/server/index.ts +2 -2
- package/src/server/migrations/20260508000000-add-auto-review-flow-id.ts +29 -29
- package/src/server/migrations/20260712000000-add-git-accounts.ts +198 -198
- package/src/server/migrations/20260730000000-migrate-legacy-repository-permissions.ts +81 -81
- package/src/server/plugin.ts +372 -361
- package/src/server/poller.ts +351 -352
- package/src/server/repository-access.ts +773 -773
- package/src/server/request-method-policy.ts +55 -0
- package/src/server/services/__tests__/registry-content-service.test.ts +359 -345
- package/src/server/services/registry-content-service.ts +33 -11
- package/src/server/utils/__tests__/redact.test.ts +56 -56
- package/src/server/utils/__tests__/url-security.test.ts +85 -85
- package/src/server/utils/get-repo-account.ts +51 -41
- package/src/server/utils/gitlab-url.ts +38 -38
- package/src/server/utils/redact.ts +87 -87
- package/src/server/utils/url-security.ts +128 -95
- package/dist/client/900.acf7d1fa22f95e71.js +0 -10
- package/dist/client-v2/434.7a27051db18526c0.js +0 -10
- package/dist/client-v2/900.f32b9dc85249fc0a.js +0 -10
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import { Tabs, Select, Space, Typography, Tag, theme } from 'antd';
|
|
3
|
-
import {
|
|
4
|
-
BranchesOutlined,
|
|
5
|
-
FolderOutlined,
|
|
6
|
-
HistoryOutlined,
|
|
7
|
-
ToolOutlined,
|
|
8
|
-
DatabaseOutlined,
|
|
9
|
-
MergeOutlined,
|
|
10
|
-
RobotOutlined,
|
|
11
|
-
AuditOutlined,
|
|
12
|
-
ClockCircleOutlined,
|
|
13
|
-
} from '@ant-design/icons';
|
|
14
|
-
import { GitManagerProvider, useGitManager } from '../context/GitManagerContext';
|
|
15
|
-
import { FileExplorer } from './FileExplorer';
|
|
16
|
-
import { CommitHistory } from './CommitHistory';
|
|
17
|
-
import { MergeRequests } from './MergeRequests';
|
|
18
|
-
import { GitOperations } from './GitOperations';
|
|
19
|
-
import { ReviewFlows } from './ReviewFlows';
|
|
20
|
-
import { ReviewHistory } from './ReviewHistory';
|
|
21
|
-
import { PollingStatus } from './PollingStatus';
|
|
22
|
-
import { useT } from '../locale';
|
|
23
|
-
|
|
24
|
-
const { Text } = Typography;
|
|
25
|
-
const { useToken } = theme;
|
|
26
|
-
|
|
27
|
-
const GitManagerContent: React.FC = () => {
|
|
28
|
-
const t = useT();
|
|
29
|
-
const { token } = useToken();
|
|
30
|
-
const { repos, selectedRepo, setSelectedRepo, refreshRepos } = useGitManager();
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
refreshRepos();
|
|
34
|
-
}, []);
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<div style={{ height: '100%' }}>
|
|
38
|
-
{/* Repository selector bar */}
|
|
39
|
-
<div
|
|
40
|
-
style={{
|
|
41
|
-
padding: '12px 0',
|
|
42
|
-
marginBottom: 16,
|
|
43
|
-
display: 'flex',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
gap: 12,
|
|
46
|
-
borderBottom: `1px solid ${token.colorBorderSecondary}`,
|
|
47
|
-
}}
|
|
48
|
-
>
|
|
49
|
-
<DatabaseOutlined style={{ fontSize: 16 }} />
|
|
50
|
-
<Text strong>Repository:</Text>
|
|
51
|
-
<Select
|
|
52
|
-
style={{ minWidth: 250 }}
|
|
53
|
-
placeholder={t('Select a repository')}
|
|
54
|
-
value={selectedRepo?.id}
|
|
55
|
-
onChange={(id) => {
|
|
56
|
-
const repo = repos.find((r) => r.id === id);
|
|
57
|
-
setSelectedRepo(repo || null);
|
|
58
|
-
}}
|
|
59
|
-
options={repos.map((r) => ({
|
|
60
|
-
label: (
|
|
61
|
-
<Space>
|
|
62
|
-
{r.name}
|
|
63
|
-
<Tag color={r.status === 'connected' ? 'green' : 'default'} style={{ fontSize: 11 }}>
|
|
64
|
-
{r.status === 'connected' ? t('Connected') : t('Disconnected')}
|
|
65
|
-
</Tag>
|
|
66
|
-
</Space>
|
|
67
|
-
),
|
|
68
|
-
value: r.id,
|
|
69
|
-
}))}
|
|
70
|
-
allowClear
|
|
71
|
-
onClear={() => setSelectedRepo(null)}
|
|
72
|
-
/>
|
|
73
|
-
{selectedRepo && (
|
|
74
|
-
<Text type="secondary" style={{ fontSize: 12 }}>
|
|
75
|
-
{selectedRepo.repoUrl}
|
|
76
|
-
</Text>
|
|
77
|
-
)}
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<Tabs
|
|
81
|
-
type="card"
|
|
82
|
-
defaultActiveKey="explorer"
|
|
83
|
-
destroyInactiveTabPane
|
|
84
|
-
items={[
|
|
85
|
-
{
|
|
86
|
-
key: 'explorer',
|
|
87
|
-
label: (
|
|
88
|
-
<span>
|
|
89
|
-
<FolderOutlined /> {t('File Explorer')}
|
|
90
|
-
</span>
|
|
91
|
-
),
|
|
92
|
-
children: <FileExplorer />,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
key: 'history',
|
|
96
|
-
label: (
|
|
97
|
-
<span>
|
|
98
|
-
<HistoryOutlined /> {t('History')}
|
|
99
|
-
</span>
|
|
100
|
-
),
|
|
101
|
-
children: <CommitHistory />,
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
key: 'merge-requests',
|
|
105
|
-
label: (
|
|
106
|
-
<span>
|
|
107
|
-
<MergeOutlined /> {t('Merge Requests')}
|
|
108
|
-
</span>
|
|
109
|
-
),
|
|
110
|
-
children: <MergeRequests />,
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
key: 'operations',
|
|
114
|
-
label: (
|
|
115
|
-
<span>
|
|
116
|
-
<ToolOutlined /> {t('Operations')}
|
|
117
|
-
</span>
|
|
118
|
-
),
|
|
119
|
-
children: <GitOperations />,
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
key: 'review-flows',
|
|
123
|
-
label: (
|
|
124
|
-
<span>
|
|
125
|
-
<RobotOutlined /> {t('Review Flows')}
|
|
126
|
-
</span>
|
|
127
|
-
),
|
|
128
|
-
children: <ReviewFlows />,
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
key: 'review-history',
|
|
132
|
-
label: (
|
|
133
|
-
<span>
|
|
134
|
-
<AuditOutlined /> {t('Review History')}
|
|
135
|
-
</span>
|
|
136
|
-
),
|
|
137
|
-
children: <ReviewHistory />,
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
key: 'polling',
|
|
141
|
-
label: (
|
|
142
|
-
<span>
|
|
143
|
-
<ClockCircleOutlined /> {t('Polling')}
|
|
144
|
-
</span>
|
|
145
|
-
),
|
|
146
|
-
children: <PollingStatus />,
|
|
147
|
-
},
|
|
148
|
-
]}
|
|
149
|
-
/>
|
|
150
|
-
</div>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export const GitManagerSettings: React.FC = () => {
|
|
155
|
-
return (
|
|
156
|
-
<GitManagerProvider>
|
|
157
|
-
<GitManagerContent />
|
|
158
|
-
</GitManagerProvider>
|
|
159
|
-
);
|
|
160
|
-
};
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Tabs, Select, Space, Typography, Tag, theme } from 'antd';
|
|
3
|
+
import {
|
|
4
|
+
BranchesOutlined,
|
|
5
|
+
FolderOutlined,
|
|
6
|
+
HistoryOutlined,
|
|
7
|
+
ToolOutlined,
|
|
8
|
+
DatabaseOutlined,
|
|
9
|
+
MergeOutlined,
|
|
10
|
+
RobotOutlined,
|
|
11
|
+
AuditOutlined,
|
|
12
|
+
ClockCircleOutlined,
|
|
13
|
+
} from '@ant-design/icons';
|
|
14
|
+
import { GitManagerProvider, useGitManager } from '../context/GitManagerContext';
|
|
15
|
+
import { FileExplorer } from './FileExplorer';
|
|
16
|
+
import { CommitHistory } from './CommitHistory';
|
|
17
|
+
import { MergeRequests } from './MergeRequests';
|
|
18
|
+
import { GitOperations } from './GitOperations';
|
|
19
|
+
import { ReviewFlows } from './ReviewFlows';
|
|
20
|
+
import { ReviewHistory } from './ReviewHistory';
|
|
21
|
+
import { PollingStatus } from './PollingStatus';
|
|
22
|
+
import { useT } from '../locale';
|
|
23
|
+
|
|
24
|
+
const { Text } = Typography;
|
|
25
|
+
const { useToken } = theme;
|
|
26
|
+
|
|
27
|
+
const GitManagerContent: React.FC = () => {
|
|
28
|
+
const t = useT();
|
|
29
|
+
const { token } = useToken();
|
|
30
|
+
const { repos, selectedRepo, setSelectedRepo, refreshRepos } = useGitManager();
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
refreshRepos();
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div style={{ height: '100%' }}>
|
|
38
|
+
{/* Repository selector bar */}
|
|
39
|
+
<div
|
|
40
|
+
style={{
|
|
41
|
+
padding: '12px 0',
|
|
42
|
+
marginBottom: 16,
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
gap: 12,
|
|
46
|
+
borderBottom: `1px solid ${token.colorBorderSecondary}`,
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<DatabaseOutlined style={{ fontSize: 16 }} />
|
|
50
|
+
<Text strong>Repository:</Text>
|
|
51
|
+
<Select
|
|
52
|
+
style={{ minWidth: 250 }}
|
|
53
|
+
placeholder={t('Select a repository')}
|
|
54
|
+
value={selectedRepo?.id}
|
|
55
|
+
onChange={(id) => {
|
|
56
|
+
const repo = repos.find((r) => r.id === id);
|
|
57
|
+
setSelectedRepo(repo || null);
|
|
58
|
+
}}
|
|
59
|
+
options={repos.map((r) => ({
|
|
60
|
+
label: (
|
|
61
|
+
<Space>
|
|
62
|
+
{r.name}
|
|
63
|
+
<Tag color={r.status === 'connected' ? 'green' : 'default'} style={{ fontSize: 11 }}>
|
|
64
|
+
{r.status === 'connected' ? t('Connected') : t('Disconnected')}
|
|
65
|
+
</Tag>
|
|
66
|
+
</Space>
|
|
67
|
+
),
|
|
68
|
+
value: r.id,
|
|
69
|
+
}))}
|
|
70
|
+
allowClear
|
|
71
|
+
onClear={() => setSelectedRepo(null)}
|
|
72
|
+
/>
|
|
73
|
+
{selectedRepo && (
|
|
74
|
+
<Text type="secondary" style={{ fontSize: 12 }}>
|
|
75
|
+
{selectedRepo.repoUrl}
|
|
76
|
+
</Text>
|
|
77
|
+
)}
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<Tabs
|
|
81
|
+
type="card"
|
|
82
|
+
defaultActiveKey="explorer"
|
|
83
|
+
destroyInactiveTabPane
|
|
84
|
+
items={[
|
|
85
|
+
{
|
|
86
|
+
key: 'explorer',
|
|
87
|
+
label: (
|
|
88
|
+
<span>
|
|
89
|
+
<FolderOutlined /> {t('File Explorer')}
|
|
90
|
+
</span>
|
|
91
|
+
),
|
|
92
|
+
children: <FileExplorer />,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'history',
|
|
96
|
+
label: (
|
|
97
|
+
<span>
|
|
98
|
+
<HistoryOutlined /> {t('History')}
|
|
99
|
+
</span>
|
|
100
|
+
),
|
|
101
|
+
children: <CommitHistory />,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: 'merge-requests',
|
|
105
|
+
label: (
|
|
106
|
+
<span>
|
|
107
|
+
<MergeOutlined /> {t('Merge Requests')}
|
|
108
|
+
</span>
|
|
109
|
+
),
|
|
110
|
+
children: <MergeRequests />,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: 'operations',
|
|
114
|
+
label: (
|
|
115
|
+
<span>
|
|
116
|
+
<ToolOutlined /> {t('Operations')}
|
|
117
|
+
</span>
|
|
118
|
+
),
|
|
119
|
+
children: <GitOperations />,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
key: 'review-flows',
|
|
123
|
+
label: (
|
|
124
|
+
<span>
|
|
125
|
+
<RobotOutlined /> {t('Review Flows')}
|
|
126
|
+
</span>
|
|
127
|
+
),
|
|
128
|
+
children: <ReviewFlows />,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
key: 'review-history',
|
|
132
|
+
label: (
|
|
133
|
+
<span>
|
|
134
|
+
<AuditOutlined /> {t('Review History')}
|
|
135
|
+
</span>
|
|
136
|
+
),
|
|
137
|
+
children: <ReviewHistory />,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: 'polling',
|
|
141
|
+
label: (
|
|
142
|
+
<span>
|
|
143
|
+
<ClockCircleOutlined /> {t('Polling')}
|
|
144
|
+
</span>
|
|
145
|
+
),
|
|
146
|
+
children: <PollingStatus />,
|
|
147
|
+
},
|
|
148
|
+
]}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const GitManagerSettings: React.FC = () => {
|
|
155
|
+
return (
|
|
156
|
+
<GitManagerProvider>
|
|
157
|
+
<GitManagerContent />
|
|
158
|
+
</GitManagerProvider>
|
|
159
|
+
);
|
|
160
|
+
};
|