@postman-cse/onboarding-repo-sync 2.6.3 → 2.6.5

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/index.cjs CHANGED
@@ -138442,8 +138442,8 @@ var PostmanGatewayAssetsClient = class {
138442
138442
  return { candidates, nameOnlyMatchCount: nameOnly.length, nameOnlyEnvironments };
138443
138443
  }
138444
138444
  /**
138445
- * Rebind the sole same-name monitor in this workspace onto the current
138446
- * collection UID.
138445
+ * Replace the sole same-name monitor in this workspace when its collection
138446
+ * UID changed.
138447
138447
  *
138448
138448
  * The canonical Smoke collection can legitimately change UID (a bootstrap
138449
138449
  * re-import after a marker/stranger miss, or an operator rebuild). The
@@ -138451,13 +138451,18 @@ var PostmanGatewayAssetsClient = class {
138451
138451
  * (which requires the full collection+environment+name triple) misses and a
138452
138452
  * second monitor with the same name would be created on every run, orphaning
138453
138453
  * the old one. Name plus environment is the stable identity across a
138454
- * collection re-import, so recover it here instead.
138454
+ * collection re-import, so recover it here instead. Monitoring API does not
138455
+ * allow `collection` in a jobTemplate update body, so replacement is the
138456
+ * supported mutation: create or adopt the desired monitor first, then delete
138457
+ * the stale monitor. This order preserves the existing monitor if creation
138458
+ * fails and never deletes the only usable monitor before its replacement
138459
+ * exists.
138455
138460
  *
138456
138461
  * Returns null when nothing needs rebinding (no same-name monitor, or it is
138457
138462
  * already bound to this collection). Refuses to guess when several same-name
138458
138463
  * monitors match, matching `selectExactMatch` semantics elsewhere.
138459
138464
  */
138460
- async rebindMonitorByName(name, collectionUid, environmentUid) {
138465
+ async rebindMonitorByName(name, collectionUid, environmentUid, cronSchedule) {
138461
138466
  const monitorName = String(name ?? "").trim();
138462
138467
  const collection = String(collectionUid ?? "").trim();
138463
138468
  const environment = String(environmentUid ?? "").trim();
@@ -138489,16 +138494,19 @@ var PostmanGatewayAssetsClient = class {
138489
138494
  if (match.collectionUid === collection) {
138490
138495
  return null;
138491
138496
  }
138492
- await this.gateway.requestJson(
138493
- {
138494
- service: "monitors",
138495
- method: "put",
138496
- path: `/jobTemplates/${this.toModelId(match.uid)}?_etc=true`,
138497
- body: { collection }
138498
- },
138499
- { retryTransient: false }
138497
+ const replacementUid = await this.createMonitor(
138498
+ this.workspaceId,
138499
+ monitorName,
138500
+ collection,
138501
+ environment,
138502
+ cronSchedule
138500
138503
  );
138501
- return { uid: match.uid, previousCollectionUid: match.collectionUid };
138504
+ await this.deleteMonitor(match.uid);
138505
+ return {
138506
+ uid: replacementUid,
138507
+ previousUid: match.uid,
138508
+ previousCollectionUid: match.collectionUid
138509
+ };
138502
138510
  }
138503
138511
  async runMonitor(uid) {
138504
138512
  await this.gateway.requestJson(
@@ -140570,6 +140578,10 @@ var PREBUILT_COLLECTION_ROLES = /* @__PURE__ */ new Set([
140570
140578
  ]);
140571
140579
  var SHA256_HEX = /^[a-f0-9]{64}$/;
140572
140580
  var PREBUILT_CLOUD_ID = /^[A-Za-z0-9][A-Za-z0-9._:-]*$/;
140581
+ var PREBUILT_COLLECTION_MAX_DEPTH = 128;
140582
+ var PREBUILT_COLLECTION_MAX_TRAVERSAL_ENTRIES = LOCAL_SPEC_DISCOVERY_MAX_TRAVERSAL_ENTRIES;
140583
+ var PREBUILT_COLLECTION_MAX_FILE_BYTES = 32 * 1024 * 1024;
140584
+ var PREBUILT_COLLECTION_MAX_TOTAL_BYTES = 100 * 1024 * 1024;
140573
140585
  function failPrebuiltCollections(detail) {
140574
140586
  throw new Error(`CONTRACT_PREBUILT_COLLECTIONS_INVALID: ${detail}`);
140575
140587
  }
@@ -140681,8 +140693,9 @@ function assertPathWithinArtifactRoot(targetPath, artifactDir, fieldName) {
140681
140693
  existingPath = parent;
140682
140694
  }
140683
140695
  const realExisting = (0, import_node_fs5.realpathSync)(existingPath);
140684
- const realRelative = path8.relative(artifactRoot, realExisting);
140685
- if (realRelative.startsWith("..") || path8.isAbsolute(realRelative)) {
140696
+ const realArtifactRoot = (0, import_node_fs5.existsSync)(artifactRoot) ? (0, import_node_fs5.realpathSync)(artifactRoot) : void 0;
140697
+ const realRelative = realArtifactRoot ? path8.relative(realArtifactRoot, realExisting) : "";
140698
+ if (realArtifactRoot && (realRelative.startsWith("..") || path8.isAbsolute(realRelative))) {
140686
140699
  failPrebuiltCollections(
140687
140700
  `${fieldName} resolves outside artifact-dir via symlink; received ${targetPath}`
140688
140701
  );
@@ -140724,13 +140737,16 @@ function listPrebuiltCollectionTreeFiles(collectionPath, artifactDir) {
140724
140737
  return [];
140725
140738
  }
140726
140739
  const files = [];
140727
- const pendingDirectories = [absRoot];
140740
+ const pendingDirectories = [{ absolute: absRoot, depth: 0 }];
140728
140741
  const seenDirectories = /* @__PURE__ */ new Set();
140742
+ let traversalEntries = 1;
140743
+ let totalBytes = 0;
140729
140744
  while (pendingDirectories.length > 0) {
140730
- const currentAbsolute = pendingDirectories.pop();
140731
- if (!currentAbsolute) {
140745
+ const current = pendingDirectories.pop();
140746
+ if (!current) {
140732
140747
  break;
140733
140748
  }
140749
+ const { absolute: currentAbsolute, depth: currentDepth } = current;
140734
140750
  const currentStat = (0, import_node_fs5.lstatSync)(currentAbsolute);
140735
140751
  if (currentStat.isSymbolicLink() || !currentStat.isDirectory()) {
140736
140752
  failPrebuiltCollections(
@@ -140744,8 +140760,16 @@ function listPrebuiltCollectionTreeFiles(collectionPath, artifactDir) {
140744
140760
  );
140745
140761
  }
140746
140762
  seenDirectories.add(currentKey);
140747
- const entries = (0, import_node_fs5.readdirSync)(currentAbsolute, { withFileTypes: true });
140763
+ const entries = (0, import_node_fs5.readdirSync)(currentAbsolute, { withFileTypes: true }).sort(
140764
+ (left, right) => left.name.localeCompare(right.name)
140765
+ );
140748
140766
  for (const entry of entries) {
140767
+ traversalEntries += 1;
140768
+ if (traversalEntries > PREBUILT_COLLECTION_MAX_TRAVERSAL_ENTRIES) {
140769
+ failPrebuiltCollections(
140770
+ `prebuilt collection tree exceeded the ${PREBUILT_COLLECTION_MAX_TRAVERSAL_ENTRIES} traversal-entry budget`
140771
+ );
140772
+ }
140749
140773
  const abs = path8.join(currentAbsolute, entry.name);
140750
140774
  if (entry.isSymbolicLink()) {
140751
140775
  failPrebuiltCollections(
@@ -140753,7 +140777,13 @@ function listPrebuiltCollectionTreeFiles(collectionPath, artifactDir) {
140753
140777
  );
140754
140778
  }
140755
140779
  if (entry.isDirectory()) {
140756
- pendingDirectories.push(abs);
140780
+ const nextDepth = currentDepth + 1;
140781
+ if (nextDepth > PREBUILT_COLLECTION_MAX_DEPTH) {
140782
+ failPrebuiltCollections(
140783
+ `prebuilt collection tree exceeded the ${PREBUILT_COLLECTION_MAX_DEPTH} directory-depth budget`
140784
+ );
140785
+ }
140786
+ pendingDirectories.push({ absolute: abs, depth: nextDepth });
140757
140787
  continue;
140758
140788
  }
140759
140789
  if (!entry.isFile()) {
@@ -140767,6 +140797,17 @@ function listPrebuiltCollectionTreeFiles(collectionPath, artifactDir) {
140767
140797
  `prebuilt collection tree file changed or became unsupported at ${normalizeToPosix(path8.relative(absRoot, abs))}`
140768
140798
  );
140769
140799
  }
140800
+ if (fileLstat.size > PREBUILT_COLLECTION_MAX_FILE_BYTES) {
140801
+ failPrebuiltCollections(
140802
+ `prebuilt collection tree file ${normalizeToPosix(path8.relative(absRoot, abs))} exceeds the ${PREBUILT_COLLECTION_MAX_FILE_BYTES / (1024 * 1024)} MiB individual-file budget`
140803
+ );
140804
+ }
140805
+ totalBytes += fileLstat.size;
140806
+ if (totalBytes > PREBUILT_COLLECTION_MAX_TOTAL_BYTES) {
140807
+ failPrebuiltCollections(
140808
+ `prebuilt collection tree exceeded the ${PREBUILT_COLLECTION_MAX_TOTAL_BYTES / (1024 * 1024)} MiB total-byte budget`
140809
+ );
140810
+ }
140770
140811
  files.push({
140771
140812
  absolute: abs,
140772
140813
  relative: normalizeToPosix(path8.relative(absRoot, abs)),
@@ -140901,63 +140942,69 @@ async function preparePrivateMockCloudCollection(role, collectionId, postman) {
140901
140942
  }
140902
140943
  return collection;
140903
140944
  }
140945
+ var ARTIFACT_ACQUISITION_WIDTH = 2;
140946
+ async function runBoundedInOrder(items, width, worker) {
140947
+ const results = new Array(items.length);
140948
+ let nextIndex = 0;
140949
+ const failures = /* @__PURE__ */ new Map();
140950
+ const runWorker = async () => {
140951
+ while (failures.size === 0 && nextIndex < items.length) {
140952
+ const index = nextIndex;
140953
+ nextIndex += 1;
140954
+ try {
140955
+ results[index] = await worker(items[index], index);
140956
+ } catch (error2) {
140957
+ failures.set(index, error2);
140958
+ return;
140959
+ }
140960
+ }
140961
+ };
140962
+ await Promise.all(Array.from({ length: Math.min(width, items.length) }, () => runWorker()));
140963
+ const failedIndex = Math.min(...failures.keys());
140964
+ if (Number.isFinite(failedIndex)) {
140965
+ throw failures.get(failedIndex);
140966
+ }
140967
+ return results;
140968
+ }
140969
+ async function acquireCollectionArtifact(options) {
140970
+ const { role, collectionId, dirName, collectionsDir, prebuiltByRole, postman, core, privateMockAuth = false } = options;
140971
+ const expectedPath = `${collectionsDir}/${dirName}`;
140972
+ const forceCloudExport = privateMockAuth && (role === "smoke" || role === "contract");
140973
+ const entry = prebuiltByRole.get(role);
140974
+ if (entry && !forceCloudExport && tryReusePrebuiltCollection({
140975
+ prepared: entry,
140976
+ expectedPath,
140977
+ expectedCloudId: collectionId
140978
+ })) {
140979
+ core.info(`Reusing prebuilt ${role} collection tree at ${expectedPath} (artifactDigest match)`);
140980
+ return { reusePrebuilt: true };
140981
+ }
140982
+ if (entry) {
140983
+ core.info(forceCloudExport ? `Private mock requires cloud export for ${role} collection to reconcile managed root hook; exporting from cloud` : `Prebuilt ${role} collection entry present but did not exactly match; exporting from cloud`);
140984
+ }
140985
+ const cloud = forceCloudExport ? await preparePrivateMockCloudCollection(role, collectionId, postman) : await postman.getCollection(collectionId);
140986
+ return { reusePrebuilt: false, cloudCollection: cloud };
140987
+ }
140904
140988
  async function exportCollectionArtifact(options) {
140905
140989
  const {
140906
- role,
140907
140990
  collectionId,
140908
140991
  dirName,
140909
140992
  collectionsDir,
140910
- prebuiltByRole,
140911
- postman,
140912
- core,
140913
- privateMockAuth = false,
140914
- preparedCloudCollection
140993
+ artifactDir,
140994
+ acquisition
140915
140995
  } = options;
140916
140996
  if (!collectionId) {
140917
140997
  return void 0;
140918
140998
  }
140919
140999
  const expectedPath = `${collectionsDir}/${dirName}`;
140920
- const forceCloudExport = privateMockAuth && (role === "smoke" || role === "contract");
140921
- const entry = prebuiltByRole.get(role);
140922
- if (entry && !forceCloudExport) {
140923
- const reused = tryReusePrebuiltCollection({
140924
- prepared: entry,
140925
- expectedPath,
140926
- expectedCloudId: collectionId
140927
- });
140928
- if (reused) {
140929
- core.info(
140930
- `Reusing prebuilt ${role} collection tree at ${expectedPath} (artifactDigest match)`
140931
- );
140932
- return `../${expectedPath}`;
140933
- }
140934
- core.info(
140935
- `Prebuilt ${role} collection entry present but did not exactly match; exporting from cloud`
140936
- );
140937
- } else if (entry && forceCloudExport) {
140938
- core.info(
140939
- `Private mock requires cloud export for ${role} collection to reconcile managed root hook; exporting from cloud`
140940
- );
141000
+ if (acquisition.reusePrebuilt) {
141001
+ return `../${expectedPath}`;
140941
141002
  }
140942
- let collectionForExport;
140943
- if (forceCloudExport && preparedCloudCollection) {
140944
- collectionForExport = preparedCloudCollection;
140945
- } else if (forceCloudExport) {
140946
- const col = await postman.getCollection(collectionId);
140947
- const { collection } = applyPrivateMockExportCleanup(col, {
140948
- stripManagedBlocks: isPrivateMockLegacyExportCleanupEnabled()
140949
- });
140950
- if (!verifyPrivateMockRootHook(collection)) {
140951
- throw new Error(
140952
- `PRIVATE_MOCK_AUTH_ROOT_UNVERIFIED: Managed root hook missing from exported ${role} collection ${collectionId}`
140953
- );
140954
- }
140955
- collectionForExport = collection;
140956
- } else {
140957
- const col = await postman.getCollection(collectionId);
140958
- collectionForExport = col;
140959
- }
140960
- await convertAndSplitAnyCollection(collectionForExport, expectedPath);
141003
+ assertPathWithinArtifactRoot(expectedPath, artifactDir, "collection target");
141004
+ await convertAndSplitAnyCollection(
141005
+ acquisition.cloudCollection,
141006
+ expectedPath
141007
+ );
140961
141008
  return `../${expectedPath}`;
140962
141009
  }
140963
141010
  function hasControlCharacter2(value) {
@@ -141022,65 +141069,45 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName,
141022
141069
  ) : void 0;
141023
141070
  const prebuiltByRole = options.preparedPrebuiltCollections;
141024
141071
  const privateMockAuth = options.privateMockAuth === true;
141025
- const preparedPrivateMockCollections = /* @__PURE__ */ new Map();
141026
- if (privateMockAuth) {
141027
- for (const spec of [
141028
- { role: "smoke", collectionId: inputs.smokeCollectionId },
141029
- { role: "contract", collectionId: inputs.contractCollectionId }
141030
- ]) {
141031
- if (!spec.collectionId) {
141032
- continue;
141033
- }
141034
- preparedPrivateMockCollections.set(
141035
- spec.role,
141036
- await preparePrivateMockCloudCollection(
141037
- spec.role,
141038
- spec.collectionId,
141039
- dependencies.postman
141040
- )
141041
- );
141042
- }
141043
- }
141044
- const baselineRef = await exportCollectionArtifact({
141045
- role: "baseline",
141046
- collectionId: inputs.baselineCollectionId,
141047
- dirName: getCollectionDirectoryName("Baseline", assetProjectName),
141048
- collectionsDir,
141049
- prebuiltByRole,
141050
- postman: dependencies.postman,
141051
- core: dependencies.core,
141052
- privateMockAuth
141053
- });
141054
- if (baselineRef) {
141055
- manifestCollections[baselineRef] = inputs.baselineCollectionId;
141056
- }
141057
- const smokeRef = await exportCollectionArtifact({
141058
- role: "smoke",
141059
- collectionId: inputs.smokeCollectionId,
141060
- dirName: getCollectionDirectoryName("Smoke", assetProjectName),
141061
- collectionsDir,
141062
- prebuiltByRole,
141063
- postman: dependencies.postman,
141064
- core: dependencies.core,
141065
- privateMockAuth,
141066
- preparedCloudCollection: preparedPrivateMockCollections.get("smoke")
141067
- });
141068
- if (smokeRef) {
141069
- manifestCollections[smokeRef] = inputs.smokeCollectionId;
141072
+ const collectionSpecs = [
141073
+ { role: "baseline", collectionId: inputs.baselineCollectionId, dirName: getCollectionDirectoryName("Baseline", assetProjectName) },
141074
+ { role: "smoke", collectionId: inputs.smokeCollectionId, dirName: getCollectionDirectoryName("Smoke", assetProjectName) },
141075
+ { role: "contract", collectionId: inputs.contractCollectionId, dirName: getCollectionDirectoryName("Contract", assetProjectName) }
141076
+ ].filter((spec) => Boolean(spec.collectionId));
141077
+ const collectionStartedAt = Date.now();
141078
+ let collectionStatus = "success";
141079
+ let acquisitions;
141080
+ try {
141081
+ acquisitions = await runBoundedInOrder(
141082
+ collectionSpecs,
141083
+ ARTIFACT_ACQUISITION_WIDTH,
141084
+ (spec) => acquireCollectionArtifact({
141085
+ ...spec,
141086
+ collectionsDir,
141087
+ prebuiltByRole,
141088
+ postman: dependencies.postman,
141089
+ core: dependencies.core,
141090
+ privateMockAuth
141091
+ })
141092
+ );
141093
+ } catch (error2) {
141094
+ collectionStatus = "failed";
141095
+ throw error2;
141096
+ } finally {
141097
+ dependencies.core.info(
141098
+ `collection-acquisition count=${collectionSpecs.length} width=${ARTIFACT_ACQUISITION_WIDTH} ms=${Date.now() - collectionStartedAt} status=${collectionStatus}`
141099
+ );
141070
141100
  }
141071
- const contractRef = await exportCollectionArtifact({
141072
- role: "contract",
141073
- collectionId: inputs.contractCollectionId,
141074
- dirName: getCollectionDirectoryName("Contract", assetProjectName),
141075
- collectionsDir,
141076
- prebuiltByRole,
141077
- postman: dependencies.postman,
141078
- core: dependencies.core,
141079
- privateMockAuth,
141080
- preparedCloudCollection: preparedPrivateMockCollections.get("contract")
141081
- });
141082
- if (contractRef) {
141083
- manifestCollections[contractRef] = inputs.contractCollectionId;
141101
+ for (const [index, spec] of collectionSpecs.entries()) {
141102
+ const ref = await exportCollectionArtifact({
141103
+ ...spec,
141104
+ collectionsDir,
141105
+ artifactDir: inputs.artifactDir,
141106
+ acquisition: acquisitions[index]
141107
+ });
141108
+ if (ref) {
141109
+ manifestCollections[ref] = spec.collectionId;
141110
+ }
141084
141111
  }
141085
141112
  ensureDir(collectionsDir);
141086
141113
  ensureDir(environmentsDir);
@@ -141099,17 +141126,40 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName,
141099
141126
  ensureDir(ciDir);
141100
141127
  }
141101
141128
  }
141102
- for (const [envName, envUid] of Object.entries(envUids)) {
141103
- writeJsonFile(
141104
- `${environmentsDir}/${envName}.postman_environment.json`,
141105
- await dependencies.postman.getEnvironment(envUid),
141106
- true
141129
+ const environmentSpecs = [
141130
+ ...Object.entries(envUids).map(([envName, envUid]) => ({
141131
+ envName,
141132
+ envUid,
141133
+ filePath: `${environmentsDir}/${envName}.postman_environment.json`
141134
+ })),
141135
+ ...options.mockEnvironmentUid ? [{
141136
+ envName: "manual-validation",
141137
+ envUid: options.mockEnvironmentUid,
141138
+ filePath: `${mocksDir}/manual-validation.postman_environment.json`
141139
+ }] : []
141140
+ ];
141141
+ const environmentStartedAt = Date.now();
141142
+ let environmentStatus = "success";
141143
+ let environmentPayloads;
141144
+ try {
141145
+ environmentPayloads = await runBoundedInOrder(
141146
+ environmentSpecs,
141147
+ ARTIFACT_ACQUISITION_WIDTH,
141148
+ (spec) => dependencies.postman.getEnvironment(spec.envUid)
141149
+ );
141150
+ } catch (error2) {
141151
+ environmentStatus = "failed";
141152
+ throw error2;
141153
+ } finally {
141154
+ dependencies.core.info(
141155
+ `environment-artifact-acquisition count=${environmentSpecs.length} width=${ARTIFACT_ACQUISITION_WIDTH} ms=${Date.now() - environmentStartedAt} status=${environmentStatus}`
141107
141156
  );
141108
141157
  }
141109
- if (options.mockEnvironmentUid) {
141158
+ for (const [index, spec] of environmentSpecs.entries()) {
141159
+ assertPathWithinCwd(spec.filePath, "environment target");
141110
141160
  writeJsonFile(
141111
- `${mocksDir}/manual-validation.postman_environment.json`,
141112
- await dependencies.postman.getEnvironment(options.mockEnvironmentUid),
141161
+ spec.filePath,
141162
+ environmentPayloads[index],
141113
141163
  true
141114
141164
  );
141115
141165
  }
@@ -141119,6 +141169,7 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName,
141119
141169
  workspaceLinkEnabled: inputs.workspaceLinkEnabled,
141120
141170
  workspaceLinkStatus: options.workspaceLinkStatus
141121
141171
  });
141172
+ assertPathWithinCwd(".postman/resources.yaml", "resources state target");
141122
141173
  (0, import_node_fs5.writeFileSync)(".postman/resources.yaml", buildResourcesManifest(
141123
141174
  durableWorkspaceId,
141124
141175
  manifestCollections,
@@ -141137,6 +141188,7 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName,
141137
141188
  } catch {
141138
141189
  existingWorkflows = void 0;
141139
141190
  }
141191
+ assertPathWithinCwd(".postman/workflows.yaml", "workflows state target");
141140
141192
  (0, import_node_fs5.writeFileSync)(
141141
141193
  ".postman/workflows.yaml",
141142
141194
  buildSpecCollectionWorkflowManifest(
@@ -141186,18 +141238,19 @@ function createRepoSummary(outputs, envUids, pushed) {
141186
141238
  }
141187
141239
  async function commitAndPushGeneratedFiles(inputs, dependencies) {
141188
141240
  if (inputs.generateCiWorkflow) {
141189
- assertPathWithinCwd(inputs.ciWorkflowPath, "ci-workflow-path");
141190
141241
  const ciWorkflow = renderCiWorkflow(inputs);
141191
141242
  const parts = inputs.ciWorkflowPath.split("/");
141192
141243
  if (parts.length > 1) {
141193
141244
  const dir = parts.slice(0, -1).join("/");
141194
141245
  ensureDir(dir);
141195
141246
  }
141247
+ assertPathWithinCwd(inputs.ciWorkflowPath, "ci-workflow-path");
141196
141248
  (0, import_node_fs5.writeFileSync)(inputs.ciWorkflowPath, ciWorkflow);
141197
141249
  if (inputs.provider === "github" || inputs.provider === "unknown") {
141198
141250
  const gcPath = ".github/workflows/postman-preview-gc.yml";
141199
141251
  if (inputs.ciWorkflowPath.endsWith(".github/workflows/ci.yml") || inputs.ciWorkflowPath === ".github/workflows/ci.yml") {
141200
141252
  ensureDir(".github/workflows");
141253
+ assertPathWithinCwd(gcPath, "preview GC workflow path");
141201
141254
  (0, import_node_fs5.writeFileSync)(gcPath, renderGcWorkflowTemplate());
141202
141255
  }
141203
141256
  }
@@ -141643,35 +141696,25 @@ async function runRepoSyncInner(inputs, dependencies) {
141643
141696
  const rebound = await dependencies.postman.rebindMonitorByName(
141644
141697
  monitorName,
141645
141698
  inputs.smokeCollectionId,
141646
- monitorEnvUid
141699
+ monitorEnvUid,
141700
+ effectiveCron || void 0
141647
141701
  );
141648
141702
  if (rebound) {
141649
141703
  resolvedMonitorId = rebound.uid;
141650
141704
  dependencies.core.info(
141651
- `Rebound existing monitor ${rebound.uid} ("${monitorName}") from collection ${rebound.previousCollectionUid} to ${inputs.smokeCollectionId}`
141705
+ `Replaced stale monitor ${rebound.previousUid} ("${monitorName}") from collection ${rebound.previousCollectionUid} with ${rebound.uid} on ${inputs.smokeCollectionId}`
141652
141706
  );
141653
141707
  }
141654
141708
  } catch (error2) {
141655
- if (error2 instanceof AmbiguousMonitorRebindError) {
141656
- throw new Error(
141657
- formatOrchestrationIssue({
141658
- operation: "Monitor rebind",
141659
- entity: `monitor "${monitorName}" workspace ${inputs.workspaceId} collection ${inputs.smokeCollectionId} environment ${monitorEnvUid}`,
141660
- cause: error2,
141661
- remediation: monitorRemediation,
141662
- mask
141663
- }),
141664
- { cause: error2 }
141665
- );
141666
- }
141667
- dependencies.core.warning(
141709
+ throw new Error(
141668
141710
  formatOrchestrationIssue({
141669
141711
  operation: "Monitor rebind",
141670
141712
  entity: `monitor "${monitorName}" workspace ${inputs.workspaceId} collection ${inputs.smokeCollectionId} environment ${monitorEnvUid}`,
141671
141713
  cause: error2,
141672
141714
  remediation: monitorRemediation,
141673
141715
  mask
141674
- })
141716
+ }),
141717
+ { cause: error2 }
141675
141718
  );
141676
141719
  }
141677
141720
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman-cse/onboarding-repo-sync",
3
- "version": "2.6.3",
3
+ "version": "2.6.5",
4
4
  "description": "Postman repo sync GitHub Action.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",