gitlab-auto-reviewers 2.0.0 → 2.0.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/README.md +20 -10
- package/dist/bin/cli.js +161 -79
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/deprecated-mcp.d.ts +3 -4
- package/dist/bin/deprecated-mcp.d.ts.map +1 -1
- package/dist/bin/deprecated-mcp.js +28 -57
- package/dist/bin/deprecated-mcp.js.map +1 -1
- package/dist/cli/cicd-integration.d.ts +127 -0
- package/dist/cli/cicd-integration.d.ts.map +1 -0
- package/dist/cli/cicd-integration.js +381 -0
- package/dist/cli/cicd-integration.js.map +1 -0
- package/dist/cli/commands.d.ts +21 -4
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +331 -71
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/config.d.ts +138 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +266 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/consistency-validator.d.ts +175 -0
- package/dist/cli/consistency-validator.d.ts.map +1 -0
- package/dist/cli/consistency-validator.js +599 -0
- package/dist/cli/consistency-validator.js.map +1 -0
- package/dist/cli/data-source-consistency.d.ts +105 -0
- package/dist/cli/data-source-consistency.d.ts.map +1 -0
- package/dist/cli/data-source-consistency.js +271 -0
- package/dist/cli/data-source-consistency.js.map +1 -0
- package/dist/cli/data-source-selector.d.ts +97 -0
- package/dist/cli/data-source-selector.d.ts.map +1 -0
- package/dist/cli/data-source-selector.js +203 -0
- package/dist/cli/data-source-selector.js.map +1 -0
- package/dist/cli/errors.d.ts +105 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +573 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/output.d.ts +43 -3
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +157 -30
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/template-engine.d.ts +109 -0
- package/dist/cli/template-engine.d.ts.map +1 -0
- package/dist/cli/template-engine.js +220 -0
- package/dist/cli/template-engine.js.map +1 -0
- package/dist/datasources/local-git-data-source.d.ts +13 -0
- package/dist/datasources/local-git-data-source.d.ts.map +1 -1
- package/dist/datasources/local-git-data-source.js +24 -0
- package/dist/datasources/local-git-data-source.js.map +1 -1
- package/dist/services/reviewer-service.d.ts +22 -0
- package/dist/services/reviewer-service.d.ts.map +1 -1
- package/dist/services/reviewer-service.js +90 -0
- package/dist/services/reviewer-service.js.map +1 -1
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -53,23 +53,26 @@ Or add it to your MCP configuration (see [MCP Integration](#mcp-integration) sec
|
|
|
53
53
|
|
|
54
54
|
### CLI Mode
|
|
55
55
|
|
|
56
|
-
Use the command-line interface for
|
|
56
|
+
Use the command-line interface for posting reviewer suggestions:
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
#
|
|
59
|
+
# Posts reviewer suggestions as comments (default behavior)
|
|
60
60
|
npx gitlab-auto-reviewers cli --project my-group/my-project --mr 123
|
|
61
61
|
|
|
62
|
-
#
|
|
62
|
+
# Analysis only (use --dry-run for testing)
|
|
63
|
+
npx gitlab-auto-reviewers cli --project my-group/my-project --mr 123 --dry-run
|
|
64
|
+
|
|
65
|
+
# Post suggestions for a branch
|
|
63
66
|
npx gitlab-auto-reviewers cli --project my-group/my-project --branch feature/new-feature
|
|
64
67
|
|
|
65
|
-
#
|
|
68
|
+
# JSON output for automation (still posts comments)
|
|
66
69
|
npx gitlab-auto-reviewers cli --project my-group/my-project --mr 123 --format json
|
|
67
70
|
|
|
68
|
-
# Use local git repository (faster
|
|
71
|
+
# Use local git repository (faster analysis)
|
|
69
72
|
npx gitlab-auto-reviewers cli --repo-path /path/to/repo --mr 123
|
|
70
73
|
```
|
|
71
74
|
|
|
72
|
-
See [CLI Usage](#cli-usage) section for detailed documentation.
|
|
75
|
+
See [CLI Usage](#cli-usage) section and [Migration Guide](./docs/MIGRATION-CLI-v2.md) for detailed documentation.
|
|
73
76
|
|
|
74
77
|
### Library Mode
|
|
75
78
|
|
|
@@ -124,7 +127,14 @@ Version 2.0 brings significant improvements to reliability, performance, and dev
|
|
|
124
127
|
- **Default values** with logging
|
|
125
128
|
- **Multiple configuration profiles** (development, production, etc.)
|
|
126
129
|
|
|
127
|
-
|
|
130
|
+
### 💬 CLI Enhancement (Breaking Change)
|
|
131
|
+
- **Comment posting by default** - CLI now posts reviewer suggestions as comments
|
|
132
|
+
- **Dry-run mode** with `--dry-run` flag for analysis-only
|
|
133
|
+
- **Cross-interface consistency** - CLI behavior matches MCP server
|
|
134
|
+
- **Enhanced help system** with actionable error messages
|
|
135
|
+
- **Migration guide** for upgrading from v1.x
|
|
136
|
+
|
|
137
|
+
See [MIGRATION.md](./MIGRATION.md) and [CLI Migration Guide](./docs/MIGRATION-CLI-v2.md) for detailed upgrade instructions.
|
|
128
138
|
|
|
129
139
|
## Features
|
|
130
140
|
|
|
@@ -252,7 +262,7 @@ The server can be configured through environment variables or tool parameters.
|
|
|
252
262
|
| `CACHE_ENABLED` | Enable in-memory caching | `true` | No |
|
|
253
263
|
| `CACHE_TTL` | Cache TTL in milliseconds | `300000` (5 min) | No |
|
|
254
264
|
| `MAX_PARALLEL_REQUESTS` | Max parallel API requests | `5` | No |
|
|
255
|
-
| `CONTRIBUTOR_DAYS` | Days to analyze for contributors | `
|
|
265
|
+
| `CONTRIBUTOR_DAYS` | Days to analyze for contributors | `352` | No |
|
|
256
266
|
| `MAX_RETRIES` | Max retry attempts for failures | `3` | No |
|
|
257
267
|
| `RETRY_DELAY_MS` | Initial retry delay in ms | `1000` | No |
|
|
258
268
|
| `LOG_LEVEL` | Logging level | `info` | No |
|
|
@@ -275,7 +285,7 @@ CACHE_TTL=300000
|
|
|
275
285
|
MAX_PARALLEL_REQUESTS=5
|
|
276
286
|
|
|
277
287
|
# Git Configuration
|
|
278
|
-
CONTRIBUTOR_DAYS=
|
|
288
|
+
CONTRIBUTOR_DAYS=352
|
|
279
289
|
MAX_RETRIES=3
|
|
280
290
|
RETRY_DELAY_MS=1000
|
|
281
291
|
|
|
@@ -311,7 +321,7 @@ MAX_RETRIES=1 # Fail fast
|
|
|
311
321
|
CACHE_ENABLED=true
|
|
312
322
|
CACHE_TTL=300000 # 5 minutes
|
|
313
323
|
MAX_PARALLEL_REQUESTS=5 # Moderate concurrency
|
|
314
|
-
CONTRIBUTOR_DAYS=
|
|
324
|
+
CONTRIBUTOR_DAYS=352 # Empirically optimized analysis
|
|
315
325
|
MAX_RETRIES=3 # Standard retries
|
|
316
326
|
LOG_LEVEL=info # Normal logging
|
|
317
327
|
DEBUG=false # Disable debug mode
|
package/dist/bin/cli.js
CHANGED
|
@@ -6,9 +6,26 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module bin/cli
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { inviteReviewersCommand, displayHelp } from "../cli/commands.js";
|
|
10
|
+
import { configLoader } from "../cli/config.js";
|
|
11
|
+
import { ParameterValidator, ErrorClassifier, CLIErrorCode, CLIError, formatCLIError } from "../cli/errors.js";
|
|
12
|
+
/**
|
|
13
|
+
* Extract format from arguments for error formatting
|
|
14
|
+
*
|
|
15
|
+
* @param args - Command line arguments
|
|
16
|
+
* @returns Format ('json' or 'text')
|
|
17
|
+
*/
|
|
18
|
+
function getFormatFromArgs(args) {
|
|
19
|
+
for (let i = 0; i < args.length; i++) {
|
|
20
|
+
if (args[i] === '--format' && args[i + 1]) {
|
|
21
|
+
const format = args[i + 1];
|
|
22
|
+
if (format === 'json' || format === 'text') {
|
|
23
|
+
return format;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return 'text';
|
|
28
|
+
}
|
|
12
29
|
/**
|
|
13
30
|
* Parse command-line arguments
|
|
14
31
|
*
|
|
@@ -17,7 +34,9 @@ import { resolve } from "path";
|
|
|
17
34
|
*/
|
|
18
35
|
function parseArguments(args) {
|
|
19
36
|
const options = {
|
|
20
|
-
|
|
37
|
+
dryRun: false,
|
|
38
|
+
verbose: false,
|
|
39
|
+
quiet: false,
|
|
21
40
|
};
|
|
22
41
|
for (let i = 0; i < args.length; i++) {
|
|
23
42
|
const arg = args[i];
|
|
@@ -28,98 +47,131 @@ function parseArguments(args) {
|
|
|
28
47
|
return null; // Signal to display help
|
|
29
48
|
case '--repo-path':
|
|
30
49
|
if (!nextArg || nextArg.startsWith('--')) {
|
|
31
|
-
|
|
32
|
-
process.exit(1);
|
|
50
|
+
throw new CLIError('--repo-path requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --repo-path to specify the path to your git repository');
|
|
33
51
|
}
|
|
34
52
|
options.repoPath = nextArg;
|
|
35
53
|
i++;
|
|
36
54
|
break;
|
|
55
|
+
case '--project':
|
|
56
|
+
if (!nextArg || nextArg.startsWith('--')) {
|
|
57
|
+
throw new CLIError('--project requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --project to specify the GitLab project ID or path');
|
|
58
|
+
}
|
|
59
|
+
// Handle both numeric project IDs and project paths
|
|
60
|
+
const projectValue = isNaN(Number(nextArg)) ? nextArg : Number(nextArg);
|
|
61
|
+
options.project = projectValue;
|
|
62
|
+
i++;
|
|
63
|
+
break;
|
|
37
64
|
case '--mr':
|
|
38
65
|
if (!nextArg || nextArg.startsWith('--')) {
|
|
39
|
-
|
|
40
|
-
process.exit(1);
|
|
66
|
+
throw new CLIError('--mr requires a merge request IID', CLIErrorCode.VALIDATION_ERROR, 'Use --mr followed by a positive number (e.g., --mr 123)');
|
|
41
67
|
}
|
|
42
68
|
const mrIid = parseInt(nextArg, 10);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
69
|
+
try {
|
|
70
|
+
options.mergeRequestIid = ParameterValidator.validateMergeRequestIid(mrIid);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
// Pre-parse format for error formatting
|
|
74
|
+
const format = getFormatFromArgs(args);
|
|
75
|
+
const formattedError = formatCLIError(error instanceof Error ? error : new Error(String(error)), format);
|
|
76
|
+
console.error(formattedError);
|
|
77
|
+
process.exit(CLIErrorCode.VALIDATION_ERROR);
|
|
46
78
|
}
|
|
47
|
-
options.mergeRequestIid = mrIid;
|
|
48
79
|
i++;
|
|
49
80
|
break;
|
|
50
81
|
case '--branch':
|
|
51
82
|
if (!nextArg || nextArg.startsWith('--')) {
|
|
52
|
-
|
|
53
|
-
process.exit(1);
|
|
83
|
+
throw new CLIError('--branch requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --branch followed by a valid branch name');
|
|
54
84
|
}
|
|
55
85
|
options.branch = nextArg;
|
|
56
86
|
i++;
|
|
57
87
|
break;
|
|
58
88
|
case '--gitlab-url':
|
|
59
89
|
if (!nextArg || nextArg.startsWith('--')) {
|
|
60
|
-
|
|
61
|
-
process.exit(1);
|
|
90
|
+
throw new CLIError('--gitlab-url requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --gitlab-url followed by a valid GitLab URL');
|
|
62
91
|
}
|
|
63
92
|
options.gitlabUrl = nextArg;
|
|
64
93
|
i++;
|
|
65
94
|
break;
|
|
66
95
|
case '--gitlab-token':
|
|
67
96
|
if (!nextArg || nextArg.startsWith('--')) {
|
|
68
|
-
|
|
69
|
-
process.exit(1);
|
|
97
|
+
throw new CLIError('--gitlab-token requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --gitlab-token followed by your GitLab personal access token');
|
|
70
98
|
}
|
|
71
99
|
options.gitlabToken = nextArg;
|
|
72
100
|
i++;
|
|
73
101
|
break;
|
|
74
102
|
case '--format':
|
|
75
103
|
if (!nextArg || nextArg.startsWith('--')) {
|
|
76
|
-
|
|
77
|
-
process.exit(1);
|
|
104
|
+
throw new CLIError('--format requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --format json or --format text');
|
|
78
105
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
106
|
+
try {
|
|
107
|
+
options.format = ParameterValidator.validateFormat(nextArg);
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
// For format validation errors, we can use the attempted format if it's json
|
|
111
|
+
const format = nextArg === 'json' ? 'json' : 'text';
|
|
112
|
+
const formattedError = formatCLIError(error instanceof Error ? error : new Error(String(error)), format);
|
|
113
|
+
console.error(formattedError);
|
|
114
|
+
process.exit(CLIErrorCode.VALIDATION_ERROR);
|
|
82
115
|
}
|
|
83
|
-
options.format = nextArg;
|
|
84
116
|
i++;
|
|
85
117
|
break;
|
|
86
118
|
case '--verbose':
|
|
87
119
|
case '-v':
|
|
88
120
|
options.verbose = true;
|
|
89
121
|
break;
|
|
122
|
+
case '--dry-run':
|
|
123
|
+
options.dryRun = true;
|
|
124
|
+
break;
|
|
125
|
+
case '--template':
|
|
126
|
+
if (!nextArg || nextArg.startsWith('--')) {
|
|
127
|
+
throw new CLIError('--template requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --template followed by a template file path');
|
|
128
|
+
}
|
|
129
|
+
options.template = nextArg;
|
|
130
|
+
i++;
|
|
131
|
+
break;
|
|
132
|
+
case '--config':
|
|
133
|
+
if (!nextArg || nextArg.startsWith('--')) {
|
|
134
|
+
throw new CLIError('--config requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --config followed by a configuration file path');
|
|
135
|
+
}
|
|
136
|
+
options.config = nextArg;
|
|
137
|
+
i++;
|
|
138
|
+
break;
|
|
139
|
+
case '--log-file':
|
|
140
|
+
if (!nextArg || nextArg.startsWith('--')) {
|
|
141
|
+
throw new CLIError('--log-file requires a value', CLIErrorCode.VALIDATION_ERROR, 'Use --log-file followed by a log file path');
|
|
142
|
+
}
|
|
143
|
+
options.logFile = nextArg;
|
|
144
|
+
i++;
|
|
145
|
+
break;
|
|
146
|
+
case '--quiet':
|
|
147
|
+
case '-q':
|
|
148
|
+
options.quiet = true;
|
|
149
|
+
break;
|
|
150
|
+
case '--validate-consistency':
|
|
151
|
+
options.validateConsistency = true;
|
|
152
|
+
break;
|
|
153
|
+
case '--compare-data-sources':
|
|
154
|
+
options.compareDataSources = true;
|
|
155
|
+
break;
|
|
90
156
|
default:
|
|
91
|
-
|
|
92
|
-
console.error('Use --help to see available options');
|
|
93
|
-
process.exit(1);
|
|
157
|
+
throw new CLIError(`Unknown option: ${arg}`, CLIErrorCode.VALIDATION_ERROR, 'Use --help to see available options');
|
|
94
158
|
}
|
|
95
159
|
}
|
|
96
160
|
return options;
|
|
97
161
|
}
|
|
98
162
|
/**
|
|
99
|
-
* Validate
|
|
163
|
+
* Validate that either repo path or project is provided
|
|
100
164
|
*
|
|
101
|
-
* @param
|
|
102
|
-
* @
|
|
103
|
-
* @throws Error if path is invalid
|
|
165
|
+
* @param options - CLI options to validate
|
|
166
|
+
* @throws Error if neither or both are provided
|
|
104
167
|
*/
|
|
105
|
-
function
|
|
106
|
-
if (!repoPath) {
|
|
107
|
-
throw new
|
|
168
|
+
function validateDataSourceOptions(options) {
|
|
169
|
+
if (!options.repoPath && !options.project) {
|
|
170
|
+
throw new CLIError('Repository path is required', CLIErrorCode.VALIDATION_ERROR, 'Use --repo-path to specify the path to your git repository or --project for GitLab API access');
|
|
108
171
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
throw new Error(`Repository path does not exist: ${absolutePath}`);
|
|
172
|
+
if (options.repoPath && options.project) {
|
|
173
|
+
throw new CLIError('Cannot specify both --repo-path and --project', CLIErrorCode.VALIDATION_ERROR, 'Choose either --repo-path for local git analysis OR --project for GitLab API analysis');
|
|
112
174
|
}
|
|
113
|
-
const stats = statSync(absolutePath);
|
|
114
|
-
if (!stats.isDirectory()) {
|
|
115
|
-
throw new Error(`Repository path is not a directory: ${absolutePath}`);
|
|
116
|
-
}
|
|
117
|
-
// Check if it's a git repository
|
|
118
|
-
const gitDir = resolve(absolutePath, '.git');
|
|
119
|
-
if (!existsSync(gitDir)) {
|
|
120
|
-
throw new Error(`Not a git repository: ${absolutePath} (no .git directory found)`);
|
|
121
|
-
}
|
|
122
|
-
return absolutePath;
|
|
123
175
|
}
|
|
124
176
|
/**
|
|
125
177
|
* Main CLI execution
|
|
@@ -133,54 +185,84 @@ async function main() {
|
|
|
133
185
|
// Handle help for CLI subcommand
|
|
134
186
|
if (cliArgs.length === 0 || cliArgs.includes('--help') || cliArgs.includes('-h')) {
|
|
135
187
|
displayHelp();
|
|
188
|
+
// Show migration notice if no arguments provided
|
|
189
|
+
if (cliArgs.length === 0) {
|
|
190
|
+
console.log('\n' + '='.repeat(80));
|
|
191
|
+
console.log('🚀 NEW IN v2.0: CLI now posts comments by default!');
|
|
192
|
+
console.log('');
|
|
193
|
+
console.log('If you were using v1.x for analysis only, add --dry-run:');
|
|
194
|
+
console.log(' OLD: gitlab-auto-reviewers cli --repo-path . --mr 123');
|
|
195
|
+
console.log(' NEW: gitlab-auto-reviewers cli --repo-path . --mr 123 --dry-run');
|
|
196
|
+
console.log('');
|
|
197
|
+
console.log('📖 See migration guide: docs/MIGRATION-CLI-v2.md');
|
|
198
|
+
console.log('='.repeat(80));
|
|
199
|
+
}
|
|
136
200
|
process.exit(0);
|
|
137
201
|
}
|
|
138
|
-
|
|
139
|
-
const options = parseArguments(cliArgs);
|
|
140
|
-
if (!options) {
|
|
141
|
-
displayHelp();
|
|
142
|
-
process.exit(0);
|
|
143
|
-
}
|
|
202
|
+
let options = null;
|
|
144
203
|
try {
|
|
145
|
-
//
|
|
146
|
-
options
|
|
204
|
+
// Parse arguments
|
|
205
|
+
options = parseArguments(cliArgs);
|
|
206
|
+
if (!options) {
|
|
207
|
+
displayHelp();
|
|
208
|
+
process.exit(0);
|
|
209
|
+
}
|
|
210
|
+
// Load configuration
|
|
211
|
+
const config = await configLoader.load(options.config);
|
|
212
|
+
// Merge CLI options with configuration
|
|
213
|
+
const mergedOptions = configLoader.mergeWithCLIOptions(options, config);
|
|
214
|
+
// Validate final configuration
|
|
215
|
+
configLoader.validateConfiguration(mergedOptions);
|
|
216
|
+
// Validate data source options
|
|
217
|
+
validateDataSourceOptions(mergedOptions);
|
|
147
218
|
// Execute command
|
|
148
|
-
const exitCode = await
|
|
219
|
+
const exitCode = await inviteReviewersCommand(mergedOptions);
|
|
149
220
|
process.exit(exitCode);
|
|
150
221
|
}
|
|
151
222
|
catch (error) {
|
|
152
|
-
const
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
console.error('\nStack trace:');
|
|
165
|
-
console.error(error.stack);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
process.exit(1);
|
|
223
|
+
const cliError = error instanceof Error ? error : new Error(String(error));
|
|
224
|
+
// Use CLIError exit code if it's a CLIError, otherwise use ErrorClassifier
|
|
225
|
+
const errorCode = cliError instanceof CLIError
|
|
226
|
+
? cliError.exitCode
|
|
227
|
+
: ErrorClassifier.classifyError(cliError);
|
|
228
|
+
// Format and output error with guidance
|
|
229
|
+
// Use format from options if available, otherwise default to text
|
|
230
|
+
const format = options?.format || 'text';
|
|
231
|
+
const verbose = options?.verbose || false;
|
|
232
|
+
const formattedError = formatCLIError(cliError, format, verbose);
|
|
233
|
+
console.error(formattedError);
|
|
234
|
+
process.exit(errorCode);
|
|
169
235
|
}
|
|
170
236
|
}
|
|
171
237
|
// Handle uncaught errors
|
|
172
238
|
process.on('uncaughtException', (error) => {
|
|
173
|
-
|
|
174
|
-
|
|
239
|
+
const errorCode = error instanceof CLIError
|
|
240
|
+
? error.exitCode
|
|
241
|
+
: ErrorClassifier.classifyError(error);
|
|
242
|
+
const formattedError = formatCLIError(error, 'text', false);
|
|
243
|
+
console.error('Uncaught exception:');
|
|
244
|
+
console.error(formattedError);
|
|
245
|
+
process.exit(errorCode);
|
|
175
246
|
});
|
|
176
247
|
process.on('unhandledRejection', (reason) => {
|
|
177
248
|
const error = reason instanceof Error ? reason : new Error(String(reason));
|
|
178
|
-
|
|
179
|
-
|
|
249
|
+
const errorCode = error instanceof CLIError
|
|
250
|
+
? error.exitCode
|
|
251
|
+
: ErrorClassifier.classifyError(error);
|
|
252
|
+
const formattedError = formatCLIError(error, 'text', false);
|
|
253
|
+
console.error('Unhandled rejection:');
|
|
254
|
+
console.error(formattedError);
|
|
255
|
+
process.exit(errorCode);
|
|
180
256
|
});
|
|
181
257
|
// Run main function
|
|
182
258
|
main().catch((error) => {
|
|
183
|
-
|
|
184
|
-
|
|
259
|
+
const cliError = error instanceof Error ? error : new Error(String(error));
|
|
260
|
+
const errorCode = cliError instanceof CLIError
|
|
261
|
+
? cliError.exitCode
|
|
262
|
+
: ErrorClassifier.classifyError(cliError);
|
|
263
|
+
const formattedError = formatCLIError(cliError, 'text', false);
|
|
264
|
+
console.error('Fatal error:');
|
|
265
|
+
console.error(formattedError);
|
|
266
|
+
process.exit(errorCode);
|
|
185
267
|
});
|
|
186
268
|
//# sourceMappingURL=cli.js.map
|
package/dist/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAc,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,cAAc,EACf,MAAM,kBAAkB,CAAC;AAE1B;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,IAAc;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,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AC,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,cAAc,GAAG,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/D,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Deprecated MCP Server Entry Point
|
|
4
4
|
*
|
|
5
|
-
* This
|
|
6
|
-
* It displays a deprecation warning and
|
|
5
|
+
* This file provides backward compatibility for the old auto-reviewers-mcp-server command.
|
|
6
|
+
* It displays a deprecation warning and delegates to the new gitlab-auto-reviewers mcp command.
|
|
7
7
|
*
|
|
8
|
-
* @deprecated Use
|
|
9
|
-
* @module bin/deprecated-mcp
|
|
8
|
+
* @deprecated Use `gitlab-auto-reviewers mcp` instead
|
|
10
9
|
*/
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=deprecated-mcp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-mcp.d.ts","sourceRoot":"","sources":["../../src/bin/deprecated-mcp.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"deprecated-mcp.d.ts","sourceRoot":"","sources":["../../src/bin/deprecated-mcp.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG"}
|
|
@@ -2,72 +2,43 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Deprecated MCP Server Entry Point
|
|
4
4
|
*
|
|
5
|
-
* This
|
|
6
|
-
* It displays a deprecation warning and
|
|
5
|
+
* This file provides backward compatibility for the old auto-reviewers-mcp-server command.
|
|
6
|
+
* It displays a deprecation warning and delegates to the new gitlab-auto-reviewers mcp command.
|
|
7
7
|
*
|
|
8
|
-
* @deprecated Use
|
|
9
|
-
* @module bin/deprecated-mcp
|
|
8
|
+
* @deprecated Use `gitlab-auto-reviewers mcp` instead
|
|
10
9
|
*/
|
|
11
|
-
import { AutoReviewerMCPServer } from
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
* Display deprecation warning
|
|
15
|
-
*/
|
|
16
|
-
function displayDeprecationWarning() {
|
|
17
|
-
console.error(`
|
|
18
|
-
╔════════════════════════════════════════════════════════════════════════════╗
|
|
19
|
-
║ DEPRECATION WARNING ║
|
|
20
|
-
╠════════════════════════════════════════════════════════════════════════════╣
|
|
21
|
-
║ ║
|
|
22
|
-
║ The command 'auto-reviewers-mcp-server' is deprecated and will be ║
|
|
23
|
-
║ removed in a future version. ║
|
|
24
|
-
║ ║
|
|
25
|
-
║ Please update your configuration to use the new command: ║
|
|
26
|
-
║ ║
|
|
27
|
-
║ npx gitlab-auto-reviewers mcp ║
|
|
28
|
-
║ ║
|
|
29
|
-
║ Or update your MCP client configuration to use: ║
|
|
30
|
-
║ ║
|
|
31
|
-
║ "command": "npx", ║
|
|
32
|
-
║ "args": ["-y", "gitlab-auto-reviewers", "mcp"] ║
|
|
33
|
-
║ ║
|
|
34
|
-
║ For more information, see the migration guide: ║
|
|
35
|
-
║ https://github.com/your-org/gitlab-auto-reviewers#migration ║
|
|
36
|
-
║ ║
|
|
37
|
-
╚════════════════════════════════════════════════════════════════════════════╝
|
|
38
|
-
`);
|
|
39
|
-
}
|
|
10
|
+
import { AutoReviewerMCPServer } from '../mcp/server.js';
|
|
11
|
+
import { Logger } from '../logging/logger.service.js';
|
|
12
|
+
const logger = new Logger('DeprecatedMCP');
|
|
40
13
|
// Display deprecation warning
|
|
41
|
-
|
|
42
|
-
|
|
14
|
+
console.error('');
|
|
15
|
+
console.error('⚠️ DEPRECATION WARNING ⚠️');
|
|
16
|
+
console.error('');
|
|
17
|
+
console.error('The command "auto-reviewers-mcp-server" is deprecated.');
|
|
18
|
+
console.error('Please use "gitlab-auto-reviewers mcp" instead.');
|
|
19
|
+
console.error('');
|
|
20
|
+
console.error('Migration guide:');
|
|
21
|
+
console.error(' Old: auto-reviewers-mcp-server');
|
|
22
|
+
console.error(' New: gitlab-auto-reviewers mcp');
|
|
23
|
+
console.error('');
|
|
24
|
+
console.error('Update your MCP configuration to use the new command.');
|
|
25
|
+
console.error('This deprecated command will be removed in a future version.');
|
|
26
|
+
console.error('');
|
|
27
|
+
// Log deprecation for monitoring
|
|
28
|
+
logger.warn('Deprecated MCP server command used', {
|
|
29
|
+
command: 'auto-reviewers-mcp-server',
|
|
30
|
+
replacement: 'gitlab-auto-reviewers mcp',
|
|
31
|
+
pid: process.pid,
|
|
32
|
+
});
|
|
33
|
+
// Delegate to the new server implementation (same as mcp.ts)
|
|
43
34
|
let server;
|
|
44
35
|
try {
|
|
45
36
|
server = new AutoReviewerMCPServer();
|
|
46
37
|
}
|
|
47
38
|
catch (error) {
|
|
48
39
|
console.error("Failed to initialize MCP server:", error);
|
|
49
|
-
console.error(ErrorHandler.formatError(error instanceof Error ? error : new Error(String(error))));
|
|
50
40
|
process.exit(1);
|
|
51
41
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
process.exit(0);
|
|
55
|
-
});
|
|
56
|
-
process.on("SIGTERM", async () => {
|
|
57
|
-
await server.shutdown();
|
|
58
|
-
process.exit(0);
|
|
59
|
-
});
|
|
60
|
-
process.on('uncaughtException', (error) => {
|
|
61
|
-
console.error('Uncaught exception:', ErrorHandler.formatError(error));
|
|
62
|
-
server.shutdown().finally(() => process.exit(1));
|
|
63
|
-
});
|
|
64
|
-
process.on('unhandledRejection', (reason) => {
|
|
65
|
-
const error = reason instanceof Error ? reason : new Error(String(reason));
|
|
66
|
-
console.error('Unhandled rejection:', ErrorHandler.formatError(error));
|
|
67
|
-
server.shutdown().finally(() => process.exit(1));
|
|
68
|
-
});
|
|
69
|
-
server.run().catch((error) => {
|
|
70
|
-
console.error("Failed to start MCP server:", ErrorHandler.formatError(error));
|
|
71
|
-
process.exit(1);
|
|
72
|
-
});
|
|
42
|
+
// Start the server
|
|
43
|
+
server.run();
|
|
73
44
|
//# sourceMappingURL=deprecated-mcp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-mcp.js","sourceRoot":"","sources":["../../src/bin/deprecated-mcp.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"deprecated-mcp.js","sourceRoot":"","sources":["../../src/bin/deprecated-mcp.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC;AAE3C,8BAA8B;AAC9B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAClB,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAC5C,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAClB,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;AACxE,OAAO,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACjE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAClB,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAClC,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAClD,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAClD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAClB,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;AACvE,OAAO,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;AAC9E,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAElB,iCAAiC;AACjC,MAAM,CAAC,IAAI,CAAC,oCAAoC,EAAE;IAChD,OAAO,EA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