@socketsecurity/cli-with-sentry 1.0.104 → 1.0.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1626,16 +1626,18 @@ async function performReachabilityAnalysis(options) {
1626
1626
  // Build Coana arguments.
1627
1627
  const coanaArgs = ['run', cwd, '--output-dir', cwd, '--socket-mode', constants.DOT_SOCKET_DOT_FACTS_JSON, '--disable-report-submission', ...(reachabilityOptions.reachAnalysisTimeout ? ['--analysis-timeout', `${reachabilityOptions.reachAnalysisTimeout}`] : []), ...(reachabilityOptions.reachAnalysisMemoryLimit ? ['--memory-limit', `${reachabilityOptions.reachAnalysisMemoryLimit}`] : []), ...(reachabilityOptions.reachDisableAnalytics ? ['--disable-analytics-sharing'] : []), ...(tarHash ? ['--run-without-docker', '--manifests-tar-hash', tarHash] : []),
1628
1628
  // Empty reachEcosystems implies scanning all ecosystems.
1629
- ...(reachabilityOptions.reachEcosystems.length ? ['--purl-types', ...reachabilityOptions.reachEcosystems] : []), ...(reachabilityOptions.reachExcludePaths.length ? ['--exclude-dirs', ...reachabilityOptions.reachExcludePaths] : [])];
1629
+ ...(reachabilityOptions.reachEcosystems.length ? ['--purl-types', ...reachabilityOptions.reachEcosystems] : []), ...(reachabilityOptions.reachExcludePaths.length ? ['--exclude-dirs', ...reachabilityOptions.reachExcludePaths] : []), ...(reachabilityOptions.reachSkipCache ? ['--skip-cache-usage'] : [])];
1630
1630
 
1631
1631
  // Build environment variables.
1632
1632
  const env = {
1633
1633
  ...process.env
1634
1634
  };
1635
- if (repoName) {
1635
+ // do not pass default repo and branch name to coana to avoid mixing
1636
+ // buckets (cached configuration) from projects that are likely very different.
1637
+ if (repoName && repoName !== constants.SOCKET_DEFAULT_REPOSITORY) {
1636
1638
  env['SOCKET_REPO_NAME'] = repoName;
1637
1639
  }
1638
- if (branchName) {
1640
+ if (branchName && branchName !== constants.SOCKET_DEFAULT_BRANCH) {
1639
1641
  env['SOCKET_BRANCH_NAME'] = branchName;
1640
1642
  }
1641
1643
 
@@ -2324,6 +2326,7 @@ async function handleCi(autoManifest) {
2324
2326
  reachDisableAnalytics: false,
2325
2327
  reachEcosystems: [],
2326
2328
  reachExcludePaths: [],
2329
+ reachSkipCache: false,
2327
2330
  runReachabilityAnalysis: false
2328
2331
  },
2329
2332
  repoName,
@@ -3888,7 +3891,7 @@ async function coanaFix(fixConfig) {
3888
3891
  }
3889
3892
  };
3890
3893
  }
3891
- const fixCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3894
+ const fixCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3892
3895
  cwd,
3893
3896
  spinner
3894
3897
  });
@@ -3902,7 +3905,7 @@ async function coanaFix(fixConfig) {
3902
3905
  }
3903
3906
  let ids;
3904
3907
  if (isAll) {
3905
- const foundCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3908
+ const foundCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3906
3909
  cwd,
3907
3910
  spinner
3908
3911
  });
@@ -5129,6 +5132,7 @@ async function handleFix({
5129
5132
  ghsas,
5130
5133
  limit,
5131
5134
  orgSlug,
5135
+ rangeStyle,
5132
5136
  spinner,
5133
5137
  unknownFlags
5134
5138
  }), outputKind);
@@ -11405,6 +11409,11 @@ const reachabilityFlags = {
11405
11409
  type: 'string',
11406
11410
  isMultiple: true,
11407
11411
  description: 'List of paths to exclude from reachability analysis, as either a comma separated value or as multiple flags.'
11412
+ },
11413
+ reachSkipCache: {
11414
+ type: 'boolean',
11415
+ default: false,
11416
+ description: 'Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous runs to speed up the analysis.'
11408
11417
  }
11409
11418
  };
11410
11419
 
@@ -11604,6 +11613,7 @@ async function run$c(argv, importMeta, {
11604
11613
  reachAnalysisMemoryLimit,
11605
11614
  reachAnalysisTimeout,
11606
11615
  reachDisableAnalytics,
11616
+ reachSkipCache,
11607
11617
  readOnly,
11608
11618
  setAsAlertsPage: pendingHeadFlag,
11609
11619
  tmp
@@ -11729,7 +11739,7 @@ async function run$c(argv, importMeta, {
11729
11739
  const isUsingNonDefaultMemoryLimit = reachAnalysisMemoryLimit !== reachabilityFlags['reachAnalysisMemoryLimit']?.default;
11730
11740
  const isUsingNonDefaultTimeout = reachAnalysisTimeout !== reachabilityFlags['reachAnalysisTimeout']?.default;
11731
11741
  const isUsingNonDefaultAnalytics = reachDisableAnalytics !== reachabilityFlags['reachDisableAnalytics']?.default;
11732
- const isUsingAnyReachabilityFlags = isUsingNonDefaultMemoryLimit || isUsingNonDefaultTimeout || isUsingNonDefaultAnalytics || hasReachEcosystems || hasReachExcludePaths;
11742
+ const isUsingAnyReachabilityFlags = isUsingNonDefaultMemoryLimit || isUsingNonDefaultTimeout || isUsingNonDefaultAnalytics || hasReachEcosystems || hasReachExcludePaths || reachSkipCache;
11733
11743
  const wasValidInput = utils.checkCommandInput(outputKind, {
11734
11744
  nook: true,
11735
11745
  test: !!orgSlug,
@@ -11791,7 +11801,8 @@ async function run$c(argv, importMeta, {
11791
11801
  reachAnalysisTimeout: Number(reachAnalysisTimeout),
11792
11802
  reachAnalysisMemoryLimit: Number(reachAnalysisMemoryLimit),
11793
11803
  reachEcosystems,
11794
- reachExcludePaths
11804
+ reachExcludePaths,
11805
+ reachSkipCache: Boolean(reachSkipCache)
11795
11806
  },
11796
11807
  readOnly: Boolean(readOnly),
11797
11808
  repoName,
@@ -12438,7 +12449,8 @@ async function scanOneRepo(repoSlug, {
12438
12449
  reachAnalysisTimeout: 0,
12439
12450
  reachAnalysisMemoryLimit: 0,
12440
12451
  reachEcosystems: [],
12441
- reachExcludePaths: []
12452
+ reachExcludePaths: [],
12453
+ reachSkipCache: false
12442
12454
  },
12443
12455
  readOnly: false,
12444
12456
  repoName: repoSlug,
@@ -13668,7 +13680,8 @@ async function run$6(argv, importMeta, {
13668
13680
  org: orgFlag,
13669
13681
  reachAnalysisMemoryLimit,
13670
13682
  reachAnalysisTimeout,
13671
- reachDisableAnalytics
13683
+ reachDisableAnalytics,
13684
+ reachSkipCache
13672
13685
  } = cli.flags;
13673
13686
  const dryRun = !!cli.flags['dryRun'];
13674
13687
 
@@ -13732,7 +13745,8 @@ async function run$6(argv, importMeta, {
13732
13745
  reachAnalysisMemoryLimit: Number(reachAnalysisMemoryLimit),
13733
13746
  reachDisableAnalytics: Boolean(reachDisableAnalytics),
13734
13747
  reachEcosystems,
13735
- reachExcludePaths
13748
+ reachExcludePaths,
13749
+ reachSkipCache: Boolean(reachSkipCache)
13736
13750
  }
13737
13751
  });
13738
13752
  }
@@ -15523,5 +15537,5 @@ void (async () => {
15523
15537
  await utils.captureException(e);
15524
15538
  }
15525
15539
  })();
15526
- //# debugId=3c044a06-e0dd-4f21-8310-181cc22dc4c0
15540
+ //# debugId=c64e79fd-76d1-44bb-917b-fff778650c74
15527
15541
  //# sourceMappingURL=cli.js.map