@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/action.cjs +192 -149
- package/dist/cli.cjs +192 -149
- package/dist/index.cjs +192 -149
- package/package.json +1 -1
package/dist/action.cjs
CHANGED
|
@@ -138419,8 +138419,8 @@ var PostmanGatewayAssetsClient = class {
|
|
|
138419
138419
|
return { candidates, nameOnlyMatchCount: nameOnly.length, nameOnlyEnvironments };
|
|
138420
138420
|
}
|
|
138421
138421
|
/**
|
|
138422
|
-
*
|
|
138423
|
-
*
|
|
138422
|
+
* Replace the sole same-name monitor in this workspace when its collection
|
|
138423
|
+
* UID changed.
|
|
138424
138424
|
*
|
|
138425
138425
|
* The canonical Smoke collection can legitimately change UID (a bootstrap
|
|
138426
138426
|
* re-import after a marker/stranger miss, or an operator rebuild). The
|
|
@@ -138428,13 +138428,18 @@ var PostmanGatewayAssetsClient = class {
|
|
|
138428
138428
|
* (which requires the full collection+environment+name triple) misses and a
|
|
138429
138429
|
* second monitor with the same name would be created on every run, orphaning
|
|
138430
138430
|
* the old one. Name plus environment is the stable identity across a
|
|
138431
|
-
* collection re-import, so recover it here instead.
|
|
138431
|
+
* collection re-import, so recover it here instead. Monitoring API does not
|
|
138432
|
+
* allow `collection` in a jobTemplate update body, so replacement is the
|
|
138433
|
+
* supported mutation: create or adopt the desired monitor first, then delete
|
|
138434
|
+
* the stale monitor. This order preserves the existing monitor if creation
|
|
138435
|
+
* fails and never deletes the only usable monitor before its replacement
|
|
138436
|
+
* exists.
|
|
138432
138437
|
*
|
|
138433
138438
|
* Returns null when nothing needs rebinding (no same-name monitor, or it is
|
|
138434
138439
|
* already bound to this collection). Refuses to guess when several same-name
|
|
138435
138440
|
* monitors match, matching `selectExactMatch` semantics elsewhere.
|
|
138436
138441
|
*/
|
|
138437
|
-
async rebindMonitorByName(name, collectionUid, environmentUid) {
|
|
138442
|
+
async rebindMonitorByName(name, collectionUid, environmentUid, cronSchedule) {
|
|
138438
138443
|
const monitorName = String(name ?? "").trim();
|
|
138439
138444
|
const collection = String(collectionUid ?? "").trim();
|
|
138440
138445
|
const environment = String(environmentUid ?? "").trim();
|
|
@@ -138466,16 +138471,19 @@ var PostmanGatewayAssetsClient = class {
|
|
|
138466
138471
|
if (match.collectionUid === collection) {
|
|
138467
138472
|
return null;
|
|
138468
138473
|
}
|
|
138469
|
-
await this.
|
|
138470
|
-
|
|
138471
|
-
|
|
138472
|
-
|
|
138473
|
-
|
|
138474
|
-
|
|
138475
|
-
},
|
|
138476
|
-
{ retryTransient: false }
|
|
138474
|
+
const replacementUid = await this.createMonitor(
|
|
138475
|
+
this.workspaceId,
|
|
138476
|
+
monitorName,
|
|
138477
|
+
collection,
|
|
138478
|
+
environment,
|
|
138479
|
+
cronSchedule
|
|
138477
138480
|
);
|
|
138478
|
-
|
|
138481
|
+
await this.deleteMonitor(match.uid);
|
|
138482
|
+
return {
|
|
138483
|
+
uid: replacementUid,
|
|
138484
|
+
previousUid: match.uid,
|
|
138485
|
+
previousCollectionUid: match.collectionUid
|
|
138486
|
+
};
|
|
138479
138487
|
}
|
|
138480
138488
|
async runMonitor(uid) {
|
|
138481
138489
|
await this.gateway.requestJson(
|
|
@@ -140547,6 +140555,10 @@ var PREBUILT_COLLECTION_ROLES = /* @__PURE__ */ new Set([
|
|
|
140547
140555
|
]);
|
|
140548
140556
|
var SHA256_HEX = /^[a-f0-9]{64}$/;
|
|
140549
140557
|
var PREBUILT_CLOUD_ID = /^[A-Za-z0-9][A-Za-z0-9._:-]*$/;
|
|
140558
|
+
var PREBUILT_COLLECTION_MAX_DEPTH = 128;
|
|
140559
|
+
var PREBUILT_COLLECTION_MAX_TRAVERSAL_ENTRIES = LOCAL_SPEC_DISCOVERY_MAX_TRAVERSAL_ENTRIES;
|
|
140560
|
+
var PREBUILT_COLLECTION_MAX_FILE_BYTES = 32 * 1024 * 1024;
|
|
140561
|
+
var PREBUILT_COLLECTION_MAX_TOTAL_BYTES = 100 * 1024 * 1024;
|
|
140550
140562
|
function failPrebuiltCollections(detail) {
|
|
140551
140563
|
throw new Error(`CONTRACT_PREBUILT_COLLECTIONS_INVALID: ${detail}`);
|
|
140552
140564
|
}
|
|
@@ -140658,8 +140670,9 @@ function assertPathWithinArtifactRoot(targetPath, artifactDir, fieldName) {
|
|
|
140658
140670
|
existingPath = parent;
|
|
140659
140671
|
}
|
|
140660
140672
|
const realExisting = (0, import_node_fs5.realpathSync)(existingPath);
|
|
140661
|
-
const
|
|
140662
|
-
|
|
140673
|
+
const realArtifactRoot = (0, import_node_fs5.existsSync)(artifactRoot) ? (0, import_node_fs5.realpathSync)(artifactRoot) : void 0;
|
|
140674
|
+
const realRelative = realArtifactRoot ? path8.relative(realArtifactRoot, realExisting) : "";
|
|
140675
|
+
if (realArtifactRoot && (realRelative.startsWith("..") || path8.isAbsolute(realRelative))) {
|
|
140663
140676
|
failPrebuiltCollections(
|
|
140664
140677
|
`${fieldName} resolves outside artifact-dir via symlink; received ${targetPath}`
|
|
140665
140678
|
);
|
|
@@ -140701,13 +140714,16 @@ function listPrebuiltCollectionTreeFiles(collectionPath, artifactDir) {
|
|
|
140701
140714
|
return [];
|
|
140702
140715
|
}
|
|
140703
140716
|
const files = [];
|
|
140704
|
-
const pendingDirectories = [absRoot];
|
|
140717
|
+
const pendingDirectories = [{ absolute: absRoot, depth: 0 }];
|
|
140705
140718
|
const seenDirectories = /* @__PURE__ */ new Set();
|
|
140719
|
+
let traversalEntries = 1;
|
|
140720
|
+
let totalBytes = 0;
|
|
140706
140721
|
while (pendingDirectories.length > 0) {
|
|
140707
|
-
const
|
|
140708
|
-
if (!
|
|
140722
|
+
const current = pendingDirectories.pop();
|
|
140723
|
+
if (!current) {
|
|
140709
140724
|
break;
|
|
140710
140725
|
}
|
|
140726
|
+
const { absolute: currentAbsolute, depth: currentDepth } = current;
|
|
140711
140727
|
const currentStat = (0, import_node_fs5.lstatSync)(currentAbsolute);
|
|
140712
140728
|
if (currentStat.isSymbolicLink() || !currentStat.isDirectory()) {
|
|
140713
140729
|
failPrebuiltCollections(
|
|
@@ -140721,8 +140737,16 @@ function listPrebuiltCollectionTreeFiles(collectionPath, artifactDir) {
|
|
|
140721
140737
|
);
|
|
140722
140738
|
}
|
|
140723
140739
|
seenDirectories.add(currentKey);
|
|
140724
|
-
const entries = (0, import_node_fs5.readdirSync)(currentAbsolute, { withFileTypes: true })
|
|
140740
|
+
const entries = (0, import_node_fs5.readdirSync)(currentAbsolute, { withFileTypes: true }).sort(
|
|
140741
|
+
(left, right) => left.name.localeCompare(right.name)
|
|
140742
|
+
);
|
|
140725
140743
|
for (const entry of entries) {
|
|
140744
|
+
traversalEntries += 1;
|
|
140745
|
+
if (traversalEntries > PREBUILT_COLLECTION_MAX_TRAVERSAL_ENTRIES) {
|
|
140746
|
+
failPrebuiltCollections(
|
|
140747
|
+
`prebuilt collection tree exceeded the ${PREBUILT_COLLECTION_MAX_TRAVERSAL_ENTRIES} traversal-entry budget`
|
|
140748
|
+
);
|
|
140749
|
+
}
|
|
140726
140750
|
const abs = path8.join(currentAbsolute, entry.name);
|
|
140727
140751
|
if (entry.isSymbolicLink()) {
|
|
140728
140752
|
failPrebuiltCollections(
|
|
@@ -140730,7 +140754,13 @@ function listPrebuiltCollectionTreeFiles(collectionPath, artifactDir) {
|
|
|
140730
140754
|
);
|
|
140731
140755
|
}
|
|
140732
140756
|
if (entry.isDirectory()) {
|
|
140733
|
-
|
|
140757
|
+
const nextDepth = currentDepth + 1;
|
|
140758
|
+
if (nextDepth > PREBUILT_COLLECTION_MAX_DEPTH) {
|
|
140759
|
+
failPrebuiltCollections(
|
|
140760
|
+
`prebuilt collection tree exceeded the ${PREBUILT_COLLECTION_MAX_DEPTH} directory-depth budget`
|
|
140761
|
+
);
|
|
140762
|
+
}
|
|
140763
|
+
pendingDirectories.push({ absolute: abs, depth: nextDepth });
|
|
140734
140764
|
continue;
|
|
140735
140765
|
}
|
|
140736
140766
|
if (!entry.isFile()) {
|
|
@@ -140744,6 +140774,17 @@ function listPrebuiltCollectionTreeFiles(collectionPath, artifactDir) {
|
|
|
140744
140774
|
`prebuilt collection tree file changed or became unsupported at ${normalizeToPosix(path8.relative(absRoot, abs))}`
|
|
140745
140775
|
);
|
|
140746
140776
|
}
|
|
140777
|
+
if (fileLstat.size > PREBUILT_COLLECTION_MAX_FILE_BYTES) {
|
|
140778
|
+
failPrebuiltCollections(
|
|
140779
|
+
`prebuilt collection tree file ${normalizeToPosix(path8.relative(absRoot, abs))} exceeds the ${PREBUILT_COLLECTION_MAX_FILE_BYTES / (1024 * 1024)} MiB individual-file budget`
|
|
140780
|
+
);
|
|
140781
|
+
}
|
|
140782
|
+
totalBytes += fileLstat.size;
|
|
140783
|
+
if (totalBytes > PREBUILT_COLLECTION_MAX_TOTAL_BYTES) {
|
|
140784
|
+
failPrebuiltCollections(
|
|
140785
|
+
`prebuilt collection tree exceeded the ${PREBUILT_COLLECTION_MAX_TOTAL_BYTES / (1024 * 1024)} MiB total-byte budget`
|
|
140786
|
+
);
|
|
140787
|
+
}
|
|
140747
140788
|
files.push({
|
|
140748
140789
|
absolute: abs,
|
|
140749
140790
|
relative: normalizeToPosix(path8.relative(absRoot, abs)),
|
|
@@ -140878,63 +140919,69 @@ async function preparePrivateMockCloudCollection(role, collectionId, postman) {
|
|
|
140878
140919
|
}
|
|
140879
140920
|
return collection;
|
|
140880
140921
|
}
|
|
140922
|
+
var ARTIFACT_ACQUISITION_WIDTH = 2;
|
|
140923
|
+
async function runBoundedInOrder(items, width, worker) {
|
|
140924
|
+
const results = new Array(items.length);
|
|
140925
|
+
let nextIndex = 0;
|
|
140926
|
+
const failures = /* @__PURE__ */ new Map();
|
|
140927
|
+
const runWorker = async () => {
|
|
140928
|
+
while (failures.size === 0 && nextIndex < items.length) {
|
|
140929
|
+
const index = nextIndex;
|
|
140930
|
+
nextIndex += 1;
|
|
140931
|
+
try {
|
|
140932
|
+
results[index] = await worker(items[index], index);
|
|
140933
|
+
} catch (error2) {
|
|
140934
|
+
failures.set(index, error2);
|
|
140935
|
+
return;
|
|
140936
|
+
}
|
|
140937
|
+
}
|
|
140938
|
+
};
|
|
140939
|
+
await Promise.all(Array.from({ length: Math.min(width, items.length) }, () => runWorker()));
|
|
140940
|
+
const failedIndex = Math.min(...failures.keys());
|
|
140941
|
+
if (Number.isFinite(failedIndex)) {
|
|
140942
|
+
throw failures.get(failedIndex);
|
|
140943
|
+
}
|
|
140944
|
+
return results;
|
|
140945
|
+
}
|
|
140946
|
+
async function acquireCollectionArtifact(options) {
|
|
140947
|
+
const { role, collectionId, dirName, collectionsDir, prebuiltByRole, postman, core, privateMockAuth = false } = options;
|
|
140948
|
+
const expectedPath = `${collectionsDir}/${dirName}`;
|
|
140949
|
+
const forceCloudExport = privateMockAuth && (role === "smoke" || role === "contract");
|
|
140950
|
+
const entry = prebuiltByRole.get(role);
|
|
140951
|
+
if (entry && !forceCloudExport && tryReusePrebuiltCollection({
|
|
140952
|
+
prepared: entry,
|
|
140953
|
+
expectedPath,
|
|
140954
|
+
expectedCloudId: collectionId
|
|
140955
|
+
})) {
|
|
140956
|
+
core.info(`Reusing prebuilt ${role} collection tree at ${expectedPath} (artifactDigest match)`);
|
|
140957
|
+
return { reusePrebuilt: true };
|
|
140958
|
+
}
|
|
140959
|
+
if (entry) {
|
|
140960
|
+
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`);
|
|
140961
|
+
}
|
|
140962
|
+
const cloud = forceCloudExport ? await preparePrivateMockCloudCollection(role, collectionId, postman) : await postman.getCollection(collectionId);
|
|
140963
|
+
return { reusePrebuilt: false, cloudCollection: cloud };
|
|
140964
|
+
}
|
|
140881
140965
|
async function exportCollectionArtifact(options) {
|
|
140882
140966
|
const {
|
|
140883
|
-
role,
|
|
140884
140967
|
collectionId,
|
|
140885
140968
|
dirName,
|
|
140886
140969
|
collectionsDir,
|
|
140887
|
-
|
|
140888
|
-
|
|
140889
|
-
core,
|
|
140890
|
-
privateMockAuth = false,
|
|
140891
|
-
preparedCloudCollection
|
|
140970
|
+
artifactDir,
|
|
140971
|
+
acquisition
|
|
140892
140972
|
} = options;
|
|
140893
140973
|
if (!collectionId) {
|
|
140894
140974
|
return void 0;
|
|
140895
140975
|
}
|
|
140896
140976
|
const expectedPath = `${collectionsDir}/${dirName}`;
|
|
140897
|
-
|
|
140898
|
-
|
|
140899
|
-
if (entry && !forceCloudExport) {
|
|
140900
|
-
const reused = tryReusePrebuiltCollection({
|
|
140901
|
-
prepared: entry,
|
|
140902
|
-
expectedPath,
|
|
140903
|
-
expectedCloudId: collectionId
|
|
140904
|
-
});
|
|
140905
|
-
if (reused) {
|
|
140906
|
-
core.info(
|
|
140907
|
-
`Reusing prebuilt ${role} collection tree at ${expectedPath} (artifactDigest match)`
|
|
140908
|
-
);
|
|
140909
|
-
return `../${expectedPath}`;
|
|
140910
|
-
}
|
|
140911
|
-
core.info(
|
|
140912
|
-
`Prebuilt ${role} collection entry present but did not exactly match; exporting from cloud`
|
|
140913
|
-
);
|
|
140914
|
-
} else if (entry && forceCloudExport) {
|
|
140915
|
-
core.info(
|
|
140916
|
-
`Private mock requires cloud export for ${role} collection to reconcile managed root hook; exporting from cloud`
|
|
140917
|
-
);
|
|
140977
|
+
if (acquisition.reusePrebuilt) {
|
|
140978
|
+
return `../${expectedPath}`;
|
|
140918
140979
|
}
|
|
140919
|
-
|
|
140920
|
-
|
|
140921
|
-
|
|
140922
|
-
|
|
140923
|
-
|
|
140924
|
-
const { collection } = applyPrivateMockExportCleanup(col, {
|
|
140925
|
-
stripManagedBlocks: isPrivateMockLegacyExportCleanupEnabled()
|
|
140926
|
-
});
|
|
140927
|
-
if (!verifyPrivateMockRootHook(collection)) {
|
|
140928
|
-
throw new Error(
|
|
140929
|
-
`PRIVATE_MOCK_AUTH_ROOT_UNVERIFIED: Managed root hook missing from exported ${role} collection ${collectionId}`
|
|
140930
|
-
);
|
|
140931
|
-
}
|
|
140932
|
-
collectionForExport = collection;
|
|
140933
|
-
} else {
|
|
140934
|
-
const col = await postman.getCollection(collectionId);
|
|
140935
|
-
collectionForExport = col;
|
|
140936
|
-
}
|
|
140937
|
-
await convertAndSplitAnyCollection(collectionForExport, expectedPath);
|
|
140980
|
+
assertPathWithinArtifactRoot(expectedPath, artifactDir, "collection target");
|
|
140981
|
+
await convertAndSplitAnyCollection(
|
|
140982
|
+
acquisition.cloudCollection,
|
|
140983
|
+
expectedPath
|
|
140984
|
+
);
|
|
140938
140985
|
return `../${expectedPath}`;
|
|
140939
140986
|
}
|
|
140940
140987
|
function hasControlCharacter2(value) {
|
|
@@ -140999,65 +141046,45 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName,
|
|
|
140999
141046
|
) : void 0;
|
|
141000
141047
|
const prebuiltByRole = options.preparedPrebuiltCollections;
|
|
141001
141048
|
const privateMockAuth = options.privateMockAuth === true;
|
|
141002
|
-
const
|
|
141003
|
-
|
|
141004
|
-
|
|
141005
|
-
|
|
141006
|
-
|
|
141007
|
-
|
|
141008
|
-
|
|
141009
|
-
|
|
141010
|
-
|
|
141011
|
-
|
|
141012
|
-
|
|
141013
|
-
|
|
141014
|
-
|
|
141015
|
-
|
|
141016
|
-
|
|
141017
|
-
|
|
141018
|
-
|
|
141019
|
-
|
|
141020
|
-
|
|
141021
|
-
|
|
141022
|
-
|
|
141023
|
-
|
|
141024
|
-
|
|
141025
|
-
|
|
141026
|
-
|
|
141027
|
-
|
|
141028
|
-
|
|
141029
|
-
|
|
141030
|
-
});
|
|
141031
|
-
if (baselineRef) {
|
|
141032
|
-
manifestCollections[baselineRef] = inputs.baselineCollectionId;
|
|
141033
|
-
}
|
|
141034
|
-
const smokeRef = await exportCollectionArtifact({
|
|
141035
|
-
role: "smoke",
|
|
141036
|
-
collectionId: inputs.smokeCollectionId,
|
|
141037
|
-
dirName: getCollectionDirectoryName("Smoke", assetProjectName),
|
|
141038
|
-
collectionsDir,
|
|
141039
|
-
prebuiltByRole,
|
|
141040
|
-
postman: dependencies.postman,
|
|
141041
|
-
core: dependencies.core,
|
|
141042
|
-
privateMockAuth,
|
|
141043
|
-
preparedCloudCollection: preparedPrivateMockCollections.get("smoke")
|
|
141044
|
-
});
|
|
141045
|
-
if (smokeRef) {
|
|
141046
|
-
manifestCollections[smokeRef] = inputs.smokeCollectionId;
|
|
141049
|
+
const collectionSpecs = [
|
|
141050
|
+
{ role: "baseline", collectionId: inputs.baselineCollectionId, dirName: getCollectionDirectoryName("Baseline", assetProjectName) },
|
|
141051
|
+
{ role: "smoke", collectionId: inputs.smokeCollectionId, dirName: getCollectionDirectoryName("Smoke", assetProjectName) },
|
|
141052
|
+
{ role: "contract", collectionId: inputs.contractCollectionId, dirName: getCollectionDirectoryName("Contract", assetProjectName) }
|
|
141053
|
+
].filter((spec) => Boolean(spec.collectionId));
|
|
141054
|
+
const collectionStartedAt = Date.now();
|
|
141055
|
+
let collectionStatus = "success";
|
|
141056
|
+
let acquisitions;
|
|
141057
|
+
try {
|
|
141058
|
+
acquisitions = await runBoundedInOrder(
|
|
141059
|
+
collectionSpecs,
|
|
141060
|
+
ARTIFACT_ACQUISITION_WIDTH,
|
|
141061
|
+
(spec) => acquireCollectionArtifact({
|
|
141062
|
+
...spec,
|
|
141063
|
+
collectionsDir,
|
|
141064
|
+
prebuiltByRole,
|
|
141065
|
+
postman: dependencies.postman,
|
|
141066
|
+
core: dependencies.core,
|
|
141067
|
+
privateMockAuth
|
|
141068
|
+
})
|
|
141069
|
+
);
|
|
141070
|
+
} catch (error2) {
|
|
141071
|
+
collectionStatus = "failed";
|
|
141072
|
+
throw error2;
|
|
141073
|
+
} finally {
|
|
141074
|
+
dependencies.core.info(
|
|
141075
|
+
`collection-acquisition count=${collectionSpecs.length} width=${ARTIFACT_ACQUISITION_WIDTH} ms=${Date.now() - collectionStartedAt} status=${collectionStatus}`
|
|
141076
|
+
);
|
|
141047
141077
|
}
|
|
141048
|
-
const
|
|
141049
|
-
|
|
141050
|
-
|
|
141051
|
-
|
|
141052
|
-
|
|
141053
|
-
|
|
141054
|
-
|
|
141055
|
-
|
|
141056
|
-
|
|
141057
|
-
|
|
141058
|
-
});
|
|
141059
|
-
if (contractRef) {
|
|
141060
|
-
manifestCollections[contractRef] = inputs.contractCollectionId;
|
|
141078
|
+
for (const [index, spec] of collectionSpecs.entries()) {
|
|
141079
|
+
const ref = await exportCollectionArtifact({
|
|
141080
|
+
...spec,
|
|
141081
|
+
collectionsDir,
|
|
141082
|
+
artifactDir: inputs.artifactDir,
|
|
141083
|
+
acquisition: acquisitions[index]
|
|
141084
|
+
});
|
|
141085
|
+
if (ref) {
|
|
141086
|
+
manifestCollections[ref] = spec.collectionId;
|
|
141087
|
+
}
|
|
141061
141088
|
}
|
|
141062
141089
|
ensureDir(collectionsDir);
|
|
141063
141090
|
ensureDir(environmentsDir);
|
|
@@ -141076,17 +141103,40 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName,
|
|
|
141076
141103
|
ensureDir(ciDir);
|
|
141077
141104
|
}
|
|
141078
141105
|
}
|
|
141079
|
-
|
|
141080
|
-
|
|
141081
|
-
|
|
141082
|
-
|
|
141083
|
-
|
|
141106
|
+
const environmentSpecs = [
|
|
141107
|
+
...Object.entries(envUids).map(([envName, envUid]) => ({
|
|
141108
|
+
envName,
|
|
141109
|
+
envUid,
|
|
141110
|
+
filePath: `${environmentsDir}/${envName}.postman_environment.json`
|
|
141111
|
+
})),
|
|
141112
|
+
...options.mockEnvironmentUid ? [{
|
|
141113
|
+
envName: "manual-validation",
|
|
141114
|
+
envUid: options.mockEnvironmentUid,
|
|
141115
|
+
filePath: `${mocksDir}/manual-validation.postman_environment.json`
|
|
141116
|
+
}] : []
|
|
141117
|
+
];
|
|
141118
|
+
const environmentStartedAt = Date.now();
|
|
141119
|
+
let environmentStatus = "success";
|
|
141120
|
+
let environmentPayloads;
|
|
141121
|
+
try {
|
|
141122
|
+
environmentPayloads = await runBoundedInOrder(
|
|
141123
|
+
environmentSpecs,
|
|
141124
|
+
ARTIFACT_ACQUISITION_WIDTH,
|
|
141125
|
+
(spec) => dependencies.postman.getEnvironment(spec.envUid)
|
|
141126
|
+
);
|
|
141127
|
+
} catch (error2) {
|
|
141128
|
+
environmentStatus = "failed";
|
|
141129
|
+
throw error2;
|
|
141130
|
+
} finally {
|
|
141131
|
+
dependencies.core.info(
|
|
141132
|
+
`environment-artifact-acquisition count=${environmentSpecs.length} width=${ARTIFACT_ACQUISITION_WIDTH} ms=${Date.now() - environmentStartedAt} status=${environmentStatus}`
|
|
141084
141133
|
);
|
|
141085
141134
|
}
|
|
141086
|
-
|
|
141135
|
+
for (const [index, spec] of environmentSpecs.entries()) {
|
|
141136
|
+
assertPathWithinCwd(spec.filePath, "environment target");
|
|
141087
141137
|
writeJsonFile(
|
|
141088
|
-
|
|
141089
|
-
|
|
141138
|
+
spec.filePath,
|
|
141139
|
+
environmentPayloads[index],
|
|
141090
141140
|
true
|
|
141091
141141
|
);
|
|
141092
141142
|
}
|
|
@@ -141096,6 +141146,7 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName,
|
|
|
141096
141146
|
workspaceLinkEnabled: inputs.workspaceLinkEnabled,
|
|
141097
141147
|
workspaceLinkStatus: options.workspaceLinkStatus
|
|
141098
141148
|
});
|
|
141149
|
+
assertPathWithinCwd(".postman/resources.yaml", "resources state target");
|
|
141099
141150
|
(0, import_node_fs5.writeFileSync)(".postman/resources.yaml", buildResourcesManifest(
|
|
141100
141151
|
durableWorkspaceId,
|
|
141101
141152
|
manifestCollections,
|
|
@@ -141114,6 +141165,7 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName,
|
|
|
141114
141165
|
} catch {
|
|
141115
141166
|
existingWorkflows = void 0;
|
|
141116
141167
|
}
|
|
141168
|
+
assertPathWithinCwd(".postman/workflows.yaml", "workflows state target");
|
|
141117
141169
|
(0, import_node_fs5.writeFileSync)(
|
|
141118
141170
|
".postman/workflows.yaml",
|
|
141119
141171
|
buildSpecCollectionWorkflowManifest(
|
|
@@ -141163,18 +141215,19 @@ function createRepoSummary(outputs, envUids, pushed) {
|
|
|
141163
141215
|
}
|
|
141164
141216
|
async function commitAndPushGeneratedFiles(inputs, dependencies) {
|
|
141165
141217
|
if (inputs.generateCiWorkflow) {
|
|
141166
|
-
assertPathWithinCwd(inputs.ciWorkflowPath, "ci-workflow-path");
|
|
141167
141218
|
const ciWorkflow = renderCiWorkflow(inputs);
|
|
141168
141219
|
const parts = inputs.ciWorkflowPath.split("/");
|
|
141169
141220
|
if (parts.length > 1) {
|
|
141170
141221
|
const dir = parts.slice(0, -1).join("/");
|
|
141171
141222
|
ensureDir(dir);
|
|
141172
141223
|
}
|
|
141224
|
+
assertPathWithinCwd(inputs.ciWorkflowPath, "ci-workflow-path");
|
|
141173
141225
|
(0, import_node_fs5.writeFileSync)(inputs.ciWorkflowPath, ciWorkflow);
|
|
141174
141226
|
if (inputs.provider === "github" || inputs.provider === "unknown") {
|
|
141175
141227
|
const gcPath = ".github/workflows/postman-preview-gc.yml";
|
|
141176
141228
|
if (inputs.ciWorkflowPath.endsWith(".github/workflows/ci.yml") || inputs.ciWorkflowPath === ".github/workflows/ci.yml") {
|
|
141177
141229
|
ensureDir(".github/workflows");
|
|
141230
|
+
assertPathWithinCwd(gcPath, "preview GC workflow path");
|
|
141178
141231
|
(0, import_node_fs5.writeFileSync)(gcPath, renderGcWorkflowTemplate());
|
|
141179
141232
|
}
|
|
141180
141233
|
}
|
|
@@ -141620,35 +141673,25 @@ async function runRepoSyncInner(inputs, dependencies) {
|
|
|
141620
141673
|
const rebound = await dependencies.postman.rebindMonitorByName(
|
|
141621
141674
|
monitorName,
|
|
141622
141675
|
inputs.smokeCollectionId,
|
|
141623
|
-
monitorEnvUid
|
|
141676
|
+
monitorEnvUid,
|
|
141677
|
+
effectiveCron || void 0
|
|
141624
141678
|
);
|
|
141625
141679
|
if (rebound) {
|
|
141626
141680
|
resolvedMonitorId = rebound.uid;
|
|
141627
141681
|
dependencies.core.info(
|
|
141628
|
-
`
|
|
141682
|
+
`Replaced stale monitor ${rebound.previousUid} ("${monitorName}") from collection ${rebound.previousCollectionUid} with ${rebound.uid} on ${inputs.smokeCollectionId}`
|
|
141629
141683
|
);
|
|
141630
141684
|
}
|
|
141631
141685
|
} catch (error2) {
|
|
141632
|
-
|
|
141633
|
-
throw new Error(
|
|
141634
|
-
formatOrchestrationIssue({
|
|
141635
|
-
operation: "Monitor rebind",
|
|
141636
|
-
entity: `monitor "${monitorName}" workspace ${inputs.workspaceId} collection ${inputs.smokeCollectionId} environment ${monitorEnvUid}`,
|
|
141637
|
-
cause: error2,
|
|
141638
|
-
remediation: monitorRemediation,
|
|
141639
|
-
mask
|
|
141640
|
-
}),
|
|
141641
|
-
{ cause: error2 }
|
|
141642
|
-
);
|
|
141643
|
-
}
|
|
141644
|
-
dependencies.core.warning(
|
|
141686
|
+
throw new Error(
|
|
141645
141687
|
formatOrchestrationIssue({
|
|
141646
141688
|
operation: "Monitor rebind",
|
|
141647
141689
|
entity: `monitor "${monitorName}" workspace ${inputs.workspaceId} collection ${inputs.smokeCollectionId} environment ${monitorEnvUid}`,
|
|
141648
141690
|
cause: error2,
|
|
141649
141691
|
remediation: monitorRemediation,
|
|
141650
141692
|
mask
|
|
141651
|
-
})
|
|
141693
|
+
}),
|
|
141694
|
+
{ cause: error2 }
|
|
141652
141695
|
);
|
|
141653
141696
|
}
|
|
141654
141697
|
}
|