@diffci.com/diffci 0.3.54 → 0.3.56
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-client/src/client/agent-selection.d.ts +9 -2
- package/dist-client/src/client/agent-selection.js +20 -8
- package/dist-client/src/client/agent-setup.js +1 -1
- package/dist-client/src/client/cli.js +19 -7
- package/dist-client/src/client/command-batches.js +3 -2
- package/dist-client/src/client/context.d.ts +2 -0
- package/dist-client/src/client/context.js +51 -2
- package/dist-client/src/client/coverage-map.js +6 -1
- package/dist-client/src/client/full-command.js +22 -14
- package/dist-client/src/client/gate.js +24 -10
- package/dist-client/src/client/hook.d.ts +17 -0
- package/dist-client/src/client/hook.js +53 -1
- package/dist-client/src/client/install.d.ts +6 -0
- package/dist-client/src/client/install.js +29 -1
- package/dist-client/src/client/job-summary.d.ts +1 -1
- package/dist-client/src/client/job-summary.js +2 -1
- package/dist-client/src/client/mcp.js +4 -0
- package/dist-client/src/client/observe.js +4 -3
- package/dist-client/src/client/report.d.ts +8 -1
- package/dist-client/src/client/report.js +11 -0
- package/dist-client/src/client/shared-graph-cache.js +4 -2
- package/dist-client/src/client/telemetry.js +2 -1
- package/dist-client/src/client/usage-signal.d.ts +1 -1
- package/dist-client/src/client/verify-savings.d.ts +6 -0
- package/dist-client/src/client/verify-savings.js +15 -3
- package/dist-client/src/client/verify.js +124 -22
- package/dist-client/src/client/workflow-guard.js +27 -6
- package/dist-client/src/client/workflow-templates.d.ts +11 -1
- package/dist-client/src/client/workflow-templates.js +43 -2
- package/node_modules/@diffci.com/core/README.md +17 -10
- package/node_modules/@diffci.com/core/dist/ci-inference/expression.d.ts +5 -0
- package/node_modules/@diffci.com/core/dist/ci-inference/expression.js +38 -5
- package/node_modules/@diffci.com/core/dist/ci-inference/expression.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/ci-inference/infer.js +26 -6
- package/node_modules/@diffci.com/core/dist/ci-inference/infer.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/ci-inference/jobs.d.ts +2 -1
- package/node_modules/@diffci.com/core/dist/ci-inference/jobs.js +7 -2
- package/node_modules/@diffci.com/core/dist/ci-inference/jobs.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/ci-inference/matrix.js +15 -8
- package/node_modules/@diffci.com/core/dist/ci-inference/matrix.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/ci-inference/purpose.js +6 -2
- package/node_modules/@diffci.com/core/dist/ci-inference/purpose.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/ci-inference/resolve.js +38 -5
- package/node_modules/@diffci.com/core/dist/ci-inference/resolve.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/git/ci-config-paths.js +13 -1
- package/node_modules/@diffci.com/core/dist/git/ci-config-paths.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/git/git-diff.d.ts +5 -0
- package/node_modules/@diffci.com/core/dist/git/git-diff.js +64 -31
- package/node_modules/@diffci.com/core/dist/git/git-diff.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/planner/check-narrowing.js +22 -1
- package/node_modules/@diffci.com/core/dist/planner/check-narrowing.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/planner/pipeline-steps.d.ts +6 -0
- package/node_modules/@diffci.com/core/dist/planner/pipeline-steps.js +14 -2
- package/node_modules/@diffci.com/core/dist/planner/pipeline-steps.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/planner/planner.js +65 -14
- package/node_modules/@diffci.com/core/dist/planner/planner.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/planner/rust-command.js +43 -1
- package/node_modules/@diffci.com/core/dist/planner/rust-command.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/planner/script-reads.js +5 -2
- package/node_modules/@diffci.com/core/dist/planner/script-reads.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/planner/test-command.js +17 -2
- package/node_modules/@diffci.com/core/dist/planner/test-command.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/planner/type-program.js +27 -1
- package/node_modules/@diffci.com/core/dist/planner/type-program.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/go.js +5 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/go.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/maven.js +71 -9
- package/node_modules/@diffci.com/core/dist/repo/adapters/maven.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/python.d.ts +9 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/python.js +259 -18
- package/node_modules/@diffci.com/core/dist/repo/adapters/python.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust-invocation.d.ts +3 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust-invocation.js +44 -6
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust-invocation.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust.d.ts +1 -0
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust.js +338 -24
- package/node_modules/@diffci.com/core/dist/repo/adapters/rust.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/adapters/types.d.ts +10 -0
- package/node_modules/@diffci.com/core/dist/repo/adapters/types.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/file-references.d.ts +16 -0
- package/node_modules/@diffci.com/core/dist/repo/file-references.js +76 -5
- package/node_modules/@diffci.com/core/dist/repo/file-references.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/graph.js +101 -30
- package/node_modules/@diffci.com/core/dist/repo/graph.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/impact.d.ts +7 -0
- package/node_modules/@diffci.com/core/dist/repo/impact.js +56 -9
- package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/layout.js +4 -1
- package/node_modules/@diffci.com/core/dist/repo/layout.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/runner-universe.js +10 -1
- package/node_modules/@diffci.com/core/dist/repo/runner-universe.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/script-universe.js +1 -1
- package/node_modules/@diffci.com/core/dist/repo/script-universe.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/test-discovery.js +5 -1
- package/node_modules/@diffci.com/core/dist/repo/test-discovery.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/types.d.ts +3 -0
- package/node_modules/@diffci.com/core/dist/repo/workflow-test-steps.js +3 -3
- package/node_modules/@diffci.com/core/dist/repo/workflow-test-steps.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/yarn-berry-lockfile.d.ts +11 -0
- package/node_modules/@diffci.com/core/dist/repo/yarn-berry-lockfile.js +208 -0
- package/node_modules/@diffci.com/core/dist/repo/yarn-berry-lockfile.js.map +1 -0
- package/node_modules/@diffci.com/core/dist/repo/yarn-lockfile.d.ts +3 -0
- package/node_modules/@diffci.com/core/dist/repo/yarn-lockfile.js +2 -2
- package/node_modules/@diffci.com/core/dist/repo/yarn-lockfile.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/research/baseline/matcher.js +65 -13
- package/node_modules/@diffci.com/core/dist/research/baseline/matcher.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/research/baseline/workflow-parser.js +47 -2
- package/node_modules/@diffci.com/core/dist/research/baseline/workflow-parser.js.map +1 -1
- package/node_modules/@diffci.com/core/package.json +1 -0
- package/node_modules/@diffci.com/core/src/ci-inference/expression.ts +38 -5
- package/node_modules/@diffci.com/core/src/ci-inference/infer.ts +21 -6
- package/node_modules/@diffci.com/core/src/ci-inference/jobs.ts +7 -2
- package/node_modules/@diffci.com/core/src/ci-inference/matrix.ts +15 -8
- package/node_modules/@diffci.com/core/src/ci-inference/purpose.ts +6 -2
- package/node_modules/@diffci.com/core/src/ci-inference/resolve.ts +37 -5
- package/node_modules/@diffci.com/core/src/git/ci-config-paths.ts +8 -1
- package/node_modules/@diffci.com/core/src/git/git-diff.ts +57 -32
- package/node_modules/@diffci.com/core/src/planner/check-narrowing.ts +22 -1
- package/node_modules/@diffci.com/core/src/planner/pipeline-steps.ts +13 -2
- package/node_modules/@diffci.com/core/src/planner/planner.ts +42 -14
- package/node_modules/@diffci.com/core/src/planner/rust-command.ts +37 -1
- package/node_modules/@diffci.com/core/src/planner/script-reads.ts +5 -1
- package/node_modules/@diffci.com/core/src/planner/test-command.ts +17 -2
- package/node_modules/@diffci.com/core/src/planner/type-program.ts +25 -1
- package/node_modules/@diffci.com/core/src/repo/adapters/go.ts +5 -1
- package/node_modules/@diffci.com/core/src/repo/adapters/maven.ts +74 -9
- package/node_modules/@diffci.com/core/src/repo/adapters/python.ts +209 -18
- package/node_modules/@diffci.com/core/src/repo/adapters/rust-invocation.ts +44 -6
- package/node_modules/@diffci.com/core/src/repo/adapters/rust.ts +264 -24
- package/node_modules/@diffci.com/core/src/repo/adapters/types.ts +10 -1
- package/node_modules/@diffci.com/core/src/repo/file-references.ts +70 -5
- package/node_modules/@diffci.com/core/src/repo/graph.ts +82 -21
- package/node_modules/@diffci.com/core/src/repo/impact.ts +57 -8
- package/node_modules/@diffci.com/core/src/repo/layout.ts +5 -1
- package/node_modules/@diffci.com/core/src/repo/runner-universe.ts +11 -1
- package/node_modules/@diffci.com/core/src/repo/script-universe.ts +1 -1
- package/node_modules/@diffci.com/core/src/repo/test-discovery.ts +4 -1
- package/node_modules/@diffci.com/core/src/repo/types.ts +3 -1
- package/node_modules/@diffci.com/core/src/repo/workflow-test-steps.ts +3 -3
- package/node_modules/@diffci.com/core/src/repo/yarn-berry-lockfile.ts +178 -0
- package/node_modules/@diffci.com/core/src/repo/yarn-lockfile.ts +2 -2
- package/node_modules/@diffci.com/core/src/research/baseline/matcher.ts +43 -13
- package/node_modules/@diffci.com/core/src/research/baseline/workflow-parser.ts +44 -2
- package/package.json +2 -2
|
@@ -182,32 +182,44 @@ function globPattern(glob) {
|
|
|
182
182
|
const cut = body.lastIndexOf("/", firstWild < 0 ? body.length : firstWild);
|
|
183
183
|
if (cut < 0 || body.includes("["))
|
|
184
184
|
return undefined;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
i
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
i
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (
|
|
185
|
+
// Brace alternatives are globs too (`{index,*-icon}.ts`); escaping them as literals matched only the
|
|
186
|
+
// literal ones and dropped the rest. Nested braces are not translated and keep the load computed.
|
|
187
|
+
const translate = (text) => {
|
|
188
|
+
let regex = "";
|
|
189
|
+
for (let i = 0; i < text.length; i++) {
|
|
190
|
+
const char = text[i];
|
|
191
|
+
if (text.startsWith("**/", i)) {
|
|
192
|
+
regex += "(?:.*/)?";
|
|
193
|
+
i += 2;
|
|
194
|
+
}
|
|
195
|
+
else if (text.startsWith("**", i)) {
|
|
196
|
+
regex += ".*";
|
|
197
|
+
i += 1;
|
|
198
|
+
}
|
|
199
|
+
else if (char === "*")
|
|
200
|
+
regex += "[^/]*";
|
|
201
|
+
else if (char === "?")
|
|
202
|
+
regex += "[^/]";
|
|
203
|
+
else if (char === "{") {
|
|
204
|
+
const close = text.indexOf("}", i);
|
|
205
|
+
if (close < 0 || text.slice(i + 1, close).includes("{"))
|
|
206
|
+
return undefined;
|
|
207
|
+
const alternatives = text.slice(i + 1, close).split(",").map(translate);
|
|
208
|
+
if (alternatives.some((alternative) => alternative === undefined))
|
|
209
|
+
return undefined;
|
|
210
|
+
regex += `(?:${alternatives.join("|")})`;
|
|
211
|
+
i = close;
|
|
212
|
+
}
|
|
213
|
+
else if (char === "}")
|
|
204
214
|
return undefined;
|
|
205
|
-
|
|
206
|
-
|
|
215
|
+
else
|
|
216
|
+
regex += escapeRegex(char);
|
|
207
217
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
218
|
+
return regex;
|
|
219
|
+
};
|
|
220
|
+
const regex = translate(body.slice(cut + 1));
|
|
221
|
+
if (regex === undefined)
|
|
222
|
+
return undefined;
|
|
211
223
|
// Vite resolves a glob starting with "/" from its project root, not the filesystem root.
|
|
212
224
|
return { base: body.slice(0, cut + 1), regex, negated, ...(body.startsWith("/") ? { viteRoot: true } : {}) };
|
|
213
225
|
}
|
|
@@ -1050,8 +1062,13 @@ export async function buildDependencyGraph(options = {}) {
|
|
|
1050
1062
|
adapterBlockers.push("Mixed Go/JavaScript repositories require explicit cross-language dependencies; full validation required");
|
|
1051
1063
|
}
|
|
1052
1064
|
const rustModeled = contributions.some((item) => item.id === "rust");
|
|
1053
|
-
|
|
1054
|
-
|
|
1065
|
+
const rustScope = rustLanguageFileScope(contributions);
|
|
1066
|
+
const mixedRustFiles = rustModeled ? files.filter(file => /\.(?:[cm]?[jt]sx?|vue|go|py|java|kt|cs|svelte|astro|c|h|cpp|cc|cxx)$/.test(file)) : [];
|
|
1067
|
+
if (mixedRustFiles.length) {
|
|
1068
|
+
const reason = "Mixed Rust/language repositories require explicit cross-language dependencies; full validation required";
|
|
1069
|
+
adapterBlockers.push(reason);
|
|
1070
|
+
for (const file of mixedRustFiles)
|
|
1071
|
+
addScope(reason, rustScope(file));
|
|
1055
1072
|
}
|
|
1056
1073
|
const pythonModeled = contributions.some((item) => item.id === "python");
|
|
1057
1074
|
const unmodeledLanguageFiles = contributions.length ? files.filter((file) => (!pythonModeled && /\.py$/.test(file)) || (!rustModeled && /\.rs$/.test(file)) || /\.(?:cs|svelte|astro)$/.test(file) || !contributions.some((item) => item.id === "maven") && /\.(?:java|kt)$/.test(file)) : [];
|
|
@@ -1061,7 +1078,7 @@ export async function buildDependencyGraph(options = {}) {
|
|
|
1061
1078
|
// Files in a top-level dot-directory outside every package (agent skills, editor tooling) are confined
|
|
1062
1079
|
// to that directory: no package's sources or tests can load them.
|
|
1063
1080
|
for (const file of unmodeledLanguageFiles)
|
|
1064
|
-
addScope(reason, packageScope(file) || (/^\.[^/]+\//.test(file) && !file.startsWith(".github/") ? file.slice(0, file.indexOf("/")) : ""));
|
|
1081
|
+
addScope(reason, packageScope(file) || (/^\.[^/]+\//.test(file) && !file.startsWith(".github/") ? file.slice(0, file.indexOf("/")) : "") || rustScope(file));
|
|
1065
1082
|
}
|
|
1066
1083
|
profile.adapters = contributions.map(({ id, version, blockers }) => ({ id, version, blockers }));
|
|
1067
1084
|
// Rust test targets are not Go packages; other adapters keep their existing routing here.
|
|
@@ -1079,7 +1096,7 @@ export async function buildDependencyGraph(options = {}) {
|
|
|
1079
1096
|
profile.rustTestTargets = { ...rustContribution.rustTestTargets };
|
|
1080
1097
|
profile.rustSources = [...new Set(rustContribution.sourcePaths)].sort();
|
|
1081
1098
|
profile.rustAssets = [...new Set(rustContribution.assetPaths)].sort();
|
|
1082
|
-
profile.rustTestInvocation = rustTestInvocation(repoPath, files);
|
|
1099
|
+
profile.rustTestInvocation = rustTestInvocation(repoPath, files, { allMembersTested: rustContribution.rustAllMembersTested });
|
|
1083
1100
|
if (rustContribution.rustFeatureCoverage)
|
|
1084
1101
|
profile.rustFeatureCoverage = rustContribution.rustFeatureCoverage;
|
|
1085
1102
|
profile.rustDocumentationReaders = [...new Set(rustContribution.rustDocumentationReaders ?? [])].sort();
|
|
@@ -1095,7 +1112,11 @@ export async function buildDependencyGraph(options = {}) {
|
|
|
1095
1112
|
profile.testFilePaths = [...new Set([...profile.testFilePaths, ...adapterTests])].sort();
|
|
1096
1113
|
if (profile.testUniverse) {
|
|
1097
1114
|
profile.testUniverse.discoveredTestFiles = profile.testFilePaths.length;
|
|
1098
|
-
|
|
1115
|
+
const runners = { go: "go test", maven: "Maven", python: "pytest", rust: "cargo test" };
|
|
1116
|
+
const adapterRunners = contributions.flatMap((item) => runners[item.id] ? [runners[item.id]] : []);
|
|
1117
|
+
if (adapterRunners.length)
|
|
1118
|
+
profile.testUniverse.adapterRunners = adapterRunners;
|
|
1119
|
+
profile.testUniverse.blindSpot = (profile.testUniverse.declaredFrameworks.length > 0 || adapterRunners.length > 0) && profile.testFilePaths.length === 0;
|
|
1099
1120
|
}
|
|
1100
1121
|
const entryPointPaths = new Set(profile.entryPoints.map((e) => e.path));
|
|
1101
1122
|
const vueSources = scope || contributions.some((item) => item.id === "vue")
|
|
@@ -1347,6 +1368,21 @@ export async function buildDependencyGraph(options = {}) {
|
|
|
1347
1368
|
}
|
|
1348
1369
|
return undefined;
|
|
1349
1370
|
}
|
|
1371
|
+
/** The JavaScript file a repository declaration file describes, when it exists and is not excluded. */
|
|
1372
|
+
function declarationImplementation(declarationRel) {
|
|
1373
|
+
const match = /^(.*)\.d\.([mc]?)ts$/.exec(declarationRel);
|
|
1374
|
+
if (!match)
|
|
1375
|
+
return undefined;
|
|
1376
|
+
const extensions = match[2] === "m" ? [".mjs"] : match[2] === "c" ? [".cjs"] : [".js", ".jsx"];
|
|
1377
|
+
for (const extension of extensions) {
|
|
1378
|
+
const candidate = match[1] + extension;
|
|
1379
|
+
if (isExcludedPath(candidate, options.excludeDirs ?? []) || candidate.split("/").includes("node_modules"))
|
|
1380
|
+
continue;
|
|
1381
|
+
if (internalSourcePaths.has(candidate) || existsSync(join(repoPath, candidate)))
|
|
1382
|
+
return candidate;
|
|
1383
|
+
}
|
|
1384
|
+
return undefined;
|
|
1385
|
+
}
|
|
1350
1386
|
/** Parses an implementation file an import reaches outside the initial walk, rather than silently dropping
|
|
1351
1387
|
* the edge or loading every TypeScript declaration library again; false, with a blocker, past the budget. */
|
|
1352
1388
|
function followImplementation(absolute, rel) {
|
|
@@ -1446,7 +1482,11 @@ export async function buildDependencyGraph(options = {}) {
|
|
|
1446
1482
|
// TypeScript may resolve a Vue import to a declaration shim. Preserve the actual SFC edge.
|
|
1447
1483
|
if (resolvableSpecifier.endsWith(".vue")) {
|
|
1448
1484
|
const compilerAliases = Object.entries(importerOptions.paths ?? {}).map(([pattern, substitutions]) => ({ pattern, substitutions }));
|
|
1449
|
-
|
|
1485
|
+
// `paths` resolve against `baseUrl`, or without one against the declaring tsconfig's directory
|
|
1486
|
+
// (TypeScript's pathsBasePath), never the importer's. Root aliases are repo-relative, as for assets.
|
|
1487
|
+
const candidate = compilerAliases.length
|
|
1488
|
+
? findAssetCandidate(sf.fileName, resolvableSpecifier, compilerAliases, importerOptions.baseUrl ?? importerOptions.pathsBasePath ?? dirname(sf.fileName))
|
|
1489
|
+
: findAssetCandidate(sf.fileName, resolvableSpecifier, profile.pathAliases, profile.tsconfig?.baseUrl ? resolve(repoPath, profile.tsconfig.baseUrl) : repoPath);
|
|
1450
1490
|
const target = candidate && toRelativeInternal(repoPath, candidate);
|
|
1451
1491
|
if (target && internalSourcePaths.has(target)) {
|
|
1452
1492
|
addEdge(importerRel, target, ref.kind, ref);
|
|
@@ -1542,6 +1582,12 @@ export async function buildDependencyGraph(options = {}) {
|
|
|
1542
1582
|
continue;
|
|
1543
1583
|
internalSourcePaths.add(targetRel);
|
|
1544
1584
|
addEdge(importerRel, targetRel, ref.kind, ref);
|
|
1585
|
+
// A hand-written declaration beside its JavaScript (`foo.d.ts` next to `foo.js`) is what TypeScript
|
|
1586
|
+
// resolves to, but the runner loads the JavaScript. Without this edge a change to `foo.js` reached
|
|
1587
|
+
// no importer and selected nothing.
|
|
1588
|
+
const implementation = declarationImplementation(targetRel);
|
|
1589
|
+
if (implementation && followImplementation(join(repoPath, implementation), implementation))
|
|
1590
|
+
addEdge(importerRel, implementation, ref.kind, ref);
|
|
1545
1591
|
recordReference("internal-source", importerRel, ref);
|
|
1546
1592
|
continue;
|
|
1547
1593
|
}
|
|
@@ -2246,6 +2292,31 @@ function confinedConfigScope(repoPath, configRel, config, directory, workspaceRo
|
|
|
2246
2292
|
}
|
|
2247
2293
|
return directory;
|
|
2248
2294
|
}
|
|
2295
|
+
/** In a Cargo-only repository, the directory a helper script or native source is confined to: the
|
|
2296
|
+
* deepest member crate that contains it, or its top-level directory outside every crate of a virtual
|
|
2297
|
+
* workspace. Cargo can reach such a file only through code in that crate (a build script, which already
|
|
2298
|
+
* depends on every crate, or an `include!`, which falls back), and a change to the file itself keeps the
|
|
2299
|
+
* full suite, so only changes that reach the directory need full validation. "" (global) when another
|
|
2300
|
+
* adapter is active, when Rust code starts external programs that could run the file from anywhere, for
|
|
2301
|
+
* languages another engine could test (JavaScript, Go, Java and so on), for files that look like
|
|
2302
|
+
* Python tests, and inside a root package. */
|
|
2303
|
+
function rustLanguageFileScope(contributions) {
|
|
2304
|
+
const rust = contributions.length === 1 && contributions[0].id === "rust" ? contributions[0] : undefined;
|
|
2305
|
+
const crates = rust?.rustCrateDirectories;
|
|
2306
|
+
if (!rust || !crates || rust.rustRunsPrograms !== false)
|
|
2307
|
+
return () => "";
|
|
2308
|
+
return (file) => {
|
|
2309
|
+
if (!/\.(?:py|c|h|cc|cpp|cxx)$/.test(file))
|
|
2310
|
+
return "";
|
|
2311
|
+
const name = file.slice(file.lastIndexOf("/") + 1);
|
|
2312
|
+
if (/^(?:test_.*|.*_test|conftest)\.py$/.test(name))
|
|
2313
|
+
return "";
|
|
2314
|
+
const crate = crates.filter(directory => directory === "" || file.startsWith(`${directory}/`)).sort((a, b) => b.length - a.length)[0];
|
|
2315
|
+
if (crate !== undefined)
|
|
2316
|
+
return crate;
|
|
2317
|
+
return file.includes("/") ? file.slice(0, file.indexOf("/")) : "";
|
|
2318
|
+
};
|
|
2319
|
+
}
|
|
2249
2320
|
/** Moves blockers confined to directories out of `adapterBlockers` and returns them scoped to those
|
|
2250
2321
|
* directories (2026-11-08: Sentry's JavaScript SDK keeps 19 Nuxt, SvelteKit and Vue E2E applications whose
|
|
2251
2322
|
* tsconfig extends generated `.nuxt/`/`.svelte-kit/` files; they made every change in its SDK packages fall
|