gitlab-auto-reviewers 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +20 -10
- package/dist/bin/cli.js +155 -85
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/index.d.ts +1 -8
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +26 -9
- package/dist/bin/index.js.map +1 -1
- package/dist/bin/mcp.js +0 -0
- 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 +385 -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 +417 -71
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/config.d.ts +145 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +277 -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 +103 -0
- package/dist/cli/data-source-selector.d.ts.map +1 -0
- package/dist/cli/data-source-selector.js +242 -0
- package/dist/cli/data-source-selector.js.map +1 -0
- package/dist/cli/enhanced-cli.d.ts +104 -0
- package/dist/cli/enhanced-cli.d.ts.map +1 -0
- package/dist/cli/enhanced-cli.js +321 -0
- package/dist/cli/enhanced-cli.js.map +1 -0
- package/dist/cli/enhanced-data-source-resolver.d.ts +67 -0
- package/dist/cli/enhanced-data-source-resolver.d.ts.map +1 -0
- package/dist/cli/enhanced-data-source-resolver.js +249 -0
- package/dist/cli/enhanced-data-source-resolver.js.map +1 -0
- package/dist/cli/enhanced-parameter-resolver.d.ts +111 -0
- package/dist/cli/enhanced-parameter-resolver.d.ts.map +1 -0
- package/dist/cli/enhanced-parameter-resolver.js +233 -0
- package/dist/cli/enhanced-parameter-resolver.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 +577 -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/parameter-source-tracker.d.ts +169 -0
- package/dist/cli/parameter-source-tracker.d.ts.map +1 -0
- package/dist/cli/parameter-source-tracker.js +252 -0
- package/dist/cli/parameter-source-tracker.js.map +1 -0
- 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/config/config.service.d.ts +24 -2
- package/dist/config/config.service.d.ts.map +1 -1
- package/dist/config/config.service.js +39 -6
- package/dist/config/config.service.js.map +1 -1
- package/dist/datasources/local-git-data-source.d.ts +39 -0
- package/dist/datasources/local-git-data-source.d.ts.map +1 -1
- package/dist/datasources/local-git-data-source.js +121 -1
- package/dist/datasources/local-git-data-source.js.map +1 -1
- package/dist/enhanced-config.js +26 -0
- package/dist/index.js +0 -0
- package/dist/mcp/server.js +2 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/services/blacklist.service.d.ts +11 -5
- package/dist/services/blacklist.service.d.ts.map +1 -1
- package/dist/services/blacklist.service.js +28 -7
- package/dist/services/blacklist.service.js.map +1 -1
- package/dist/services/reviewer-service.d.ts +24 -0
- package/dist/services/reviewer-service.d.ts.map +1 -1
- package/dist/services/reviewer-service.js +177 -7
- package/dist/services/reviewer-service.js.map +1 -1
- package/dist/services/whitelist.service.js +1 -1
- package/dist/services/whitelist.service.js.map +1 -1
- package/dist/types/enhanced-config.d.ts +121 -0
- package/dist/types/enhanced-config.d.ts.map +1 -0
- package/dist/types/enhanced-config.js +27 -0
- package/dist/types/enhanced-config.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/bin/deprecated-mcp.d.ts +0 -12
- package/dist/bin/deprecated-mcp.d.ts.map +0 -1
- package/dist/bin/deprecated-mcp.js +0 -73
- package/dist/bin/deprecated-mcp.js.map +0 -1
- package/dist/tools.d.ts +0 -22
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -176
- package/dist/tools.js.map +0 -1
package/dist/cli/output.js
CHANGED
|
@@ -2,62 +2,148 @@
|
|
|
2
2
|
* CLI Output Formatters
|
|
3
3
|
*
|
|
4
4
|
* This module provides output formatting functions for CLI results.
|
|
5
|
-
* Supports both JSON and human-readable text formats
|
|
5
|
+
* Supports both JSON and human-readable text formats with enhanced features
|
|
6
|
+
* for verbose/quiet modes and structured CI/CD output.
|
|
6
7
|
*
|
|
7
8
|
* @module cli/output
|
|
8
9
|
*/
|
|
10
|
+
import { writeFileSync } from 'fs';
|
|
11
|
+
/**
|
|
12
|
+
* Enhanced output handler for CLI results
|
|
13
|
+
*
|
|
14
|
+
* @param result - Reviewer analysis result or enhanced CLI result
|
|
15
|
+
* @param options - CLI options for output control
|
|
16
|
+
* @returns Formatted output string
|
|
17
|
+
*/
|
|
18
|
+
export function handleOutput(result, options) {
|
|
19
|
+
const format = options.format || 'text';
|
|
20
|
+
const verbose = options.verbose || false;
|
|
21
|
+
const quiet = options.quiet || false;
|
|
22
|
+
let output;
|
|
23
|
+
if (format === 'json') {
|
|
24
|
+
output = formatJSON(result, verbose);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
output = formatText(result, verbose, quiet);
|
|
28
|
+
}
|
|
29
|
+
// Write to log file if specified
|
|
30
|
+
if (options.logFile) {
|
|
31
|
+
writeLogFile(options.logFile, result, options);
|
|
32
|
+
}
|
|
33
|
+
return output;
|
|
34
|
+
}
|
|
9
35
|
/**
|
|
10
36
|
* Format reviewer suggestions as JSON
|
|
11
37
|
*
|
|
12
38
|
* @param result - Reviewer analysis result
|
|
39
|
+
* @param verbose - Include detailed information
|
|
13
40
|
* @returns JSON string with formatted output
|
|
14
41
|
*/
|
|
15
|
-
export function formatJSON(result) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
42
|
+
export function formatJSON(result, verbose = false) {
|
|
43
|
+
const baseResult = {
|
|
44
|
+
comment: result.comment,
|
|
45
|
+
contributors: result.contributors.map(r => formatReviewerJSON(r, verbose)),
|
|
46
|
+
teamMembers: result.teamMembers.map(r => formatReviewerJSON(r, verbose)),
|
|
47
|
+
codeOwners: result.codeOwners.map(r => formatReviewerJSON(r, verbose)),
|
|
20
48
|
summary: {
|
|
21
49
|
totalSuggestions: result.contributors.length + result.teamMembers.length + result.codeOwners.length,
|
|
22
50
|
contributorCount: result.contributors.length,
|
|
23
51
|
teamMemberCount: result.teamMembers.length,
|
|
24
52
|
codeOwnerCount: result.codeOwners.length,
|
|
25
53
|
},
|
|
26
|
-
}
|
|
54
|
+
};
|
|
55
|
+
// Add CLI-specific metadata if available
|
|
56
|
+
if ('metadata' in result) {
|
|
57
|
+
return JSON.stringify({
|
|
58
|
+
...baseResult,
|
|
59
|
+
metadata: result.metadata,
|
|
60
|
+
commentResult: result.commentResult,
|
|
61
|
+
timestamp: new Date().toISOString(),
|
|
62
|
+
}, null, 2);
|
|
63
|
+
}
|
|
64
|
+
return JSON.stringify(baseResult, null, 2);
|
|
27
65
|
}
|
|
28
66
|
/**
|
|
29
67
|
* Format a single reviewer suggestion as JSON object
|
|
30
68
|
*/
|
|
31
|
-
function formatReviewerJSON(reviewer) {
|
|
32
|
-
|
|
69
|
+
function formatReviewerJSON(reviewer, verbose = false) {
|
|
70
|
+
const base = {
|
|
33
71
|
username: reviewer.username,
|
|
34
|
-
score: reviewer.score,
|
|
35
72
|
reason: reviewer.reason,
|
|
36
73
|
workload: reviewer.workload,
|
|
37
|
-
|
|
38
|
-
workloadDetails: reviewer.workloadDetails,
|
|
39
|
-
reasoning: reviewer.reasoning,
|
|
74
|
+
score: reviewer.score, // Always include score in JSON output
|
|
40
75
|
};
|
|
76
|
+
if (verbose) {
|
|
77
|
+
return {
|
|
78
|
+
...base,
|
|
79
|
+
fte: reviewer.fte,
|
|
80
|
+
workloadDetails: reviewer.workloadDetails,
|
|
81
|
+
reasoning: reviewer.reasoning,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return base;
|
|
41
85
|
}
|
|
42
86
|
/**
|
|
43
87
|
* Format reviewer suggestions as human-readable text
|
|
44
88
|
*
|
|
45
89
|
* @param result - Reviewer analysis result
|
|
90
|
+
* @param verbose - Include detailed information
|
|
91
|
+
* @param quiet - Suppress non-essential output
|
|
46
92
|
* @returns Formatted text string
|
|
47
93
|
*/
|
|
48
|
-
export function formatText(result) {
|
|
94
|
+
export function formatText(result, verbose = false, quiet = false) {
|
|
49
95
|
const lines = [];
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
96
|
+
if (!quiet) {
|
|
97
|
+
lines.push('='.repeat(80));
|
|
98
|
+
lines.push('REVIEWER SUGGESTIONS');
|
|
99
|
+
lines.push('='.repeat(80));
|
|
100
|
+
lines.push('');
|
|
101
|
+
}
|
|
54
102
|
// Summary
|
|
55
103
|
const totalSuggestions = result.contributors.length + result.teamMembers.length + result.codeOwners.length;
|
|
104
|
+
if (quiet) {
|
|
105
|
+
// Minimal output for quiet mode
|
|
106
|
+
if (totalSuggestions === 0) {
|
|
107
|
+
lines.push('No reviewer suggestions found.');
|
|
108
|
+
return lines.join('\n');
|
|
109
|
+
}
|
|
110
|
+
// Just list usernames
|
|
111
|
+
const allReviewers = [
|
|
112
|
+
...result.contributors.map(r => r.username),
|
|
113
|
+
...result.teamMembers.map(r => r.username),
|
|
114
|
+
...result.codeOwners.map(r => r.username),
|
|
115
|
+
];
|
|
116
|
+
lines.push(`Suggested reviewers: ${allReviewers.join(', ')}`);
|
|
117
|
+
return lines.join('\n');
|
|
118
|
+
}
|
|
56
119
|
lines.push(`Total Suggestions: ${totalSuggestions}`);
|
|
57
120
|
lines.push(` - Contributors: ${result.contributors.length}`);
|
|
58
121
|
lines.push(` - Team Members: ${result.teamMembers.length}`);
|
|
59
122
|
lines.push(` - Code Owners: ${result.codeOwners.length}`);
|
|
60
123
|
lines.push('');
|
|
124
|
+
// Add CLI metadata if available and verbose
|
|
125
|
+
if (verbose && 'metadata' in result) {
|
|
126
|
+
lines.push('-'.repeat(80));
|
|
127
|
+
lines.push('EXECUTION METADATA');
|
|
128
|
+
lines.push('-'.repeat(80));
|
|
129
|
+
lines.push(`Execution Time: ${result.metadata.executionTime}ms`);
|
|
130
|
+
lines.push(`Data Source: ${result.metadata.dataSource}`);
|
|
131
|
+
lines.push(`Dry Run: ${result.metadata.dryRun ? 'Yes' : 'No'}`);
|
|
132
|
+
lines.push(`Config Sources: ${result.metadata.configSource.join(', ')}`);
|
|
133
|
+
if (result.commentResult) {
|
|
134
|
+
lines.push(`Comment Posted: ${result.commentResult.posted ? 'Yes' : 'No'}`);
|
|
135
|
+
if (result.commentResult.commentId) {
|
|
136
|
+
lines.push(`Comment ID: ${result.commentResult.commentId}`);
|
|
137
|
+
}
|
|
138
|
+
if (result.commentResult.url) {
|
|
139
|
+
lines.push(`Comment URL: ${result.commentResult.url}`);
|
|
140
|
+
}
|
|
141
|
+
if (result.commentResult.error) {
|
|
142
|
+
lines.push(`Comment Error: ${result.commentResult.error}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
lines.push('');
|
|
146
|
+
}
|
|
61
147
|
// Contributors
|
|
62
148
|
if (result.contributors.length > 0) {
|
|
63
149
|
lines.push('-'.repeat(80));
|
|
@@ -65,7 +151,7 @@ export function formatText(result) {
|
|
|
65
151
|
lines.push('-'.repeat(80));
|
|
66
152
|
lines.push('');
|
|
67
153
|
result.contributors.forEach((reviewer, index) => {
|
|
68
|
-
lines.push(...formatReviewerText(reviewer, index + 1));
|
|
154
|
+
lines.push(...formatReviewerText(reviewer, index + 1, verbose));
|
|
69
155
|
lines.push('');
|
|
70
156
|
});
|
|
71
157
|
}
|
|
@@ -76,7 +162,7 @@ export function formatText(result) {
|
|
|
76
162
|
lines.push('-'.repeat(80));
|
|
77
163
|
lines.push('');
|
|
78
164
|
result.teamMembers.forEach((reviewer, index) => {
|
|
79
|
-
lines.push(...formatReviewerText(reviewer, index + 1));
|
|
165
|
+
lines.push(...formatReviewerText(reviewer, index + 1, verbose));
|
|
80
166
|
lines.push('');
|
|
81
167
|
});
|
|
82
168
|
}
|
|
@@ -87,25 +173,27 @@ export function formatText(result) {
|
|
|
87
173
|
lines.push('-'.repeat(80));
|
|
88
174
|
lines.push('');
|
|
89
175
|
result.codeOwners.forEach((reviewer, index) => {
|
|
90
|
-
lines.push(...formatReviewerText(reviewer, index + 1));
|
|
176
|
+
lines.push(...formatReviewerText(reviewer, index + 1, verbose));
|
|
91
177
|
lines.push('');
|
|
92
178
|
});
|
|
93
179
|
}
|
|
94
|
-
|
|
180
|
+
if (!quiet) {
|
|
181
|
+
lines.push('='.repeat(80));
|
|
182
|
+
}
|
|
95
183
|
return lines.join('\n');
|
|
96
184
|
}
|
|
97
185
|
/**
|
|
98
186
|
* Format a single reviewer suggestion as text
|
|
99
187
|
*/
|
|
100
|
-
function formatReviewerText(reviewer, index) {
|
|
188
|
+
function formatReviewerText(reviewer, index, verbose = false) {
|
|
101
189
|
const lines = [];
|
|
102
190
|
lines.push(`${index}. @${reviewer.username}`);
|
|
103
191
|
if (reviewer.score) {
|
|
104
192
|
lines.push(` Score: ${reviewer.score.total}/100`);
|
|
105
193
|
}
|
|
106
194
|
lines.push(` Reason: ${reviewer.reason}`);
|
|
107
|
-
// Score breakdown
|
|
108
|
-
if (reviewer.score?.breakdown) {
|
|
195
|
+
// Score breakdown (verbose only)
|
|
196
|
+
if (verbose && reviewer.score?.breakdown) {
|
|
109
197
|
const breakdown = reviewer.score.breakdown;
|
|
110
198
|
const parts = [];
|
|
111
199
|
if (breakdown.contribution > 0)
|
|
@@ -123,14 +211,19 @@ function formatReviewerText(reviewer, index) {
|
|
|
123
211
|
// Workload details
|
|
124
212
|
if (reviewer.workloadDetails) {
|
|
125
213
|
const { current, capacity, utilizationPercent } = reviewer.workloadDetails;
|
|
126
|
-
|
|
214
|
+
if (verbose) {
|
|
215
|
+
lines.push(` Workload: ${current}/${capacity} MRs (${utilizationPercent}% utilized)`);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
lines.push(` Workload: ${current} MRs`);
|
|
219
|
+
}
|
|
127
220
|
}
|
|
128
|
-
// FTE
|
|
129
|
-
if (reviewer.fte !== undefined && reviewer.fte !== 1) {
|
|
221
|
+
// FTE (verbose only)
|
|
222
|
+
if (verbose && reviewer.fte !== undefined && reviewer.fte !== 1) {
|
|
130
223
|
lines.push(` FTE: ${reviewer.fte}`);
|
|
131
224
|
}
|
|
132
|
-
// Reasoning
|
|
133
|
-
if (reviewer.reasoning) {
|
|
225
|
+
// Reasoning (verbose only)
|
|
226
|
+
if (verbose && reviewer.reasoning) {
|
|
134
227
|
lines.push(` Details: ${reviewer.reasoning.primary}`);
|
|
135
228
|
if (reviewer.reasoning.factors && reviewer.reasoning.factors.length > 0) {
|
|
136
229
|
reviewer.reasoning.factors.forEach((factor) => {
|
|
@@ -140,4 +233,38 @@ function formatReviewerText(reviewer, index) {
|
|
|
140
233
|
}
|
|
141
234
|
return lines;
|
|
142
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Write structured logs to file
|
|
238
|
+
*
|
|
239
|
+
* @param logFile - Path to log file
|
|
240
|
+
* @param result - Reviewer analysis result
|
|
241
|
+
* @param options - CLI options
|
|
242
|
+
*/
|
|
243
|
+
function writeLogFile(logFile, result, options) {
|
|
244
|
+
try {
|
|
245
|
+
const logEntry = {
|
|
246
|
+
timestamp: new Date().toISOString(),
|
|
247
|
+
command: 'invite-reviewers',
|
|
248
|
+
options: {
|
|
249
|
+
dryRun: options.dryRun,
|
|
250
|
+
format: options.format,
|
|
251
|
+
verbose: options.verbose,
|
|
252
|
+
quiet: options.quiet,
|
|
253
|
+
},
|
|
254
|
+
result: {
|
|
255
|
+
contributorCount: result.contributors.length,
|
|
256
|
+
teamMemberCount: result.teamMembers.length,
|
|
257
|
+
codeOwnerCount: result.codeOwners.length,
|
|
258
|
+
totalSuggestions: result.contributors.length + result.teamMembers.length + result.codeOwners.length,
|
|
259
|
+
},
|
|
260
|
+
...(('metadata' in result) && { metadata: result.metadata }),
|
|
261
|
+
...(('commentResult' in result) && { commentResult: result.commentResult }),
|
|
262
|
+
};
|
|
263
|
+
writeFileSync(logFile, JSON.stringify(logEntry, null, 2) + '\n', { flag: 'a' });
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
// Don't fail the main operation if logging fails
|
|
267
|
+
console.warn(`Warning: Failed to write to log file ${logFile}: ${error instanceof Error ? error.message : String(error)}`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
143
270
|
//# sourceMappingURL=output.js.map
|
package/dist/cli/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAgCnC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAAsC,EAAE,OAAmB;IACtF,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC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AE,OAAO,CAAC,MAAM;gBACtB,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB;YACD,MAAM,EAAE;gBACN,gBAAgB,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM;gBAC5C,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM;gBAC1C,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM;gBACxC,gBAAgB,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM;aACpG;YACD,GAAG,CAAC,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC5D,GAAG,CAAC,CAAC,eAAe,IAAI,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC;SAC5E,CAAC;QAEF,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IAClF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iDAAiD;QACjD,OAAO,CAAC,IAAI,CAAC,wCAAwC,OAAO,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC7H,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameter Source Tracker
|
|
3
|
+
*
|
|
4
|
+
* Tracks and logs the source of each configuration parameter for debugging.
|
|
5
|
+
* Implements Requirement 3.5: THE System SHALL log the source of each configuration value for debugging
|
|
6
|
+
*
|
|
7
|
+
* @module cli/parameter-source-tracker
|
|
8
|
+
*/
|
|
9
|
+
import { Logger } from '../logging/logger.service.js';
|
|
10
|
+
/**
|
|
11
|
+
* Source types for configuration parameters
|
|
12
|
+
*/
|
|
13
|
+
export type ParameterSource = 'cli-argument' | 'environment' | 'auto-detected' | 'config-file' | 'default' | 'not-set';
|
|
14
|
+
/**
|
|
15
|
+
* Tracked parameter with its value and source
|
|
16
|
+
*
|
|
17
|
+
* @property name - The name of the parameter being tracked
|
|
18
|
+
* @property value - The resolved value of the parameter (may be undefined if not set)
|
|
19
|
+
* @property source - The source from which the parameter value was obtained
|
|
20
|
+
* @property sourceDetail - Additional detail about the source (e.g., env var name, file path)
|
|
21
|
+
* @property masked - Whether to mask the value in logs (for sensitive data like tokens)
|
|
22
|
+
*/
|
|
23
|
+
export interface TrackedParameter<T = unknown> {
|
|
24
|
+
name: string;
|
|
25
|
+
value: T | undefined;
|
|
26
|
+
source: ParameterSource;
|
|
27
|
+
sourceDetail?: string;
|
|
28
|
+
masked?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* All tracked parameters for a CLI invocation
|
|
32
|
+
*
|
|
33
|
+
* @property repoPath - Local repository path for git analysis
|
|
34
|
+
* @property project - GitLab project ID or path
|
|
35
|
+
* @property mergeRequestIid - Merge request internal ID
|
|
36
|
+
* @property branch - Git branch name for finding merge requests
|
|
37
|
+
* @property gitlabUrl - GitLab instance URL
|
|
38
|
+
* @property gitlabToken - GitLab API authentication token
|
|
39
|
+
* @property format - Output format (json or text)
|
|
40
|
+
* @property verbose - Enable verbose logging output
|
|
41
|
+
* @property dryRun - Run without making changes
|
|
42
|
+
* @property quiet - Suppress non-essential output
|
|
43
|
+
* @property dataSourceType - Data source type (local-git or gitlab-api)
|
|
44
|
+
*/
|
|
45
|
+
export interface ParameterSources {
|
|
46
|
+
repoPath: TrackedParameter<string>;
|
|
47
|
+
project: TrackedParameter<string | number>;
|
|
48
|
+
mergeRequestIid: TrackedParameter<number>;
|
|
49
|
+
branch: TrackedParameter<string>;
|
|
50
|
+
gitlabUrl: TrackedParameter<string>;
|
|
51
|
+
gitlabToken: TrackedParameter<string>;
|
|
52
|
+
format: TrackedParameter<'json' | 'text'>;
|
|
53
|
+
verbose: TrackedParameter<boolean>;
|
|
54
|
+
dryRun: TrackedParameter<boolean>;
|
|
55
|
+
quiet: TrackedParameter<boolean>;
|
|
56
|
+
dataSourceType: TrackedParameter<'local-git' | 'gitlab-api'>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Parameter Source Tracker
|
|
60
|
+
*
|
|
61
|
+
* Tracks the source of each configuration parameter and provides
|
|
62
|
+
* comprehensive logging for debugging configuration issues.
|
|
63
|
+
*/
|
|
64
|
+
export declare class ParameterSourceTracker {
|
|
65
|
+
private parameters;
|
|
66
|
+
private logger;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new ParameterSourceTracker instance
|
|
69
|
+
*
|
|
70
|
+
* @param logger - Logger instance for outputting parameter source information
|
|
71
|
+
*/
|
|
72
|
+
constructor(logger: Logger);
|
|
73
|
+
/**
|
|
74
|
+
* Track a parameter with its value and source
|
|
75
|
+
*/
|
|
76
|
+
track<T>(name: string, value: T | undefined, source: ParameterSource, options?: {
|
|
77
|
+
sourceDetail?: string;
|
|
78
|
+
masked?: boolean;
|
|
79
|
+
}): void;
|
|
80
|
+
/**
|
|
81
|
+
* Resolve a parameter value with source tracking
|
|
82
|
+
* Implements the precedence: CLI argument > environment variable > auto-detected > config file > default
|
|
83
|
+
*/
|
|
84
|
+
resolve<T>(name: string, cliValue: T | undefined, envVarName: string | undefined, autoDetectFn?: () => T | undefined, configValue?: T, defaultValue?: T, options?: {
|
|
85
|
+
masked?: boolean;
|
|
86
|
+
}): T | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Get all tracked parameters
|
|
89
|
+
*/
|
|
90
|
+
getAll(): Map<string, TrackedParameter>;
|
|
91
|
+
/**
|
|
92
|
+
* Get a specific tracked parameter
|
|
93
|
+
*
|
|
94
|
+
* @param name - The name of the parameter to retrieve
|
|
95
|
+
* @returns The tracked parameter or undefined if not found
|
|
96
|
+
*/
|
|
97
|
+
get(name: string): TrackedParameter | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Log all parameter sources
|
|
100
|
+
* This implements Requirement 3.5
|
|
101
|
+
*/
|
|
102
|
+
logParameterSources(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Log parameter sources in a structured format (for JSON output)
|
|
105
|
+
*/
|
|
106
|
+
toStructuredLog(): Record<string, {
|
|
107
|
+
value: unknown;
|
|
108
|
+
source: ParameterSource;
|
|
109
|
+
sourceDetail?: string;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Format value for logging (handles masking and undefined)
|
|
113
|
+
*/
|
|
114
|
+
private formatValueForLog;
|
|
115
|
+
/**
|
|
116
|
+
* Format source information for logging
|
|
117
|
+
*/
|
|
118
|
+
private formatSourceForLog;
|
|
119
|
+
/**
|
|
120
|
+
* Convert camelCase to kebab-case
|
|
121
|
+
*/
|
|
122
|
+
private toKebabCase;
|
|
123
|
+
/**
|
|
124
|
+
* Parse environment variable value to appropriate type
|
|
125
|
+
*/
|
|
126
|
+
private parseEnvValue;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Create a parameter source tracker and resolve all CLI parameters
|
|
130
|
+
*
|
|
131
|
+
* @param options - CLI options from argument parsing
|
|
132
|
+
* @param cicdEnv - CI/CD environment detection result
|
|
133
|
+
* @param logger - Logger instance
|
|
134
|
+
* @returns Resolved parameters with source tracking
|
|
135
|
+
*/
|
|
136
|
+
export declare function resolveParametersWithTracking(options: {
|
|
137
|
+
repoPath?: string;
|
|
138
|
+
project?: string | number;
|
|
139
|
+
mergeRequestIid?: number;
|
|
140
|
+
branch?: string;
|
|
141
|
+
gitlabUrl?: string;
|
|
142
|
+
gitlabToken?: string;
|
|
143
|
+
format?: 'json' | 'text';
|
|
144
|
+
verbose?: boolean;
|
|
145
|
+
dryRun?: boolean;
|
|
146
|
+
quiet?: boolean;
|
|
147
|
+
}, cicdEnv: {
|
|
148
|
+
isCI: boolean;
|
|
149
|
+
platform?: string;
|
|
150
|
+
projectId?: string | number;
|
|
151
|
+
mergeRequestIid?: number;
|
|
152
|
+
branch?: string;
|
|
153
|
+
serverUrl?: string;
|
|
154
|
+
}, logger: Logger): {
|
|
155
|
+
tracker: ParameterSourceTracker;
|
|
156
|
+
resolved: {
|
|
157
|
+
repoPath?: string;
|
|
158
|
+
project?: string | number;
|
|
159
|
+
mergeRequestIid?: number;
|
|
160
|
+
branch?: string;
|
|
161
|
+
gitlabUrl: string;
|
|
162
|
+
gitlabToken?: string;
|
|
163
|
+
format: 'json' | 'text';
|
|
164
|
+
verbose: boolean;
|
|
165
|
+
dryRun: boolean;
|
|
166
|
+
quiet: boolean;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=parameter-source-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter-source-tracker.d.ts","sourceRoot":"","sources":["../../src/cli/parameter-source-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,aAAa,GACb,eAAe,GACf,aAAa,GACb,SAAS,GACT,SAAS,CAAC;AAEd;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QA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