@coana-tech/cli 14.12.129 → 14.12.131
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/cli.mjs +154 -104
- package/package.json +1 -1
- package/reachability-analyzers-cli.mjs +62 -11
- package/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
- package/repos/coana-tech/javap-service/javap-service.jar +0 -0
package/cli.mjs
CHANGED
|
@@ -14560,8 +14560,8 @@ var require_follow_redirects = __commonJS({
|
|
|
14560
14560
|
}
|
|
14561
14561
|
return parsed;
|
|
14562
14562
|
}
|
|
14563
|
-
function resolveUrl(
|
|
14564
|
-
return useNativeURL ? new URL3(
|
|
14563
|
+
function resolveUrl(relative23, base) {
|
|
14564
|
+
return useNativeURL ? new URL3(relative23, base) : parseUrl(url2.resolve(base, relative23));
|
|
14565
14565
|
}
|
|
14566
14566
|
function validateUrl(input) {
|
|
14567
14567
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -70309,16 +70309,16 @@ var require_lockfile = __commonJS({
|
|
|
70309
70309
|
if (process.platform === "win32") {
|
|
70310
70310
|
yield fsSymlink(src, dest, "junction");
|
|
70311
70311
|
} else {
|
|
70312
|
-
let
|
|
70312
|
+
let relative23;
|
|
70313
70313
|
try {
|
|
70314
|
-
|
|
70314
|
+
relative23 = (_path2 || _load_path()).default.relative((_fs || _load_fs()).default.realpathSync((_path2 || _load_path()).default.dirname(dest)), (_fs || _load_fs()).default.realpathSync(src));
|
|
70315
70315
|
} catch (err) {
|
|
70316
70316
|
if (err.code !== "ENOENT") {
|
|
70317
70317
|
throw err;
|
|
70318
70318
|
}
|
|
70319
|
-
|
|
70319
|
+
relative23 = (_path2 || _load_path()).default.relative((_path2 || _load_path()).default.dirname(dest), src);
|
|
70320
70320
|
}
|
|
70321
|
-
yield fsSymlink(
|
|
70321
|
+
yield fsSymlink(relative23 || ".", dest);
|
|
70322
70322
|
}
|
|
70323
70323
|
});
|
|
70324
70324
|
return function symlink2(_x24, _x25) {
|
|
@@ -70345,17 +70345,17 @@ var require_lockfile = __commonJS({
|
|
|
70345
70345
|
_ref28 = _i14.value;
|
|
70346
70346
|
}
|
|
70347
70347
|
const name2 = _ref28;
|
|
70348
|
-
const
|
|
70348
|
+
const relative23 = relativeDir ? (_path2 || _load_path()).default.join(relativeDir, name2) : name2;
|
|
70349
70349
|
const loc = (_path2 || _load_path()).default.join(dir, name2);
|
|
70350
70350
|
const stat6 = yield lstat3(loc);
|
|
70351
70351
|
files.push({
|
|
70352
|
-
relative:
|
|
70352
|
+
relative: relative23,
|
|
70353
70353
|
basename: name2,
|
|
70354
70354
|
absolute: loc,
|
|
70355
70355
|
mtime: +stat6.mtime
|
|
70356
70356
|
});
|
|
70357
70357
|
if (stat6.isDirectory()) {
|
|
70358
|
-
files = files.concat(yield walk(loc,
|
|
70358
|
+
files = files.concat(yield walk(loc, relative23, ignoreBasenames));
|
|
70359
70359
|
}
|
|
70360
70360
|
}
|
|
70361
70361
|
return files;
|
|
@@ -73599,9 +73599,9 @@ var require_lockfile = __commonJS({
|
|
|
73599
73599
|
/* 85 */
|
|
73600
73600
|
/***/
|
|
73601
73601
|
function(module3, exports3) {
|
|
73602
|
-
module3.exports = function(
|
|
73602
|
+
module3.exports = function(exec5) {
|
|
73603
73603
|
try {
|
|
73604
|
-
return !!
|
|
73604
|
+
return !!exec5();
|
|
73605
73605
|
} catch (e) {
|
|
73606
73606
|
return true;
|
|
73607
73607
|
}
|
|
@@ -73733,9 +73733,9 @@ var require_lockfile = __commonJS({
|
|
|
73733
73733
|
/* 104 */
|
|
73734
73734
|
/***/
|
|
73735
73735
|
function(module3, exports3) {
|
|
73736
|
-
module3.exports = function(
|
|
73736
|
+
module3.exports = function(exec5) {
|
|
73737
73737
|
try {
|
|
73738
|
-
return { e: false, v:
|
|
73738
|
+
return { e: false, v: exec5() };
|
|
73739
73739
|
} catch (e) {
|
|
73740
73740
|
return { e: true, v: e };
|
|
73741
73741
|
}
|
|
@@ -75208,7 +75208,7 @@ ${indent3}`);
|
|
|
75208
75208
|
});
|
|
75209
75209
|
} catch (e) {
|
|
75210
75210
|
}
|
|
75211
|
-
module3.exports = function(
|
|
75211
|
+
module3.exports = function(exec5, skipClosing) {
|
|
75212
75212
|
if (!skipClosing && !SAFE_CLOSING) return false;
|
|
75213
75213
|
var safe = false;
|
|
75214
75214
|
try {
|
|
@@ -75220,7 +75220,7 @@ ${indent3}`);
|
|
|
75220
75220
|
arr[ITERATOR] = function() {
|
|
75221
75221
|
return iter;
|
|
75222
75222
|
};
|
|
75223
|
-
|
|
75223
|
+
exec5(arr);
|
|
75224
75224
|
} catch (e) {
|
|
75225
75225
|
}
|
|
75226
75226
|
return safe;
|
|
@@ -75543,8 +75543,8 @@ ${indent3}`);
|
|
|
75543
75543
|
var USE_NATIVE = !!function() {
|
|
75544
75544
|
try {
|
|
75545
75545
|
var promise = $Promise.resolve(1);
|
|
75546
|
-
var FakePromise = (promise.constructor = {})[__webpack_require__(13)("species")] = function(
|
|
75547
|
-
|
|
75546
|
+
var FakePromise = (promise.constructor = {})[__webpack_require__(13)("species")] = function(exec5) {
|
|
75547
|
+
exec5(empty2, empty2);
|
|
75548
75548
|
};
|
|
75549
75549
|
return (isNode2 || typeof PromiseRejectionEvent == "function") && promise.then(empty2) instanceof FakePromise && v8.indexOf("6.6") !== 0 && userAgent.indexOf("Chrome/66") === -1;
|
|
75550
75550
|
} catch (e) {
|
|
@@ -206687,6 +206687,13 @@ async function execNeverFail(cmd, dir, options) {
|
|
|
206687
206687
|
childProcess.stdin?.end();
|
|
206688
206688
|
});
|
|
206689
206689
|
}
|
|
206690
|
+
async function exec(cmd, dir, options) {
|
|
206691
|
+
const { error, stdout, stderr } = await execNeverFail(cmd, dir, options);
|
|
206692
|
+
if (!error) return { stdout, stderr };
|
|
206693
|
+
error.stdout = stdout;
|
|
206694
|
+
error.stderr = stderr;
|
|
206695
|
+
throw error;
|
|
206696
|
+
}
|
|
206690
206697
|
async function runCommandResolveStdOut(cmd, dir, options) {
|
|
206691
206698
|
const { stdout, error } = await execNeverFail(cmd, dir, options);
|
|
206692
206699
|
if (error) throw error;
|
|
@@ -213305,6 +213312,17 @@ async function execNeverFail2(cmd, dir, options) {
|
|
|
213305
213312
|
logger.debug(`Command ${formatCmd(cmd, dir)} finished ${result.error ? "with error" : "successfully"}`);
|
|
213306
213313
|
return result;
|
|
213307
213314
|
}
|
|
213315
|
+
async function exec2(cmd, dir, options) {
|
|
213316
|
+
logger.debug(`Running command: ${formatCmd(cmd, dir)}`);
|
|
213317
|
+
try {
|
|
213318
|
+
const result = await exec(cmd, dir, options);
|
|
213319
|
+
logger.debug(`Command ${formatCmd(cmd, dir)} finished successfully`);
|
|
213320
|
+
return result;
|
|
213321
|
+
} catch (error) {
|
|
213322
|
+
logger.debug(`Command ${formatCmd(cmd, dir)} finished with error`);
|
|
213323
|
+
throw error;
|
|
213324
|
+
}
|
|
213325
|
+
}
|
|
213308
213326
|
async function runCommandResolveStdOut2(cmd, dir, options) {
|
|
213309
213327
|
logger.debug(`Running command: ${formatCmd(cmd, dir)}`);
|
|
213310
213328
|
try {
|
|
@@ -213451,13 +213469,13 @@ var Diff = class {
|
|
|
213451
213469
|
editLength++;
|
|
213452
213470
|
};
|
|
213453
213471
|
if (callback) {
|
|
213454
|
-
(function
|
|
213472
|
+
(function exec5() {
|
|
213455
213473
|
setTimeout(function() {
|
|
213456
213474
|
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
|
213457
213475
|
return callback(void 0);
|
|
213458
213476
|
}
|
|
213459
213477
|
if (!execEditLength()) {
|
|
213460
|
-
|
|
213478
|
+
exec5();
|
|
213461
213479
|
}
|
|
213462
213480
|
}, 0);
|
|
213463
213481
|
})();
|
|
@@ -219898,7 +219916,7 @@ ${indent(1, indentationSize)}`)}
|
|
|
219898
219916
|
import { existsSync as existsSync13 } from "fs";
|
|
219899
219917
|
import { readFile as readFile18 } from "fs/promises";
|
|
219900
219918
|
import assert10 from "node:assert";
|
|
219901
|
-
import { dirname as dirname14, join as join12, relative as
|
|
219919
|
+
import { dirname as dirname14, join as join12, relative as relative10, resolve as resolve25 } from "path";
|
|
219902
219920
|
|
|
219903
219921
|
// ../utils/src/npm-utils.ts
|
|
219904
219922
|
import { access as access2, constants as constants2 } from "fs/promises";
|
|
@@ -224561,10 +224579,10 @@ var Ignore = class {
|
|
|
224561
224579
|
ignored(p3) {
|
|
224562
224580
|
const fullpath = p3.fullpath();
|
|
224563
224581
|
const fullpaths = `${fullpath}/`;
|
|
224564
|
-
const
|
|
224565
|
-
const relatives = `${
|
|
224582
|
+
const relative23 = p3.relative() || ".";
|
|
224583
|
+
const relatives = `${relative23}/`;
|
|
224566
224584
|
for (const m4 of this.relative) {
|
|
224567
|
-
if (m4.match(
|
|
224585
|
+
if (m4.match(relative23) || m4.match(relatives))
|
|
224568
224586
|
return true;
|
|
224569
224587
|
}
|
|
224570
224588
|
for (const m4 of this.absolute) {
|
|
@@ -224575,9 +224593,9 @@ var Ignore = class {
|
|
|
224575
224593
|
}
|
|
224576
224594
|
childrenIgnored(p3) {
|
|
224577
224595
|
const fullpath = p3.fullpath() + "/";
|
|
224578
|
-
const
|
|
224596
|
+
const relative23 = (p3.relative() || ".") + "/";
|
|
224579
224597
|
for (const m4 of this.relativeChildren) {
|
|
224580
|
-
if (m4.match(
|
|
224598
|
+
if (m4.match(relative23))
|
|
224581
224599
|
return true;
|
|
224582
224600
|
}
|
|
224583
224601
|
for (const m4 of this.absoluteChildren) {
|
|
@@ -225788,7 +225806,7 @@ async function getYarnType(projectDir) {
|
|
|
225788
225806
|
|
|
225789
225807
|
// ../fixing-management/src/fixing-management/npm/npm-fixing-manager.ts
|
|
225790
225808
|
import { readFile as readFile15, writeFile as writeFile4 } from "fs/promises";
|
|
225791
|
-
import { resolve as resolve21 } from "path";
|
|
225809
|
+
import { relative as relative6, resolve as resolve21 } from "path";
|
|
225792
225810
|
|
|
225793
225811
|
// ../fixing-management/src/fixing-management/npm/npm-ecosystem-fixing-manager.ts
|
|
225794
225812
|
var NpmEcosystemFixingManager = class {
|
|
@@ -225813,7 +225831,12 @@ var NpmEcosystemFixingManager = class {
|
|
|
225813
225831
|
signalFixApplied2?.(fixId, this.subprojectPath, workspacePath, vulnerabilityFixes);
|
|
225814
225832
|
});
|
|
225815
225833
|
});
|
|
225816
|
-
|
|
225834
|
+
try {
|
|
225835
|
+
await this.finalizeFixes();
|
|
225836
|
+
} catch (e) {
|
|
225837
|
+
logCommandOutput({ error: e, stdout: e.stdout ?? "", stderr: e.stderr ?? "" }, "finalizeFixes", this.rootDir);
|
|
225838
|
+
throw e;
|
|
225839
|
+
}
|
|
225817
225840
|
}
|
|
225818
225841
|
async applySecurityFixesForWorkspace(workspacePath, fixes, dependencyTree, directDependencyToPackageType) {
|
|
225819
225842
|
const that = this;
|
|
@@ -225867,14 +225890,18 @@ var NpmFixingManager = class extends NpmEcosystemFixingManager {
|
|
|
225867
225890
|
}
|
|
225868
225891
|
}
|
|
225869
225892
|
async finalizeFixes() {
|
|
225870
|
-
|
|
225871
|
-
|
|
225893
|
+
const cmd = cmdt`${await getNpmBin()} install --package-lock-only --ignore-scripts --no-fund --no-audit --no-progress`;
|
|
225894
|
+
logger.info(`Adjusting lock file by running '${cmd}'`);
|
|
225895
|
+
await exec2(cmd, resolve21(this.rootDir, this.subprojectPath));
|
|
225896
|
+
logger.info(
|
|
225897
|
+
`Run 'npm install' in '${relative6(this.rootDir, this.subprojectPath) || "."}' to install the updated dependencies`
|
|
225898
|
+
);
|
|
225872
225899
|
}
|
|
225873
225900
|
};
|
|
225874
225901
|
|
|
225875
225902
|
// ../fixing-management/src/fixing-management/npm/pnpm-fixing-manager.ts
|
|
225876
225903
|
import { readFile as readFile16, writeFile as writeFile5 } from "fs/promises";
|
|
225877
|
-
import { resolve as resolve22 } from "path";
|
|
225904
|
+
import { relative as relative7, resolve as resolve22 } from "path";
|
|
225878
225905
|
var import_yaml = __toESM(require_dist10(), 1);
|
|
225879
225906
|
var import_lockfile_file2 = __toESM(require_lib25(), 1);
|
|
225880
225907
|
import { existsSync as existsSync11 } from "fs";
|
|
@@ -226006,12 +226033,12 @@ var PnpmFixingManager = class extends NpmEcosystemFixingManager {
|
|
|
226006
226033
|
}
|
|
226007
226034
|
}
|
|
226008
226035
|
async finalizeFixes() {
|
|
226009
|
-
const cmd = cmdt`pnpm install --
|
|
226010
|
-
logger.info(`Adjusting lock file
|
|
226011
|
-
|
|
226012
|
-
|
|
226013
|
-
|
|
226014
|
-
|
|
226036
|
+
const cmd = cmdt`pnpm install --lockfile-only --fix-lockfile --config.confirmModulesPurge=false`;
|
|
226037
|
+
logger.info(`Adjusting lock file by running '${cmd}'`);
|
|
226038
|
+
await exec2(cmd, resolve22(this.rootDir, this.subprojectPath));
|
|
226039
|
+
logger.info(
|
|
226040
|
+
`Run 'pnpm install' in '${relative7(this.rootDir, this.subprojectPath) || "."}' to install the updated dependencies`
|
|
226041
|
+
);
|
|
226015
226042
|
}
|
|
226016
226043
|
};
|
|
226017
226044
|
function getVersionNumber(version4) {
|
|
@@ -226058,10 +226085,10 @@ function updateCatalog(update3, map2) {
|
|
|
226058
226085
|
|
|
226059
226086
|
// ../fixing-management/src/fixing-management/npm/yarn-fixing-manager.ts
|
|
226060
226087
|
import { readFile as readFile17, writeFile as writeFile6 } from "fs/promises";
|
|
226061
|
-
import { resolve as resolve24 } from "path";
|
|
226088
|
+
import { relative as relative9, resolve as resolve24 } from "path";
|
|
226062
226089
|
|
|
226063
226090
|
// ../utils/src/package-utils.ts
|
|
226064
|
-
import { parse as parse7, join as join11, resolve as resolve23, normalize as normalize3, dirname as dirname13, basename as basename6, relative as
|
|
226091
|
+
import { parse as parse7, join as join11, resolve as resolve23, normalize as normalize3, dirname as dirname13, basename as basename6, relative as relative8 } from "path";
|
|
226065
226092
|
import { existsSync as existsSync12, readFileSync as readFileSync3, readdirSync as readdirSync3, statSync as statSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
226066
226093
|
function setFieldInPackageJson(workspaceRoot, field, value2) {
|
|
226067
226094
|
const packageJSONContentObj = getPackageJsonObject2(workspaceRoot);
|
|
@@ -226259,8 +226286,29 @@ var YarnFixingManager = class extends NpmEcosystemFixingManager {
|
|
|
226259
226286
|
}
|
|
226260
226287
|
}
|
|
226261
226288
|
async finalizeFixes() {
|
|
226262
|
-
|
|
226263
|
-
|
|
226289
|
+
const runYarnCommandOrThrow = async (cmd, dir, options) => {
|
|
226290
|
+
const result = await this.runYarnCommand(cmd, dir, options);
|
|
226291
|
+
if (result.error) {
|
|
226292
|
+
const error = result.error;
|
|
226293
|
+
error.stdout = result.stdout;
|
|
226294
|
+
error.stderr = result.stderr;
|
|
226295
|
+
throw error;
|
|
226296
|
+
}
|
|
226297
|
+
};
|
|
226298
|
+
const yarnType = await this.getYarnType();
|
|
226299
|
+
if (yarnType === "berry") {
|
|
226300
|
+
const env = { ...process.env, YARN_ENABLE_SCRIPTS: "false", YARN_NODE_LINKER: "node-modules" };
|
|
226301
|
+
const cmd = cmdt`yarn install --mode=update-lockfile`;
|
|
226302
|
+
logger.info(`Adjusting lock file by running '${cmd}'`);
|
|
226303
|
+
await runYarnCommandOrThrow(cmd, resolve24(this.rootDir, this.subprojectPath), { env });
|
|
226304
|
+
logger.info(
|
|
226305
|
+
`Run 'yarn install' in '${relative9(this.rootDir, this.subprojectPath) || "."}' to install the updated dependencies`
|
|
226306
|
+
);
|
|
226307
|
+
} else {
|
|
226308
|
+
const cmd = cmdt`yarn install --ignore-scripts --noninteractive`;
|
|
226309
|
+
logger.info(`Adjusting lock file by running '${cmd}'`);
|
|
226310
|
+
await runYarnCommandOrThrow(cmd, resolve24(this.rootDir, this.subprojectPath));
|
|
226311
|
+
}
|
|
226264
226312
|
}
|
|
226265
226313
|
};
|
|
226266
226314
|
|
|
@@ -226333,7 +226381,7 @@ var NpmSocketUpgradeManager = class {
|
|
|
226333
226381
|
if (!subprojectToUpgrade.has(subprojectDir)) {
|
|
226334
226382
|
subprojectToUpgrade.set(subprojectDir, /* @__PURE__ */ new Map());
|
|
226335
226383
|
}
|
|
226336
|
-
const workspacePath =
|
|
226384
|
+
const workspacePath = relative10(subprojectDir, packageJsonDir) || ".";
|
|
226337
226385
|
if (!subprojectToUpgrade.get(subprojectDir)?.has(workspacePath)) {
|
|
226338
226386
|
subprojectToUpgrade.get(subprojectDir)?.set(workspacePath, []);
|
|
226339
226387
|
}
|
|
@@ -226408,6 +226456,7 @@ var NpmSocketUpgradeManager = class {
|
|
|
226408
226456
|
status: "error",
|
|
226409
226457
|
file: lockfilePath,
|
|
226410
226458
|
message: `Failed to finalize lockfile: ${e.message}`,
|
|
226459
|
+
details: e.stderr,
|
|
226411
226460
|
artifacts: i3(allUpgrades.map((u8) => u8.idx))
|
|
226412
226461
|
});
|
|
226413
226462
|
throw e;
|
|
@@ -226824,7 +226873,7 @@ import { dirname as dirname16, resolve as resolve27 } from "node:path";
|
|
|
226824
226873
|
// ../utils/src/nuget-project-utils.ts
|
|
226825
226874
|
var import_parse_xml3 = __toESM(require_dist(), 1);
|
|
226826
226875
|
import { readFile as readFile20 } from "node:fs/promises";
|
|
226827
|
-
import { dirname as dirname15, join as join15, relative as
|
|
226876
|
+
import { dirname as dirname15, join as join15, relative as relative11, resolve as resolve26, basename as basename8, extname } from "node:path";
|
|
226828
226877
|
import { existsSync as existsSync14 } from "node:fs";
|
|
226829
226878
|
|
|
226830
226879
|
// ../utils/dist/version-comparison/version-satisfies.js
|
|
@@ -228409,7 +228458,7 @@ async function loadNuGetProjectOrTarget(rootDir, projectFile, mainProject, visit
|
|
|
228409
228458
|
});
|
|
228410
228459
|
currentProject.sourceFiles.push(...files);
|
|
228411
228460
|
} catch (err) {
|
|
228412
|
-
logger.debug(`Failed to glob default pattern for ${
|
|
228461
|
+
logger.debug(`Failed to glob default pattern for ${relative11(rootDir, validatedProjectPath)}: ${err}`);
|
|
228413
228462
|
}
|
|
228414
228463
|
}
|
|
228415
228464
|
mainProject ??= currentProject;
|
|
@@ -228672,11 +228721,11 @@ async function handleCompileItem(project, child) {
|
|
|
228672
228721
|
} catch (err) {
|
|
228673
228722
|
if (evaluatedExclude) {
|
|
228674
228723
|
logger.debug(
|
|
228675
|
-
`Failed to glob Compile Include ${includePatterns}, Exclude ${excludePatterns} in ${
|
|
228724
|
+
`Failed to glob Compile Include ${includePatterns}, Exclude ${excludePatterns} in ${relative11(project.rootDir, project.validatedProjectPath)}: ${err}`
|
|
228676
228725
|
);
|
|
228677
228726
|
} else {
|
|
228678
228727
|
logger.debug(
|
|
228679
|
-
`Failed to glob Compile Include ${includePatterns} in ${
|
|
228728
|
+
`Failed to glob Compile Include ${includePatterns} in ${relative11(project.rootDir, project.validatedProjectPath)}: ${err}`
|
|
228680
228729
|
);
|
|
228681
228730
|
}
|
|
228682
228731
|
}
|
|
@@ -228696,7 +228745,7 @@ async function handleCompileItem(project, child) {
|
|
|
228696
228745
|
project.sourceFiles = project.sourceFiles.filter((f6) => !removeSet.has(f6));
|
|
228697
228746
|
} catch (err) {
|
|
228698
228747
|
logger.debug(
|
|
228699
|
-
`Failed to glob Compile Remove pattern ${evaluatedRemove} in ${
|
|
228748
|
+
`Failed to glob Compile Remove pattern ${evaluatedRemove} in ${relative11(project.rootDir, project.validatedProjectPath)}: ${err}`
|
|
228700
228749
|
);
|
|
228701
228750
|
}
|
|
228702
228751
|
}
|
|
@@ -228706,7 +228755,7 @@ function handlePropertyGroupElement(project, propertyGroup) {
|
|
|
228706
228755
|
const condition = createAttributeMap(propertyGroup, project.sourceText).get("Condition");
|
|
228707
228756
|
if (condition) {
|
|
228708
228757
|
logger.debug(
|
|
228709
|
-
`Skipping conditional property group ${propertyGroup.name} (${propertyGroup.start}, ${propertyGroup.end}) with condition ${condition.text} in file ${
|
|
228758
|
+
`Skipping conditional property group ${propertyGroup.name} (${propertyGroup.start}, ${propertyGroup.end}) with condition ${condition.text} in file ${relative11(project.rootDir, project.validatedProjectPath)}`
|
|
228710
228759
|
);
|
|
228711
228760
|
return;
|
|
228712
228761
|
}
|
|
@@ -228716,7 +228765,7 @@ function handlePropertyGroupElement(project, propertyGroup) {
|
|
|
228716
228765
|
const condition2 = createAttributeMap(propertyElement, project.sourceText).get("Condition");
|
|
228717
228766
|
if (condition2) {
|
|
228718
228767
|
logger.debug(
|
|
228719
|
-
`Skipping conditional property ${propertyElement.name} (${propertyElement.start}, ${propertyElement.end}) with condition ${condition2.text} in file ${
|
|
228768
|
+
`Skipping conditional property ${propertyElement.name} (${propertyElement.start}, ${propertyElement.end}) with condition ${condition2.text} in file ${relative11(project.rootDir, project.validatedProjectPath)}`
|
|
228720
228769
|
);
|
|
228721
228770
|
continue;
|
|
228722
228771
|
}
|
|
@@ -228786,7 +228835,7 @@ function evaluate3(expression, project) {
|
|
|
228786
228835
|
function evaluateWithContext(value2, depth) {
|
|
228787
228836
|
if (depth > 50) {
|
|
228788
228837
|
logger.warn(
|
|
228789
|
-
`Recursion limit hit while evaluating expression ${expression} in project ${
|
|
228838
|
+
`Recursion limit hit while evaluating expression ${expression} in project ${relative11(project.rootDir, project.validatedProjectPath)}`
|
|
228790
228839
|
);
|
|
228791
228840
|
isFullyEvaluated = false;
|
|
228792
228841
|
return value2;
|
|
@@ -228797,7 +228846,7 @@ function evaluate3(expression, project) {
|
|
|
228797
228846
|
return evaluateWithContext(property.text, depth + 1);
|
|
228798
228847
|
} else {
|
|
228799
228848
|
logger.debug(
|
|
228800
|
-
`Unknown property ${propertyName} for project ${
|
|
228849
|
+
`Unknown property ${propertyName} for project ${relative11(project.rootDir, project.validatedProjectPath)}`
|
|
228801
228850
|
);
|
|
228802
228851
|
isFullyEvaluated = false;
|
|
228803
228852
|
return "";
|
|
@@ -229271,7 +229320,7 @@ var NuGetSocketUpgradeManager = class {
|
|
|
229271
229320
|
};
|
|
229272
229321
|
|
|
229273
229322
|
// ../fixing-management/src/fixing-management/rust/cargo-socket-upgrade-manager.ts
|
|
229274
|
-
import { dirname as dirname18, relative as
|
|
229323
|
+
import { dirname as dirname18, relative as relative12, resolve as resolve29 } from "node:path";
|
|
229275
229324
|
var import_picomatch6 = __toESM(require_picomatch2(), 1);
|
|
229276
229325
|
var import_semver4 = __toESM(require_semver2(), 1);
|
|
229277
229326
|
import assert12 from "node:assert";
|
|
@@ -229423,14 +229472,14 @@ var CargoSocketUpgradeManager = class {
|
|
|
229423
229472
|
await writeFile8(path9, content);
|
|
229424
229473
|
ctxt.statusUpdater?.({
|
|
229425
229474
|
status: "success",
|
|
229426
|
-
file:
|
|
229475
|
+
file: relative12(this.rootDir, path9),
|
|
229427
229476
|
message: "File restored",
|
|
229428
229477
|
artifacts: i3(artifacts)
|
|
229429
229478
|
});
|
|
229430
229479
|
} catch (e) {
|
|
229431
229480
|
ctxt.statusUpdater?.({
|
|
229432
229481
|
status: "error",
|
|
229433
|
-
file:
|
|
229482
|
+
file: relative12(this.rootDir, path9),
|
|
229434
229483
|
message: "Could not restore file",
|
|
229435
229484
|
artifacts: i3(artifacts)
|
|
229436
229485
|
});
|
|
@@ -229629,7 +229678,7 @@ ${newDependencyLine}`
|
|
|
229629
229678
|
};
|
|
229630
229679
|
|
|
229631
229680
|
// ../fixing-management/src/fixing-management/pip/pip-socket-upgrade-manager.ts
|
|
229632
|
-
import { dirname as dirname20, relative as
|
|
229681
|
+
import { dirname as dirname20, relative as relative13, resolve as resolve32 } from "node:path";
|
|
229633
229682
|
var import_picomatch8 = __toESM(require_picomatch2(), 1);
|
|
229634
229683
|
import assert13 from "node:assert";
|
|
229635
229684
|
import { readFile as readFile25, writeFile as writeFile9 } from "node:fs/promises";
|
|
@@ -230146,14 +230195,14 @@ var PipSocketUpgradeManager = class {
|
|
|
230146
230195
|
await writeFile9(path9, content);
|
|
230147
230196
|
ctxt.statusUpdater?.({
|
|
230148
230197
|
status: "success",
|
|
230149
|
-
file:
|
|
230198
|
+
file: relative13(this.rootDir, path9),
|
|
230150
230199
|
message: "File restored",
|
|
230151
230200
|
artifacts: i3(artifacts)
|
|
230152
230201
|
});
|
|
230153
230202
|
} catch (e) {
|
|
230154
230203
|
ctxt.statusUpdater?.({
|
|
230155
230204
|
status: "error",
|
|
230156
|
-
file:
|
|
230205
|
+
file: relative13(this.rootDir, path9),
|
|
230157
230206
|
message: "Could not restore file",
|
|
230158
230207
|
artifacts: i3(artifacts)
|
|
230159
230208
|
});
|
|
@@ -230591,14 +230640,14 @@ function satisfiestVersionSpecs(version4, versionSpec) {
|
|
|
230591
230640
|
}
|
|
230592
230641
|
|
|
230593
230642
|
// ../fixing-management/src/fixing-management/rubygems/rubygems-socket-upgrade-manager.ts
|
|
230594
|
-
import { dirname as dirname22, relative as
|
|
230643
|
+
import { dirname as dirname22, relative as relative15, resolve as resolve34 } from "node:path";
|
|
230595
230644
|
var import_picomatch9 = __toESM(require_picomatch2(), 1);
|
|
230596
230645
|
import assert14 from "node:assert";
|
|
230597
230646
|
|
|
230598
230647
|
// ../fixing-management/src/fixing-management/rubygems/gemfile-utils.ts
|
|
230599
230648
|
var import_good_enough_parser4 = __toESM(require_cjs(), 1);
|
|
230600
230649
|
init_ruby_lang();
|
|
230601
|
-
import { resolve as resolve33, dirname as dirname21, relative as
|
|
230650
|
+
import { resolve as resolve33, dirname as dirname21, relative as relative14 } from "node:path";
|
|
230602
230651
|
import { existsSync as existsSync16, readFileSync as readFileSync4, readdirSync as readdirSync4 } from "node:fs";
|
|
230603
230652
|
init_gemspec_utils();
|
|
230604
230653
|
var booleanQuery2 = import_good_enough_parser4.query.alt(
|
|
@@ -230707,13 +230756,13 @@ var evalGemfileQuery = import_good_enough_parser4.query.sym("eval_gemfile").join
|
|
|
230707
230756
|
ctx.exprEndOffset = void 0;
|
|
230708
230757
|
if (ctx.depth > 50) {
|
|
230709
230758
|
logger.warn(
|
|
230710
|
-
`Recursion limit hit while evaluating gemfile: ${
|
|
230759
|
+
`Recursion limit hit while evaluating gemfile: ${relative14(ctx.gemfile.rootDir, resolve33(ctx.gemfile.rootDir, ctx.gemfile.file))}`
|
|
230711
230760
|
);
|
|
230712
230761
|
return ctx;
|
|
230713
230762
|
}
|
|
230714
230763
|
if (pathEvaluated === void 0) return ctx;
|
|
230715
230764
|
const rootDir = ctx.gemfile.rootDir;
|
|
230716
|
-
const file =
|
|
230765
|
+
const file = relative14(rootDir, resolve33(rootDir, dirname21(ctx.gemfile.file), pathEvaluated));
|
|
230717
230766
|
if (!existsSync16(resolve33(rootDir, file))) return ctx;
|
|
230718
230767
|
const sourceText = readFileSync4(resolve33(rootDir, file), "utf-8");
|
|
230719
230768
|
const parser2 = import_good_enough_parser4.lang.createLang(lang3);
|
|
@@ -230766,7 +230815,7 @@ var gemspecQuery = import_good_enough_parser4.query.sym("gemspec").opt(
|
|
|
230766
230815
|
).handler((ctx) => {
|
|
230767
230816
|
if (ctx.depth > 50) {
|
|
230768
230817
|
logger.warn(
|
|
230769
|
-
`Recursion limit hit while evaluating gemspec: ${
|
|
230818
|
+
`Recursion limit hit while evaluating gemspec: ${relative14(ctx.gemfile.rootDir, resolve33(ctx.gemfile.rootDir, ctx.gemfile.file))}`
|
|
230770
230819
|
);
|
|
230771
230820
|
ctx.currentGem = void 0;
|
|
230772
230821
|
return ctx;
|
|
@@ -230805,7 +230854,7 @@ var gemspecQuery = import_good_enough_parser4.query.sym("gemspec").opt(
|
|
|
230805
230854
|
if (gemspecFiles.length === 0) return ctx;
|
|
230806
230855
|
const gemspecFile = gemspecFiles[0];
|
|
230807
230856
|
const gemspecFullPath = resolve33(searchDir, gemspecFile);
|
|
230808
|
-
const gemspecRelativePath =
|
|
230857
|
+
const gemspecRelativePath = relative14(rootDir, gemspecFullPath);
|
|
230809
230858
|
try {
|
|
230810
230859
|
const sourceText = readFileSync4(gemspecFullPath, "utf-8");
|
|
230811
230860
|
const gemspec = parseGemspec(rootDir, gemspecRelativePath, sourceText);
|
|
@@ -231181,7 +231230,7 @@ var RubygemsSocketUpgradeManager = class {
|
|
|
231181
231230
|
});
|
|
231182
231231
|
continue;
|
|
231183
231232
|
}
|
|
231184
|
-
const gemfileName =
|
|
231233
|
+
const gemfileName = relative15(this.rootDir, resolve34(this.rootDir, dirname22(mf.file), "Gemfile"));
|
|
231185
231234
|
gemfileToLockfile.set(gemfileName, mf.file);
|
|
231186
231235
|
if (pathGems.length > 0) {
|
|
231187
231236
|
const { gemspecPatches, gemfilePatches } = await this.handleGemspecDependency(
|
|
@@ -231260,14 +231309,14 @@ var RubygemsSocketUpgradeManager = class {
|
|
|
231260
231309
|
await writeFile10(path9, content);
|
|
231261
231310
|
ctxt.statusUpdater?.({
|
|
231262
231311
|
status: "success",
|
|
231263
|
-
file:
|
|
231312
|
+
file: relative15(this.rootDir, path9),
|
|
231264
231313
|
message: "File restored",
|
|
231265
231314
|
artifacts: i3(artifacts)
|
|
231266
231315
|
});
|
|
231267
231316
|
} catch (e) {
|
|
231268
231317
|
ctxt.statusUpdater?.({
|
|
231269
231318
|
status: "error",
|
|
231270
|
-
file:
|
|
231319
|
+
file: relative15(this.rootDir, path9),
|
|
231271
231320
|
message: "Could not restore file",
|
|
231272
231321
|
artifacts: i3(artifacts)
|
|
231273
231322
|
});
|
|
@@ -231532,7 +231581,7 @@ var import_lodash7 = __toESM(require_lodash(), 1);
|
|
|
231532
231581
|
var import_micromatch2 = __toESM(require_micromatch(), 1);
|
|
231533
231582
|
import { existsSync as existsSync17 } from "fs";
|
|
231534
231583
|
import { access as access4, cp as cp3, readdir as readdir4, stat as stat4 } from "fs/promises";
|
|
231535
|
-
import { basename as basename9, join as join17, relative as
|
|
231584
|
+
import { basename as basename9, join as join17, relative as relative16, resolve as resolve35 } from "path";
|
|
231536
231585
|
var { uniq: uniq2 } = import_lodash7.default;
|
|
231537
231586
|
var { isMatch: isMatch2 } = import_micromatch2.default;
|
|
231538
231587
|
function* parents2(dir) {
|
|
@@ -232105,12 +232154,12 @@ import { rmSync } from "fs";
|
|
|
232105
232154
|
import { mkdir as mkdir5, readFile as readFile30, writeFile as writeFile11 } from "fs/promises";
|
|
232106
232155
|
import assert15 from "node:assert";
|
|
232107
232156
|
import { platform as platform6 } from "os";
|
|
232108
|
-
import { join as join24, posix as posix2, relative as
|
|
232157
|
+
import { join as join24, posix as posix2, relative as relative18, sep as sep3 } from "path";
|
|
232109
232158
|
|
|
232110
232159
|
// ../utils/src/tmp-file.ts
|
|
232111
232160
|
import { rm, mkdtemp, cp as cp4, lstat as lstat2 } from "fs/promises";
|
|
232112
232161
|
import { tmpdir as tmpdir2 } from "os";
|
|
232113
|
-
import { join as join22, relative as
|
|
232162
|
+
import { join as join22, relative as relative17, sep as sep2, extname as extname2 } from "path";
|
|
232114
232163
|
async function createTmpDirectory(prefix) {
|
|
232115
232164
|
try {
|
|
232116
232165
|
const tmpDir = await mkdtemp(join22(tmpdir2(), prefix));
|
|
@@ -232147,7 +232196,7 @@ async function copyForNpmAnalysis(srcDir, prefix) {
|
|
|
232147
232196
|
verbatimSymlinks: true,
|
|
232148
232197
|
// Preserve symlinks as symlinks instead of dereferencing them
|
|
232149
232198
|
filter: async (src) => {
|
|
232150
|
-
const relativePath =
|
|
232199
|
+
const relativePath = relative17(srcDir, src);
|
|
232151
232200
|
if (relativePath === "") return true;
|
|
232152
232201
|
const pathSegments = relativePath.split(sep2);
|
|
232153
232202
|
if (pathSegments.some((segment) => EXCLUDED_DIRECTORIES.has(segment))) {
|
|
@@ -232528,7 +232577,7 @@ var OtherModulesCommunicator = class {
|
|
|
232528
232577
|
}
|
|
232529
232578
|
if (cmd === "getWorkspacePathsMultipleSubprojects")
|
|
232530
232579
|
return `${_cmdStr()}: (${packageManagerName}) ${abbreviateList(subprojects, 10)}`;
|
|
232531
|
-
return `${_cmdStr()}: (${packageManagerName}) ${
|
|
232580
|
+
return `${_cmdStr()}: (${packageManagerName}) ${relative18(this.rootWorkingDir, subprojectPath) || "."}`;
|
|
232532
232581
|
}
|
|
232533
232582
|
getSpinnerTextForReachabilityAnalyzerCommand(cmd, ecosystem, subprojectPath, workspacePath) {
|
|
232534
232583
|
function _cmdStr() {
|
|
@@ -232541,10 +232590,10 @@ var OtherModulesCommunicator = class {
|
|
|
232541
232590
|
return "Running reachability analysis on package registry package";
|
|
232542
232591
|
}
|
|
232543
232592
|
}
|
|
232544
|
-
return `${_cmdStr()}: (${ecosystem}) ${
|
|
232593
|
+
return `${_cmdStr()}: (${ecosystem}) ${relative18(this.rootWorkingDir, join24(subprojectPath, workspacePath)) || "."}`;
|
|
232545
232594
|
}
|
|
232546
232595
|
getProjectPath(subprojectPath) {
|
|
232547
|
-
return this.options.runWithoutDocker ? subprojectPath : posix2.resolve("/project",
|
|
232596
|
+
return this.options.runWithoutDocker ? subprojectPath : posix2.resolve("/project", relative18(this.rootWorkingDir, subprojectPath).replaceAll(sep3, posix2.sep));
|
|
232548
232597
|
}
|
|
232549
232598
|
// options shared between package-management and reachability-analyzers
|
|
232550
232599
|
commonOptions = once7(
|
|
@@ -232697,7 +232746,7 @@ var OtherModulesCommunicator = class {
|
|
|
232697
232746
|
"getWorkspacePathsMultipleSubprojects",
|
|
232698
232747
|
packageManagerName,
|
|
232699
232748
|
this.rootWorkingDir,
|
|
232700
|
-
subprojectPaths.map((subprojectPath) =>
|
|
232749
|
+
subprojectPaths.map((subprojectPath) => relative18(this.rootWorkingDir, subprojectPath) || ".")
|
|
232701
232750
|
);
|
|
232702
232751
|
}
|
|
232703
232752
|
async getProvidedArgsForSubproject(subprojectPath, providedOptions) {
|
|
@@ -234038,16 +234087,16 @@ function getVulnerabilitiesFromReport(report) {
|
|
|
234038
234087
|
var import_packageurl_js = __toESM(require_packageurl_js(), 1);
|
|
234039
234088
|
|
|
234040
234089
|
// dist/cli-upgrade-purl.js
|
|
234041
|
-
import { join as join27, relative as
|
|
234090
|
+
import { join as join27, relative as relative21, resolve as resolve41 } from "node:path";
|
|
234042
234091
|
var import_picomatch10 = __toESM(require_picomatch2(), 1);
|
|
234043
234092
|
|
|
234044
234093
|
// ../project-management/src/project-management/project-manager.ts
|
|
234045
|
-
import { relative as
|
|
234094
|
+
import { relative as relative20, resolve as resolve40 } from "path";
|
|
234046
234095
|
|
|
234047
234096
|
// ../project-management/src/project-management/ecosystem-management/ecosystem-manager.ts
|
|
234048
234097
|
var import_micromatch3 = __toESM(require_micromatch2(), 1);
|
|
234049
234098
|
import { readdir as readdir6 } from "fs/promises";
|
|
234050
|
-
import { join as join26, relative as
|
|
234099
|
+
import { join as join26, relative as relative19, resolve as resolve39 } from "path";
|
|
234051
234100
|
|
|
234052
234101
|
// ../project-management/src/project-management/ecosystem-management/ecosystem-specs.ts
|
|
234053
234102
|
import { existsSync as existsSync21 } from "fs";
|
|
@@ -234185,7 +234234,7 @@ var EcosystemManager = class _EcosystemManager {
|
|
|
234185
234234
|
const resolvedProjectDir = resolve39(mainProjectDir, relativeProjectDir);
|
|
234186
234235
|
if (config3.includeDirs.length > 0)
|
|
234187
234236
|
workspacePaths = workspacePaths.filter(
|
|
234188
|
-
(workspacePath) => isMatch3(
|
|
234237
|
+
(workspacePath) => isMatch3(relative19(mainProjectDir, join26(resolvedProjectDir, workspacePath)), config3.includeDirs)
|
|
234189
234238
|
);
|
|
234190
234239
|
workspacePaths.filter((workspacePath) => workspacePath !== ".").forEach((workspacePath) => projectDirsAlreadyCovered.push(resolve39(resolvedProjectDir, workspacePath)));
|
|
234191
234240
|
if (workspacePaths.length > 0)
|
|
@@ -234226,7 +234275,7 @@ var EcosystemManager = class _EcosystemManager {
|
|
|
234226
234275
|
return typeof packageManagerNameProvider === "function" ? await packageManagerNameProvider(projectDir) : packageManagerNameProvider;
|
|
234227
234276
|
} catch (e) {
|
|
234228
234277
|
if (e instanceof InvalidProjectFileError) {
|
|
234229
|
-
const projectDirRelative =
|
|
234278
|
+
const projectDirRelative = relative19(mainProjectDir, projectDir) || ".";
|
|
234230
234279
|
logger.error(
|
|
234231
234280
|
`Invalid ${e.fileName} file in ${projectDirRelative}. If the project is intentionally invalid, and you want Coana to skip it in the scan, then add "--exclude-dirs ${projectDirRelative}" to the Coana command.`
|
|
234232
234281
|
);
|
|
@@ -234318,7 +234367,7 @@ function shouldIgnoreDir(dir) {
|
|
|
234318
234367
|
return dirsToIgnore.includes(dir);
|
|
234319
234368
|
}
|
|
234320
234369
|
function shouldIgnoreDueToExcludeDirsOrChangedFiles({ mainProjectDir, excludeDirs, changedFiles }, fullPath) {
|
|
234321
|
-
const relativeToProjectDir =
|
|
234370
|
+
const relativeToProjectDir = relative19(mainProjectDir, fullPath) || ".";
|
|
234322
234371
|
return !!(isMatch3(relativeToProjectDir, excludeDirs) || changedFiles && !changedFiles.some((changedFile) => changedFile.startsWith(relativeToProjectDir)));
|
|
234323
234372
|
}
|
|
234324
234373
|
|
|
@@ -234366,7 +234415,7 @@ var ProjectManager = class _ProjectManager {
|
|
|
234366
234415
|
if (subprojects.length === 0) return void 0;
|
|
234367
234416
|
return ` ${ecosystem}:
|
|
234368
234417
|
${subprojects.map(
|
|
234369
|
-
({ subprojectPath, workspacePaths }) => ` ${
|
|
234418
|
+
({ subprojectPath, workspacePaths }) => ` ${relative20(this.projectDir, subprojectPath) || ". (Root)"}${workspacePaths.length > 1 || workspacePaths[0] !== "." ? ` (${workspacePaths.length} ${ecosystem === "MAVEN" ? "modules" : "workspaces"})` : ""}`
|
|
234370
234419
|
).join("\n")}`;
|
|
234371
234420
|
}).filter((line) => line).join("\n");
|
|
234372
234421
|
const detailsString = Object.entries(this.ecosystemToEcosystemManager).map(([ecosystem, manager]) => {
|
|
@@ -234374,7 +234423,7 @@ ${subprojects.map(
|
|
|
234374
234423
|
if (subprojects.length === 0) return void 0;
|
|
234375
234424
|
const subprojectsString = subprojects.map(({ subprojectPath, workspacePaths, packageManagerName }) => {
|
|
234376
234425
|
if (workspacePaths.length === 1 && workspacePaths[0] === ".") return void 0;
|
|
234377
|
-
return ` ${
|
|
234426
|
+
return ` ${relative20(this.projectDir, subprojectPath) || ". (Root)"}
|
|
234378
234427
|
${workspacePaths.map((ws) => ` ${ws === "." ? ". (Root)" : ws} - ${packageManagerName}`).join("\n")}`;
|
|
234379
234428
|
}).filter((line) => line).join("\n");
|
|
234380
234429
|
if (!subprojectsString) return void 0;
|
|
@@ -234530,7 +234579,7 @@ ${Array.from(upgrades).map(([idx, upgradeVersion]) => ` ${prettyPrintPurlUpgrade
|
|
|
234530
234579
|
warn: "\u26A0\uFE0F",
|
|
234531
234580
|
error: "\u274C"
|
|
234532
234581
|
};
|
|
234533
|
-
logger.info(`${statusIcons[update3.status]} ${update3.message} \u2500 ${
|
|
234582
|
+
logger.info(`${statusIcons[update3.status]} ${update3.message} \u2500 ${relative21(rootDir, resolve41(rootDir, update3.file))}`);
|
|
234534
234583
|
update3.artifacts.forEach((idx, i7) => {
|
|
234535
234584
|
logger.info(`${" ".repeat(3)}${i7 === update3.artifacts.length - 1 ? "\u2514\u2500" : "\u251C\u2500"} ${prettyPrintSocketFactArtifactUpgrade(artifacts[idx], upgrades2.get(idx))}`);
|
|
234536
234585
|
});
|
|
@@ -234584,7 +234633,7 @@ ${Array.from(upgrades).map(([idx, upgradeVersion]) => ` ${prettyPrintPurlUpgrade
|
|
|
234584
234633
|
const subprojectPromiseQueue = new PromiseQueue(Number(options.concurrency));
|
|
234585
234634
|
supportedSubprojects.forEach((subproject) => {
|
|
234586
234635
|
subprojectPromiseQueue.enqueueTask(async () => {
|
|
234587
|
-
const workspacePathsMatchingGlob = subproject.workspacePaths.filter((wsPath) => wsFilter(
|
|
234636
|
+
const workspacePathsMatchingGlob = subproject.workspacePaths.filter((wsPath) => wsFilter(relative21(rootDir, resolve41(rootDir, subproject.subprojectPath, wsPath)) || "."));
|
|
234588
234637
|
if (workspacePathsMatchingGlob.length === 0)
|
|
234589
234638
|
return;
|
|
234590
234639
|
const filterDescription = options.include !== void 0 || options.exclude !== void 0 ? `matching filters ${options.include ? `include: [${options.include.join(", ")}]` : ""}${options.include && options.exclude ? " " : ""}${options.exclude ? `exclude: [${options.exclude.join(", ")}]` : ""}` : "";
|
|
@@ -234626,7 +234675,7 @@ ${workspacePathsMatchingGlob.map((wsPath) => ` ${wsPath}`).join("\n")}`);
|
|
|
234626
234675
|
logger.info(`No dependencies matching upgrade specs found for subproject ${subproject.subprojectPath}`);
|
|
234627
234676
|
return;
|
|
234628
234677
|
}
|
|
234629
|
-
await applySecurityFixes(subproject.packageManagerName, rootDir,
|
|
234678
|
+
await applySecurityFixes(subproject.packageManagerName, rootDir, relative21(rootDir, subproject.subprojectPath) || ".", otherModulesCommunicator, workspaceToFixes, fixingData, signalFixApplied);
|
|
234630
234679
|
});
|
|
234631
234680
|
});
|
|
234632
234681
|
await subprojectPromiseQueue.onIdle();
|
|
@@ -234946,7 +234995,7 @@ var kleur_default = $;
|
|
|
234946
234995
|
// dist/cli-core.js
|
|
234947
234996
|
var import_lodash15 = __toESM(require_lodash(), 1);
|
|
234948
234997
|
import os from "os";
|
|
234949
|
-
import { join as join30, relative as
|
|
234998
|
+
import { join as join30, relative as relative22, resolve as resolve43 } from "path";
|
|
234950
234999
|
|
|
234951
235000
|
// ../utils/src/dashboard-api/shared-api.ts
|
|
234952
235001
|
var DashboardAPI = class {
|
|
@@ -236227,7 +236276,7 @@ function getMongoClient() {
|
|
|
236227
236276
|
}
|
|
236228
236277
|
|
|
236229
236278
|
// ../security-auditor/security-auditor-api/src/vulnerability-patterns-helper/get-interesting-urls-for-vulnerability.ts
|
|
236230
|
-
import { exec as
|
|
236279
|
+
import { exec as exec4 } from "child_process";
|
|
236231
236280
|
import { promisify } from "util";
|
|
236232
236281
|
|
|
236233
236282
|
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/options.js
|
|
@@ -237868,10 +237917,10 @@ function compareDocumentPosition(nodeA, nodeB) {
|
|
|
237868
237917
|
function uniqueSort(nodes) {
|
|
237869
237918
|
nodes = nodes.filter((node, i7, arr) => !arr.includes(node, i7 + 1));
|
|
237870
237919
|
nodes.sort((a4, b) => {
|
|
237871
|
-
const
|
|
237872
|
-
if (
|
|
237920
|
+
const relative23 = compareDocumentPosition(a4, b);
|
|
237921
|
+
if (relative23 & DocumentPosition.PRECEDING) {
|
|
237873
237922
|
return -1;
|
|
237874
|
-
} else if (
|
|
237923
|
+
} else if (relative23 & DocumentPosition.FOLLOWING) {
|
|
237875
237924
|
return 1;
|
|
237876
237925
|
}
|
|
237877
237926
|
return 0;
|
|
@@ -249823,7 +249872,7 @@ async function getInterestingURLsForVulnerability(vulnerability, packageMetadata
|
|
|
249823
249872
|
}
|
|
249824
249873
|
async function computeComparisonURLs(scmUrl, vulnAndFixVersionsArr) {
|
|
249825
249874
|
try {
|
|
249826
|
-
const gitTags = (await promisify(
|
|
249875
|
+
const gitTags = (await promisify(exec4)(`git ls-remote ${scmUrl} | grep -F "refs/tags"`)).stdout.split("\n");
|
|
249827
249876
|
logger3.debug("gitTags", gitTags);
|
|
249828
249877
|
logger3.debug("vulnAndFixVersionsArr", vulnAndFixVersionsArr);
|
|
249829
249878
|
const versionToSha = {};
|
|
@@ -249858,7 +249907,7 @@ async function computeInterestingCommitURLs(text3, scmUrl) {
|
|
|
249858
249907
|
const repo = scmUrl.split("/").slice(-2).join("/");
|
|
249859
249908
|
const cmd = `gh search commits ${text3} --repo ${repo}`;
|
|
249860
249909
|
logger3.debug(`Finding issue or PR url for text ${text3}`, cmd);
|
|
249861
|
-
const { stdout } = await promisify(
|
|
249910
|
+
const { stdout } = await promisify(exec4)(cmd, { shell: "/bin/zsh" });
|
|
249862
249911
|
return stdout.split("\n").filter((line) => line).map((line) => {
|
|
249863
249912
|
const [repo2, sha] = line.split(" ");
|
|
249864
249913
|
return `https://www.github.com/${repo2}/commit/${sha}`;
|
|
@@ -249872,7 +249921,7 @@ async function computeInterestingIssueAndPRUrlsWithText(text3, scmUrl) {
|
|
|
249872
249921
|
const repo = scmUrl.split("/").slice(-2).join("/");
|
|
249873
249922
|
const cmd = `gh search issues ${text3} in:title,body,comment --repo ${repo} --include-prs`;
|
|
249874
249923
|
console.log(`Finding issue or PR url for text ${text3}`, cmd);
|
|
249875
|
-
const { stdout } = await promisify(
|
|
249924
|
+
const { stdout } = await promisify(exec4)(cmd, { shell: "/bin/zsh" });
|
|
249876
249925
|
return stdout.split("\n").filter((line) => line).map((line) => {
|
|
249877
249926
|
const [issueOrPr, repo2, id] = line.split(" ");
|
|
249878
249927
|
const issueOrPrUrlPart = issueOrPr === "issue" ? "issues" : "pull";
|
|
@@ -251101,7 +251150,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
|
|
|
251101
251150
|
}
|
|
251102
251151
|
|
|
251103
251152
|
// dist/version.js
|
|
251104
|
-
var version3 = "14.12.
|
|
251153
|
+
var version3 = "14.12.131";
|
|
251105
251154
|
|
|
251106
251155
|
// dist/cli-core.js
|
|
251107
251156
|
var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
|
|
@@ -251494,7 +251543,7 @@ var CliCore = class {
|
|
|
251494
251543
|
const { reachabilitySupport, traditionalScaSupport, noSupport } = manager.getSubprojectsWithWorkspacePaths();
|
|
251495
251544
|
await this.dashboardAPI.registerSubprojects([...reachabilitySupport, ...traditionalScaSupport, ...noSupport].map((sp) => ({
|
|
251496
251545
|
...sp,
|
|
251497
|
-
subprojectPath:
|
|
251546
|
+
subprojectPath: relative22(this.rootWorkingDirectory, sp.subprojectPath) || "."
|
|
251498
251547
|
})), this.reportId, this.apiKey);
|
|
251499
251548
|
for (const unsupported of noSupport)
|
|
251500
251549
|
logger.warn(unsupported.unsupportedMsg);
|
|
@@ -251523,7 +251572,7 @@ var CliCore = class {
|
|
|
251523
251572
|
await this.spinner.succeed();
|
|
251524
251573
|
} catch (error) {
|
|
251525
251574
|
if (this.options.ignoreFailingWorkspaces) {
|
|
251526
|
-
const relativeSubprojectPath =
|
|
251575
|
+
const relativeSubprojectPath = relative22(this.rootWorkingDirectory, subprojectAndWsPath.subprojectPath) || ".";
|
|
251527
251576
|
this.failedSubprojects.push({
|
|
251528
251577
|
subproject: relativeSubprojectPath,
|
|
251529
251578
|
error: error.message || "Unknown error"
|
|
@@ -251582,7 +251631,7 @@ Subproject: ${subproject}`);
|
|
|
251582
251631
|
}
|
|
251583
251632
|
async updateSpinnerTextOnNewSubproject(subprojectAndWsPath, numberSubprojects, index2) {
|
|
251584
251633
|
this.spinner.start();
|
|
251585
|
-
const relativeSubprojectPath =
|
|
251634
|
+
const relativeSubprojectPath = relative22(this.rootWorkingDirectory, subprojectAndWsPath.subprojectPath) || ".";
|
|
251586
251635
|
await this.spinner.setText(numberSubprojects > 1 ? `Processing subproject ${relativeSubprojectPath} (${index2 + 1}/${numberSubprojects})${+this.options.concurrency > 1 ? `. May process up to ${+this.options.concurrency - 1} other workspaces in parallel` : ""}` : `Processing ${relativeSubprojectPath}`);
|
|
251587
251636
|
}
|
|
251588
251637
|
async initialize() {
|
|
@@ -251664,7 +251713,7 @@ Subproject: ${subproject}`);
|
|
|
251664
251713
|
return workspaceToAugmentedVulnerabilities[workspacePath] !== void 0;
|
|
251665
251714
|
}).map((workspacePath) => {
|
|
251666
251715
|
return {
|
|
251667
|
-
subprojectPath:
|
|
251716
|
+
subprojectPath: relative22(this.rootWorkingDirectory, subprojectPath) || ".",
|
|
251668
251717
|
workspacePath,
|
|
251669
251718
|
directDependencies: projectInfo[workspacePath].dataForAnalysis.directDependenciesMap ?? {},
|
|
251670
251719
|
vulnerabilities: workspaceToAugmentedVulnerabilities[workspacePath],
|
|
@@ -251879,7 +251928,8 @@ Subproject: ${subproject}`);
|
|
|
251879
251928
|
printLogFile: this.options.printAnalysisLogFile,
|
|
251880
251929
|
// entryPoints are only supported for root workspace atm.
|
|
251881
251930
|
entryPoints: workspacePath === "." ? this.options.entryPoints : void 0,
|
|
251882
|
-
excludeDirs: this.options.excludeDirs
|
|
251931
|
+
excludeDirs: this.options.excludeDirs,
|
|
251932
|
+
lazy: this.options.lazyMode
|
|
251883
251933
|
}, {
|
|
251884
251934
|
disableBucketing: !!this.options.disableAnalysisSplitting,
|
|
251885
251935
|
lightweightReachability: this.options.lightweightReachability,
|
|
@@ -251892,7 +251942,7 @@ Subproject: ${subproject}`);
|
|
|
251892
251942
|
async sendProgress(type, isStartEvent, subprojectPath, workspacePath) {
|
|
251893
251943
|
await this.dashboardAPI.registerCLIProgress({
|
|
251894
251944
|
type,
|
|
251895
|
-
...subprojectPath ? { subprojectPath:
|
|
251945
|
+
...subprojectPath ? { subprojectPath: relative22(this.rootWorkingDirectory, subprojectPath) || "." } : {},
|
|
251896
251946
|
...workspacePath ? { workspacePath } : {}
|
|
251897
251947
|
}, isStartEvent, this.reportId, this.apiKey);
|
|
251898
251948
|
}
|
|
@@ -251948,7 +251998,7 @@ Subproject: ${subproject}`);
|
|
|
251948
251998
|
dependencyTree: workspaceToPlainDependencyTree[workspacePath],
|
|
251949
251999
|
ecosystem: workspaceToPlainDependencyTree[workspacePath].ecosystem ?? "NPM",
|
|
251950
252000
|
workspacePath,
|
|
251951
|
-
subprojectPath:
|
|
252001
|
+
subprojectPath: relative22(rootWorkingDirectory, subprojectPath) || "."
|
|
251952
252002
|
}));
|
|
251953
252003
|
if (this.options.socketMode) {
|
|
251954
252004
|
this.reportDependencyTrees = workspacePaths.map((workspacePath) => ({
|
|
@@ -251956,7 +252006,7 @@ Subproject: ${subproject}`);
|
|
|
251956
252006
|
dependencyTree: projectInfo[workspacePath].dataForAnalysis.data.dependencyTree,
|
|
251957
252007
|
ecosystem: projectInfo[workspacePath].dataForAnalysis.data.dependencyTree.ecosystem ?? "NPM",
|
|
251958
252008
|
workspacePath,
|
|
251959
|
-
subprojectPath:
|
|
252009
|
+
subprojectPath: relative22(rootWorkingDirectory, subprojectPath) || "."
|
|
251960
252010
|
}));
|
|
251961
252011
|
}
|
|
251962
252012
|
if (this.shareWithDashboard)
|
|
@@ -251972,7 +252022,7 @@ Subproject: ${subproject}`);
|
|
|
251972
252022
|
} catch (e) {
|
|
251973
252023
|
logger.error(`Scanning for vulnerabilities failed for subproject ${subprojectPath} in workspace ${workspacePath}`);
|
|
251974
252024
|
if (this.options.ignoreFailingWorkspaces) {
|
|
251975
|
-
const relativeSubprojectPath =
|
|
252025
|
+
const relativeSubprojectPath = relative22(this.rootWorkingDirectory, subprojectPath) || ".";
|
|
251976
252026
|
this.failedWorkspaces.push({
|
|
251977
252027
|
subproject: relativeSubprojectPath,
|
|
251978
252028
|
workspace: workspacePath,
|
|
@@ -251991,7 +252041,7 @@ Subproject: ${subproject}`);
|
|
|
251991
252041
|
}
|
|
251992
252042
|
};
|
|
251993
252043
|
function getRelativeSubprojectPath(subprojectPath, projectDir) {
|
|
251994
|
-
return
|
|
252044
|
+
return relative22(projectDir, subprojectPath) || ".";
|
|
251995
252045
|
}
|
|
251996
252046
|
function getDependencyType(vulnChainDetails, codeAwareScanResults, directDependencies, reachability) {
|
|
251997
252047
|
if (reachability === "UNREACHABLE" || reachability === "UNKNOWN") {
|
|
@@ -252027,7 +252077,7 @@ async function getGitDataToMetadataIfAvailable(rootWorkingDirectory) {
|
|
|
252027
252077
|
handleNexeBinaryMode();
|
|
252028
252078
|
var program2 = new Command();
|
|
252029
252079
|
var run2 = new Command();
|
|
252030
|
-
run2.name("run").argument("<path>", "File system path to folder containing the project").option("-o, --output-dir <path>", "Write json report to <path>/coana-report.json").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).option("-p, --print-report", "Print the report to the console", false).option("--offline-database <path>", "Path to a coana-offline-db.json file for running the CLI without internet connectivity", void 0).option("-t, --timeout <timeout>", "Set API <timeout> in milliseconds to Coana backend.", "300000").option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available. NPM reachability analysis does not support concurrent execution, so the concurrency level is ignored for NPM.", "1").option("--api-key <key>", "Set the Coana dashboard API key. By setting you also enable the dashboard integration.").addOption(new Option("--write-report-to-file", "Write the report dashboard-compatible report to dashboard-report.json. This report may help the Coana team debug issues with the report insertion mechanism.").default(false).hideHelp()).option("--project-name <repoName>", "Set the name of the repository. Used for dashboard integration.").option("--repo-url <repoUrl>", "Set the URL of the repository. Used for dashboard integration.").option("--include-dirs <relativeDirs...>", "globs for directories to include from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, projects that are not included may still be scanned if they are referenced from included projects.").option("--exclude-dirs <relativeDirs...>", "globs for directories to exclude from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, excluded projects may still be scanned if they are referenced from non-excluded projects.").option("--disable-analysis-splitting", "Limits Coana to at most 1 reachability analysis run per workspace").option("--print-analysis-log-file", "Store log output from the JavaScript/TypeScript reachability analysis in the file js-analysis.log file in the root of each workspace", false).option("--entry-points <entryPoints...>", "List of files to analyze for root workspace. The reachability analysis automatically analyzes all files used by the entry points. If not provided, all JavaScript and TypeScript files are considered entry points. For non-root workspaces, all JavaScript and TypeScript files are analyzed as well.").option("--include-projects-with-no-reachability-support", "Also runs Coana on projects where we support traditional SCA, but does not yet support reachability analysis.", false).option("--ecosystems <ecosystems...>", "List of ecosystems to analyze (space-separated). Currently NPM, PIP, MAVEN, NUGET and GO are supported. Default is all supported ecosystems.").addOption(new Option("--purl-types <purlTypes...>", "List of PURL types to analyze (space-separated). Currently npm, pypi, maven, nuget, golang and cargo are supported. Default is all supported purl types.").hideHelp()).option("--changed-files <files...>", "List of files that have changed. If provided, Coana only analyzes workspaces and modules that contain changed files.").option("--disable-report-submission", "Disable the submission of the report to the Coana dashboard. Used by the pipeline blocking feature.", false).option("--disable-analytics-sharing", "Disable analytics sharing.", false).option("--provider-project <path>", "File system path to folder containing the provider project (Only supported for Maven, Gradle, and SBT)").option("--provider-workspaces <dirs...>", "List of workspaces that build the provided runtime environment (Only supported for Maven, Gradle, and SBT)", (paths) => paths.split(" ")).option("--lightweight-reachability", "Runs Coana in lightweight mode. This increases analysis speed but also raises the risk of Coana misclassifying the reachability of certain complex vulnerabilities. Recommended only for use with Coana Guardrail mode.", false).addOption(new Option("--run-without-docker", "Run package managers and reachability analyzers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--run-env <env>", "Specifies the environment in which the CLI is run. So far only MANAGED_SCAN and UNKNOWN are supported.").default("UNKNOWN").choices(["UNKNOWN", "MANAGED_SCAN"]).hideHelp()).addOption(new Option("--guardrail-mode", "Run Coana in guardrail mode. This mode is used to prevent new reachable vulnerabilities from being introduced into the codebase. Usually run as a CI check when pushing new commits to a pull request.")).option("--ignore-failing-workspaces", "Continue processing when a workspace fails instead of exiting. Failed workspaces will be logged at termination.", false).addOption(new Option("--socket-mode <output-file>", "Run Coana in socket mode and write report to <output-file>").hideHelp()).addOption(new Option("--manifests-tar-hash <hash>", "Hash of the tarball containing all manifest files already uploaded to Socket. If provided, Socket will be used for computing dependency trees.").hideHelp()).option("--skip-cache-usage", "Do not attempt to use cached analysis configuration from previous runs", false).addOption(new Option("--min-severity <severity>", "Set the minimum severity of vulnerabilities to analyze. Supported severities are info, low, moderate, high and critical.").choices(["info", "INFO", "low", "LOW", "moderate", "MODERATE", "high", "HIGH", "critical", "CRITICAL"])).option("--use-unreachable-from-precomputation", "Skip the reachability analysis for vulnerabilities that are already known to be unreachable from the precomputed reachability analysis (Tier 2).", false).addOption(new Option("--use-only-pregenerated-sboms", "Only include artifacts that have CDX or SPDX files in their manifest files.").default(false).hideHelp()).version(version3).configureHelp({ sortOptions: true }).action(async (path9, options) => {
|
|
252080
|
+
run2.name("run").argument("<path>", "File system path to folder containing the project").option("-o, --output-dir <path>", "Write json report to <path>/coana-report.json").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).option("-p, --print-report", "Print the report to the console", false).option("--offline-database <path>", "Path to a coana-offline-db.json file for running the CLI without internet connectivity", void 0).option("-t, --timeout <timeout>", "Set API <timeout> in milliseconds to Coana backend.", "300000").option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available. NPM reachability analysis does not support concurrent execution, so the concurrency level is ignored for NPM.", "1").option("--api-key <key>", "Set the Coana dashboard API key. By setting you also enable the dashboard integration.").addOption(new Option("--write-report-to-file", "Write the report dashboard-compatible report to dashboard-report.json. This report may help the Coana team debug issues with the report insertion mechanism.").default(false).hideHelp()).option("--project-name <repoName>", "Set the name of the repository. Used for dashboard integration.").option("--repo-url <repoUrl>", "Set the URL of the repository. Used for dashboard integration.").option("--include-dirs <relativeDirs...>", "globs for directories to include from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, projects that are not included may still be scanned if they are referenced from included projects.").option("--exclude-dirs <relativeDirs...>", "globs for directories to exclude from the detection of subprojects (space-separated)(use relative paths from the project root). Notice, excluded projects may still be scanned if they are referenced from non-excluded projects.").option("--disable-analysis-splitting", "Limits Coana to at most 1 reachability analysis run per workspace").option("--print-analysis-log-file", "Store log output from the JavaScript/TypeScript reachability analysis in the file js-analysis.log file in the root of each workspace", false).option("--entry-points <entryPoints...>", "List of files to analyze for root workspace. The reachability analysis automatically analyzes all files used by the entry points. If not provided, all JavaScript and TypeScript files are considered entry points. For non-root workspaces, all JavaScript and TypeScript files are analyzed as well.").option("--include-projects-with-no-reachability-support", "Also runs Coana on projects where we support traditional SCA, but does not yet support reachability analysis.", false).option("--ecosystems <ecosystems...>", "List of ecosystems to analyze (space-separated). Currently NPM, PIP, MAVEN, NUGET and GO are supported. Default is all supported ecosystems.").addOption(new Option("--purl-types <purlTypes...>", "List of PURL types to analyze (space-separated). Currently npm, pypi, maven, nuget, golang and cargo are supported. Default is all supported purl types.").hideHelp()).option("--changed-files <files...>", "List of files that have changed. If provided, Coana only analyzes workspaces and modules that contain changed files.").option("--disable-report-submission", "Disable the submission of the report to the Coana dashboard. Used by the pipeline blocking feature.", false).option("--disable-analytics-sharing", "Disable analytics sharing.", false).option("--provider-project <path>", "File system path to folder containing the provider project (Only supported for Maven, Gradle, and SBT)").option("--provider-workspaces <dirs...>", "List of workspaces that build the provided runtime environment (Only supported for Maven, Gradle, and SBT)", (paths) => paths.split(" ")).option("--lightweight-reachability", "Runs Coana in lightweight mode. This increases analysis speed but also raises the risk of Coana misclassifying the reachability of certain complex vulnerabilities. Recommended only for use with Coana Guardrail mode.", false).addOption(new Option("--run-without-docker", "Run package managers and reachability analyzers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new Option("--run-env <env>", "Specifies the environment in which the CLI is run. So far only MANAGED_SCAN and UNKNOWN are supported.").default("UNKNOWN").choices(["UNKNOWN", "MANAGED_SCAN"]).hideHelp()).addOption(new Option("--guardrail-mode", "Run Coana in guardrail mode. This mode is used to prevent new reachable vulnerabilities from being introduced into the codebase. Usually run as a CI check when pushing new commits to a pull request.")).option("--ignore-failing-workspaces", "Continue processing when a workspace fails instead of exiting. Failed workspaces will be logged at termination.", false).addOption(new Option("--socket-mode <output-file>", "Run Coana in socket mode and write report to <output-file>").hideHelp()).addOption(new Option("--manifests-tar-hash <hash>", "Hash of the tarball containing all manifest files already uploaded to Socket. If provided, Socket will be used for computing dependency trees.").hideHelp()).option("--skip-cache-usage", "Do not attempt to use cached analysis configuration from previous runs", false).option("--lazy-mode", "Enable lazy analysis mode for JavaScript/TypeScript. This can significantly speed up analysis by only analyzing code that is actually relevant for the vulnerabilities being analyzed.", false).addOption(new Option("--min-severity <severity>", "Set the minimum severity of vulnerabilities to analyze. Supported severities are info, low, moderate, high and critical.").choices(["info", "INFO", "low", "LOW", "moderate", "MODERATE", "high", "HIGH", "critical", "CRITICAL"])).option("--use-unreachable-from-precomputation", "Skip the reachability analysis for vulnerabilities that are already known to be unreachable from the precomputed reachability analysis (Tier 2).", false).addOption(new Option("--use-only-pregenerated-sboms", "Only include artifacts that have CDX or SPDX files in their manifest files.").default(false).hideHelp()).version(version3).configureHelp({ sortOptions: true }).action(async (path9, options) => {
|
|
252031
252081
|
process.env.DOCKER_IMAGE_TAG ??= version3;
|
|
252032
252082
|
options.ecosystems = options.ecosystems?.map((e) => e.toUpperCase());
|
|
252033
252083
|
options.minSeverity = options.minSeverity?.toUpperCase();
|
package/package.json
CHANGED
|
@@ -76299,7 +76299,7 @@ var Spinner = class _Spinner {
|
|
|
76299
76299
|
// ../utils/src/logging/socket-transport.ts
|
|
76300
76300
|
var import_winston_transport = __toESM(require_winston_transport2(), 1);
|
|
76301
76301
|
import { Socket } from "net";
|
|
76302
|
-
var SocketTransport = class extends import_winston_transport.default {
|
|
76302
|
+
var SocketTransport = class _SocketTransport extends import_winston_transport.default {
|
|
76303
76303
|
socket = null;
|
|
76304
76304
|
socketPath;
|
|
76305
76305
|
context;
|
|
@@ -76307,6 +76307,11 @@ var SocketTransport = class extends import_winston_transport.default {
|
|
|
76307
76307
|
connected = false;
|
|
76308
76308
|
messageQueue = [];
|
|
76309
76309
|
reconnectTimer = null;
|
|
76310
|
+
lastActivityTime = 0;
|
|
76311
|
+
// Maximum number of messages to queue during reconnection
|
|
76312
|
+
static MAX_QUEUE_SIZE = 1e3;
|
|
76313
|
+
// After this much idle time, proactively reconnect before sending to avoid stale connections
|
|
76314
|
+
static STALE_CONNECTION_THRESHOLD_MS = 3e4;
|
|
76310
76315
|
constructor(options) {
|
|
76311
76316
|
super(options);
|
|
76312
76317
|
this.socketPath = options.socketPath;
|
|
@@ -76328,7 +76333,7 @@ var SocketTransport = class extends import_winston_transport.default {
|
|
|
76328
76333
|
processVariant: this.processVariant,
|
|
76329
76334
|
startTime: Date.now()
|
|
76330
76335
|
};
|
|
76331
|
-
this.
|
|
76336
|
+
this.sendMessageDirect(handshake);
|
|
76332
76337
|
this.flushQueue();
|
|
76333
76338
|
});
|
|
76334
76339
|
this.socket.on("error", () => {
|
|
@@ -76351,23 +76356,70 @@ var SocketTransport = class extends import_winston_transport.default {
|
|
|
76351
76356
|
}, 1e3);
|
|
76352
76357
|
this.reconnectTimer.unref();
|
|
76353
76358
|
}
|
|
76359
|
+
/**
|
|
76360
|
+
* Check if the connection might be stale due to inactivity.
|
|
76361
|
+
* After a long idle period, the connection may have died without us knowing.
|
|
76362
|
+
*/
|
|
76363
|
+
isConnectionPotentiallyStale() {
|
|
76364
|
+
if (!this.connected || this.lastActivityTime === 0) {
|
|
76365
|
+
return false;
|
|
76366
|
+
}
|
|
76367
|
+
const idleTime = Date.now() - this.lastActivityTime;
|
|
76368
|
+
return idleTime > _SocketTransport.STALE_CONNECTION_THRESHOLD_MS;
|
|
76369
|
+
}
|
|
76370
|
+
/**
|
|
76371
|
+
* Queue a message for sending. If connected, sends immediately.
|
|
76372
|
+
* If not connected, queues for later (with size limit).
|
|
76373
|
+
*/
|
|
76354
76374
|
sendMessage(message) {
|
|
76375
|
+
const serialized = JSON.stringify(message) + "\n";
|
|
76376
|
+
if (this.isConnectionPotentiallyStale()) {
|
|
76377
|
+
this.connected = false;
|
|
76378
|
+
if (this.messageQueue.length < _SocketTransport.MAX_QUEUE_SIZE) {
|
|
76379
|
+
this.messageQueue.push(serialized);
|
|
76380
|
+
}
|
|
76381
|
+
if (this.socket) {
|
|
76382
|
+
this.socket.destroy();
|
|
76383
|
+
}
|
|
76384
|
+
return;
|
|
76385
|
+
}
|
|
76386
|
+
if (!this.socket || !this.connected) {
|
|
76387
|
+
if (this.messageQueue.length < _SocketTransport.MAX_QUEUE_SIZE) {
|
|
76388
|
+
this.messageQueue.push(serialized);
|
|
76389
|
+
}
|
|
76390
|
+
this.scheduleReconnect();
|
|
76391
|
+
return;
|
|
76392
|
+
}
|
|
76393
|
+
this.writeToSocket(serialized);
|
|
76394
|
+
}
|
|
76395
|
+
/**
|
|
76396
|
+
* Send a message directly without queueing (used for handshake).
|
|
76397
|
+
*/
|
|
76398
|
+
sendMessageDirect(message) {
|
|
76355
76399
|
if (!this.socket || !this.connected) {
|
|
76356
76400
|
return;
|
|
76357
76401
|
}
|
|
76358
76402
|
const serialized = JSON.stringify(message) + "\n";
|
|
76359
|
-
this.
|
|
76403
|
+
this.writeToSocket(serialized);
|
|
76404
|
+
}
|
|
76405
|
+
/**
|
|
76406
|
+
* Write data to socket with error handling.
|
|
76407
|
+
* Note: On write error, the socket will emit 'error' event which triggers reconnect.
|
|
76408
|
+
*/
|
|
76409
|
+
writeToSocket(data2) {
|
|
76410
|
+
if (!this.socket) return;
|
|
76411
|
+
this.socket.write(data2, (error) => {
|
|
76360
76412
|
if (error) {
|
|
76361
76413
|
this.connected = false;
|
|
76414
|
+
} else {
|
|
76415
|
+
this.lastActivityTime = Date.now();
|
|
76362
76416
|
}
|
|
76363
76417
|
});
|
|
76364
76418
|
}
|
|
76365
76419
|
flushQueue() {
|
|
76366
76420
|
while (this.messageQueue.length > 0 && this.connected) {
|
|
76367
76421
|
const message = this.messageQueue.shift();
|
|
76368
|
-
|
|
76369
|
-
this.socket.write(message);
|
|
76370
|
-
}
|
|
76422
|
+
this.writeToSocket(message);
|
|
76371
76423
|
}
|
|
76372
76424
|
}
|
|
76373
76425
|
log(info, callback) {
|
|
@@ -110460,13 +110512,14 @@ async function runJellyAnalysis(mainProjectRoot, projectRoot, jellyOptions, reac
|
|
|
110460
110512
|
const affectedPackagesFile = resolve14(tmpFolder, "affected-packages.json");
|
|
110461
110513
|
const logFile = reachabilityAnalysisOptions.analysisLogFile ?? (reachabilityAnalysisOptions.printLogFile && resolve14(projectRoot, "js-analysis.log"));
|
|
110462
110514
|
await writeFile6(vulnerabilitiesFile, JSON.stringify(vulnerabilitiesInJellyFormat));
|
|
110515
|
+
const useLazy = experiment === "LAZY_EXPERIMENT" || reachabilityAnalysisOptions.lazy;
|
|
110463
110516
|
const jellyCmd = cmdt`
|
|
110464
110517
|
${await getNodeExecutable(ToolPathResolver.nodeExecutablePath)} --max-old-space-size=${reachabilityAnalysisOptions.memoryLimitInMB ?? 8192}
|
|
110465
110518
|
${jellyExecutable}
|
|
110466
110519
|
--basedir ${mainProjectRoot}
|
|
110467
110520
|
--timeout ${timeoutInSeconds}
|
|
110468
110521
|
--vulnerabilities ${vulnerabilitiesFile}
|
|
110469
|
-
${
|
|
110522
|
+
${useLazy && ["--lazy", "--lazy-cleanup"]}
|
|
110470
110523
|
--reachable-json ${affectedPackagesFile}
|
|
110471
110524
|
${getExcludes(mainProjectRoot, projectRoot, reachabilityAnalysisOptions)}
|
|
110472
110525
|
--diagnostics-json ${diagnosticsFile}
|
|
@@ -110482,10 +110535,8 @@ async function runJellyAnalysis(mainProjectRoot, projectRoot, jellyOptions, reac
|
|
|
110482
110535
|
await runCommandResolveStdOut2(
|
|
110483
110536
|
jellyCmd,
|
|
110484
110537
|
void 0,
|
|
110485
|
-
//
|
|
110486
|
-
|
|
110487
|
-
// Use SIGKILL to ensure termination even if the process is unresponsive (e.g., due to GC pressure).
|
|
110488
|
-
{ timeout: timeoutInSeconds * 1e3 * (experiment ? 1.5 : 3), killSignal: "SIGKILL" }
|
|
110538
|
+
// Use SIGKILL to ensure termination even if the process is unresponsive 50% above the timeout (e.g., due to GC pressure).
|
|
110539
|
+
{ timeout: timeoutInSeconds * 1e3 * 1.5, killSignal: "SIGKILL" }
|
|
110489
110540
|
);
|
|
110490
110541
|
if (reachabilityAnalysisOptions.printLogFile)
|
|
110491
110542
|
logger.info("JS analysis log file:", await readFile8(logFile, "utf-8"));
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|