@yasserkhanorg/e2e-agents 1.5.0 → 1.7.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/dist/cli/commands/train.d.ts.map +1 -1
- package/dist/cli/commands/train.js +125 -50
- package/dist/cli/parse_args.d.ts.map +1 -1
- package/dist/cli/parse_args.js +3 -0
- package/dist/cli/types.d.ts +3 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/esm/cli/commands/train.js +125 -50
- package/dist/esm/cli/parse_args.js +3 -0
- package/dist/esm/logger.js +29 -2
- package/dist/esm/pipeline/orchestrator.js +17 -3
- package/dist/esm/training/enricher.js +82 -11
- package/dist/esm/training/merger.js +77 -10
- package/dist/esm/training/scanner.js +523 -2
- package/dist/esm/training/validator.js +58 -2
- package/dist/logger.d.ts +9 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +29 -2
- package/dist/pipeline/orchestrator.d.ts.map +1 -1
- package/dist/pipeline/orchestrator.js +17 -3
- package/dist/training/enricher.d.ts +3 -1
- package/dist/training/enricher.d.ts.map +1 -1
- package/dist/training/enricher.js +82 -11
- package/dist/training/merger.d.ts +11 -1
- package/dist/training/merger.d.ts.map +1 -1
- package/dist/training/merger.js +77 -10
- package/dist/training/scanner.d.ts +28 -2
- package/dist/training/scanner.d.ts.map +1 -1
- package/dist/training/scanner.js +527 -2
- package/dist/training/types.d.ts +8 -0
- package/dist/training/types.d.ts.map +1 -1
- package/dist/training/validator.d.ts +5 -0
- package/dist/training/validator.d.ts.map +1 -1
- package/dist/training/validator.js +59 -2
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
3
|
// See LICENSE.txt for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.isInfraFile = isInfraFile;
|
|
5
6
|
exports.parseGitLog = parseGitLog;
|
|
6
7
|
exports.getCommitFiles = getCommitFiles;
|
|
7
8
|
exports.validateCommit = validateCommit;
|
|
@@ -10,6 +11,62 @@ exports.formatValidationReport = formatValidationReport;
|
|
|
10
11
|
const child_process_1 = require("child_process");
|
|
11
12
|
const path_1 = require("path");
|
|
12
13
|
const route_families_js_1 = require("../knowledge/route_families.js");
|
|
14
|
+
/**
|
|
15
|
+
* Glob-style patterns for infrastructure / cross-cutting files that will never
|
|
16
|
+
* belong to a single route family. Excluded from coverage calculations.
|
|
17
|
+
*/
|
|
18
|
+
const INFRA_GLOBS = [
|
|
19
|
+
'Makefile', 'go.mod', 'go.sum',
|
|
20
|
+
'*.lock',
|
|
21
|
+
'**/mocks/*', '**/storetest/*', '**/testlib/*',
|
|
22
|
+
'**/i18n/*',
|
|
23
|
+
'**/.github/*', '**/scripts/*',
|
|
24
|
+
'**/docker-compose*',
|
|
25
|
+
'**/__fixtures__/*', '**/test_templates/*',
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* Check if a file path matches any infrastructure glob pattern.
|
|
29
|
+
* Uses simple string matching — no external glob library needed.
|
|
30
|
+
*/
|
|
31
|
+
function isInfraFile(filePath) {
|
|
32
|
+
const normalized = filePath.replace(/\\/g, '/');
|
|
33
|
+
for (const pattern of INFRA_GLOBS) {
|
|
34
|
+
if (pattern.startsWith('**/')) {
|
|
35
|
+
// Match anywhere in the path
|
|
36
|
+
const suffix = pattern.slice(3);
|
|
37
|
+
if (suffix.endsWith('/*')) {
|
|
38
|
+
// Directory match: **/mocks/* → any segment named "mocks" with a child
|
|
39
|
+
const dirName = suffix.slice(0, -2);
|
|
40
|
+
if (normalized.includes(`/${dirName}/`) || normalized.startsWith(`${dirName}/`))
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
else if (suffix.endsWith('*')) {
|
|
44
|
+
// Prefix match: **/docker-compose* → file starting with docker-compose
|
|
45
|
+
const prefix = suffix.slice(0, -1);
|
|
46
|
+
const base = normalized.split('/').pop() || '';
|
|
47
|
+
if (base.startsWith(prefix))
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
if (normalized.endsWith(`/${suffix}`) || normalized === suffix)
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else if (pattern.startsWith('*.')) {
|
|
56
|
+
// Extension match: *.lock
|
|
57
|
+
const ext = pattern.slice(1);
|
|
58
|
+
if (normalized.endsWith(ext))
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// Exact basename match: Makefile, go.mod, go.sum
|
|
63
|
+
const base = normalized.split('/').pop() || '';
|
|
64
|
+
if (base === pattern)
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
13
70
|
function parseGitLog(log) {
|
|
14
71
|
const commits = [];
|
|
15
72
|
let current = null;
|
|
@@ -56,10 +113,10 @@ function getCommitFiles(projectRoot, since) {
|
|
|
56
113
|
return parseGitLog(log);
|
|
57
114
|
}
|
|
58
115
|
function validateCommit(manifest, files, hash, message) {
|
|
59
|
-
// Filter out non-source files
|
|
116
|
+
// Filter out non-source files and infrastructure files
|
|
60
117
|
const sourceFiles = files.filter((f) => {
|
|
61
118
|
return !f.endsWith('.md') && !f.endsWith('.json') && !f.endsWith('.yml') && !f.endsWith('.yaml') &&
|
|
62
|
-
!f.startsWith('.') && !f.includes('node_modules/');
|
|
119
|
+
!f.startsWith('.') && !f.includes('node_modules/') && !isInfraFile(f);
|
|
63
120
|
});
|
|
64
121
|
if (sourceFiles.length === 0) {
|
|
65
122
|
return { hash, message, changedFiles: [], boundFiles: 0, unboundFiles: [], familiesHit: [] };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yasserkhanorg/e2e-agents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "AI-powered E2E test impact analysis, generation, and healing. Analyzes code changes to identify affected Playwright tests, detects coverage gaps, and generates or repairs specs using pluggable LLM providers (Claude, OpenAI, Ollama). Includes MCP server, traceability, and CI/CD integration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|