@socketsecurity/cli-with-sentry 1.0.38 → 1.0.39

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
@@ -3826,6 +3826,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
3826
3826
  cwd,
3827
3827
  limit,
3828
3828
  minSatisfying,
3829
+ noPrCheck,
3829
3830
  rangeStyle,
3830
3831
  spinner,
3831
3832
  test,
@@ -3913,6 +3914,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
3913
3914
  if (!packument) {
3914
3915
  logger.logger.warn(`Unexpected condition: No packument found for ${name}.\n`);
3915
3916
  cleanupInfoEntriesLoop();
3917
+ // Skip to next package.
3916
3918
  continue infoEntriesLoop;
3917
3919
  }
3918
3920
  const availableVersions = Object.keys(packument.versions);
@@ -3953,8 +3955,8 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
3953
3955
  const oldVersions = arrays.arrayUnique(shadowNpmInject.findPackageNodes(actualTree, name).map(n => n.version).filter(Boolean));
3954
3956
  if (!oldVersions.length) {
3955
3957
  debug.debugFn('notice', `skip: ${name} not found\n`);
3956
- // Skip to next package.
3957
3958
  cleanupInfoEntriesLoop();
3959
+ // Skip to next package.
3958
3960
  continue infoEntriesLoop;
3959
3961
  }
3960
3962
 
@@ -3964,6 +3966,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
3964
3966
  const editablePkgJson = await packages.readPackageJson(pkgJsonPath, {
3965
3967
  editable: true
3966
3968
  });
3969
+ const seenBranches = new Set();
3967
3970
  const seenVersions = new Set();
3968
3971
  let hasAnnouncedWorkspace = false;
3969
3972
  let workspaceLogCallCount = logger.logger.logCallCount;
@@ -4001,23 +4004,20 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
4001
4004
  continue infosLoop;
4002
4005
  }
4003
4006
  const branch = getSocketBranchName(oldPurl, newVersion, workspace);
4004
- const pr = prs.find(p => p.headRefName === branch);
4007
+ if (seenBranches.has(newVersion)) {
4008
+ continue infosLoop;
4009
+ }
4010
+ const pr = noPrCheck ? undefined : prs.find(p => p.headRefName === branch);
4005
4011
  if (pr) {
4006
4012
  debug.debugFn('notice', `skip: PR #${pr.number} for ${name} exists`);
4007
- if (++count >= limit) {
4008
- cleanupInfoEntriesLoop();
4009
- break infoEntriesLoop;
4010
- }
4013
+ seenBranches.add(branch);
4011
4014
  continue infosLoop;
4012
4015
  }
4013
4016
  if (fixEnv.isCi && (
4014
4017
  // eslint-disable-next-line no-await-in-loop
4015
4018
  await gitRemoteBranchExists(branch, cwd))) {
4016
4019
  debug.debugFn('notice', `skip: remote branch "${branch}" exists`);
4017
- if (++count >= limit) {
4018
- cleanupInfoEntriesLoop();
4019
- break infoEntriesLoop;
4020
- }
4020
+ seenBranches.add(branch);
4021
4021
  continue infosLoop;
4022
4022
  }
4023
4023
  const {
@@ -4134,6 +4134,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
4134
4134
  // Exit early if install fails.
4135
4135
  return handleInstallFail();
4136
4136
  }
4137
+ seenBranches.add(branch);
4137
4138
 
4138
4139
  // eslint-disable-next-line no-await-in-loop
4139
4140
  await Promise.allSettled([setGitRemoteGithubRepoUrl(fixEnv.repoInfo.owner, fixEnv.repoInfo.repo, fixEnv.githubToken, cwd), cleanupPrs(fixEnv.repoInfo.owner, fixEnv.repoInfo.repo, {
@@ -4225,6 +4226,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
4225
4226
  debug.debugFn('notice', 'increment: count', count + 1);
4226
4227
  if (++count >= limit) {
4227
4228
  cleanupInfoEntriesLoop();
4229
+ // Exit main loop.
4228
4230
  break infoEntriesLoop;
4229
4231
  }
4230
4232
  }
@@ -4551,6 +4553,7 @@ async function handleFix({
4551
4553
  ghsas,
4552
4554
  limit,
4553
4555
  minSatisfying,
4556
+ noPrCheck,
4554
4557
  outputKind,
4555
4558
  purls,
4556
4559
  rangeStyle,
@@ -4646,6 +4649,7 @@ async function handleFix({
4646
4649
  cwd,
4647
4650
  limit,
4648
4651
  minSatisfying,
4652
+ noPrCheck,
4649
4653
  purls,
4650
4654
  rangeStyle,
4651
4655
  spinner,
@@ -4695,6 +4699,12 @@ const config$H = {
4695
4699
  default: false,
4696
4700
  description: 'Constrain dependency updates to the minimum satisfying version'
4697
4701
  },
4702
+ noPrCheck: {
4703
+ type: 'boolean',
4704
+ default: false,
4705
+ description: 'Skip PR existence check',
4706
+ hidden: true
4707
+ },
4698
4708
  purl: {
4699
4709
  type: 'string',
4700
4710
  default: [],
@@ -4800,6 +4810,7 @@ async function run$H(argv, importMeta, {
4800
4810
  const limit = (cli.flags['limit'] ? parseInt(String(cli.flags['limit'] || ''), 10) : Infinity) || Infinity;
4801
4811
  const maxSatisfying = Boolean(cli.flags['maxSatisfying']);
4802
4812
  const minSatisfying = Boolean(cli.flags['minSatisfying']) || !maxSatisfying;
4813
+ const noPrCheck = Boolean(cli.flags['noPrCheck']);
4803
4814
  const purls = utils.cmdFlagValueToArray(cli.flags['purl']);
4804
4815
  const testScript = String(cli.flags['testScript'] || 'test');
4805
4816
  await handleFix({
@@ -4808,6 +4819,7 @@ async function run$H(argv, importMeta, {
4808
4819
  ghsas,
4809
4820
  limit,
4810
4821
  minSatisfying,
4822
+ noPrCheck,
4811
4823
  outputKind,
4812
4824
  purls,
4813
4825
  rangeStyle,
@@ -14293,5 +14305,5 @@ void (async () => {
14293
14305
  await utils.captureException(e);
14294
14306
  }
14295
14307
  })();
14296
- //# debugId=cb6e977b-e9db-4f34-bf64-f5a47c14882c
14308
+ //# debugId=87862000-d157-410a-ab83-7488bd4cfc60
14297
14309
  //# sourceMappingURL=cli.js.map