@treeseed/sdk 0.12.35 → 0.12.37
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.
|
@@ -973,7 +973,7 @@ async function validateRepositoryLockfile(node, options) {
|
|
|
973
973
|
return { status: "skipped", command: commandText, issues: [], error: "disabled" };
|
|
974
974
|
}
|
|
975
975
|
try {
|
|
976
|
-
runCapturedCommand(node, options, "lockfile", command, args, { timeoutMs:
|
|
976
|
+
runCapturedCommand(node, options, "lockfile", command, args, { timeoutMs: 6e5, emitOutputOnSuccess: false });
|
|
977
977
|
const packageCount = npmLockfilePackageCount(node.path);
|
|
978
978
|
const countText = packageCount === null ? "package-lock entries" : `${packageCount} package${packageCount === 1 ? "" : "s"}`;
|
|
979
979
|
emitProgress(options, node, "lockfile", `Lockfile validation passed: ${countText} checked, 0 issues.`);
|
|
@@ -70,6 +70,7 @@ type WorkflowApplicationSelection = {
|
|
|
70
70
|
}>;
|
|
71
71
|
source: 'changed-paths' | 'package-selection' | 'default';
|
|
72
72
|
};
|
|
73
|
+
export declare function orderReleasePackageNames(packageNames: string[]): string[];
|
|
73
74
|
export declare function workflowProof(helpers: WorkflowOperationHelpers, input?: TreeseedProofInput): Promise<TreeseedWorkflowResult<Record<string, unknown> & {
|
|
74
75
|
finalState?: WorkflowStatePayload;
|
|
75
76
|
timing?: TreeseedWorkflowTiming;
|
|
@@ -980,9 +981,9 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
980
981
|
stagingBranch: string;
|
|
981
982
|
productionBranch: string;
|
|
982
983
|
packageSelection: {
|
|
983
|
-
changed:
|
|
984
|
-
dependents:
|
|
985
|
-
selected:
|
|
984
|
+
changed: string[];
|
|
985
|
+
dependents: string[];
|
|
986
|
+
selected: string[];
|
|
986
987
|
};
|
|
987
988
|
plannedVersions: any;
|
|
988
989
|
stableDependencyVersions: Record<string, string>;
|
|
@@ -995,13 +996,14 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
995
996
|
spec: string;
|
|
996
997
|
reason: string;
|
|
997
998
|
}[];
|
|
999
|
+
releaseOrder: string[];
|
|
998
1000
|
plannedPublishWaits: {
|
|
999
|
-
name:
|
|
1001
|
+
name: string;
|
|
1000
1002
|
workflow: string;
|
|
1001
1003
|
branch: string;
|
|
1002
1004
|
status: string;
|
|
1003
1005
|
}[];
|
|
1004
|
-
touchedPackages:
|
|
1006
|
+
touchedPackages: string[];
|
|
1005
1007
|
repos: WorkflowRepoReport[];
|
|
1006
1008
|
rootRepo: WorkflowRepoReport;
|
|
1007
1009
|
finalBranch: string;
|
|
@@ -1256,9 +1258,9 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
1256
1258
|
stagingBranch: string;
|
|
1257
1259
|
productionBranch: string;
|
|
1258
1260
|
packageSelection: {
|
|
1259
|
-
changed:
|
|
1260
|
-
dependents:
|
|
1261
|
-
selected:
|
|
1261
|
+
changed: string[];
|
|
1262
|
+
dependents: string[];
|
|
1263
|
+
selected: string[];
|
|
1262
1264
|
};
|
|
1263
1265
|
plannedVersions: any;
|
|
1264
1266
|
stableDependencyVersions: Record<string, string>;
|
|
@@ -1271,8 +1273,9 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
1271
1273
|
spec: string;
|
|
1272
1274
|
reason: string;
|
|
1273
1275
|
}[];
|
|
1276
|
+
releaseOrder: string[];
|
|
1274
1277
|
plannedPublishWaits: {
|
|
1275
|
-
name:
|
|
1278
|
+
name: string;
|
|
1276
1279
|
workflow: string;
|
|
1277
1280
|
branch: string;
|
|
1278
1281
|
status: string;
|
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
createPersistentDeployTarget,
|
|
45
45
|
destroyTreeseedEnvironmentResources,
|
|
46
46
|
loadDeployState,
|
|
47
|
+
purgeSourcePageCaches,
|
|
47
48
|
recordHostedDeploymentState,
|
|
48
49
|
resolveConfiguredSurfaceDomain,
|
|
49
50
|
validateDestroyPrerequisites
|
|
@@ -646,6 +647,21 @@ async function runReleaseWebLiveVerification(root, environment, helpers, operati
|
|
|
646
647
|
...helpers.context.env,
|
|
647
648
|
...collectTreeseedConfigSeedValues(root, environment, helpers.context.env)
|
|
648
649
|
};
|
|
650
|
+
let purge;
|
|
651
|
+
try {
|
|
652
|
+
purge = purgeSourcePageCaches(root, { target: environment, env });
|
|
653
|
+
} catch (error) {
|
|
654
|
+
workflowError(operation, "hosted_live_verification_failed", `Production web cache purge failed before root live verification:
|
|
655
|
+
${error instanceof Error ? error.message : String(error)}`, {
|
|
656
|
+
details: { environment }
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
if (purge?.skipped) {
|
|
660
|
+
workflowError(operation, "hosted_live_verification_failed", `Production web cache purge was skipped before root live verification: ${purge.reason ?? "unknown reason"}`, {
|
|
661
|
+
details: { environment, purge }
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
helpers.write(`[${operation}][cloudflare] purged production source page cache for ${purge?.urls?.length ?? 0} urls before web live verification.`, "stderr");
|
|
649
665
|
const live = await collectTreeseedLiveHostedServiceChecks({
|
|
650
666
|
tenantRoot: root,
|
|
651
667
|
target: environment,
|
|
@@ -2251,6 +2267,30 @@ function releasePlanPackageSelection(value) {
|
|
|
2251
2267
|
selected: Array.isArray(record.selected) ? record.selected.map(String) : []
|
|
2252
2268
|
};
|
|
2253
2269
|
}
|
|
2270
|
+
const RELEASE_PACKAGE_DEPENDENCIES = {
|
|
2271
|
+
"@treeseed/api": ["treedx"]
|
|
2272
|
+
};
|
|
2273
|
+
function orderReleasePackageNames(packageNames) {
|
|
2274
|
+
const selected = new Set(packageNames);
|
|
2275
|
+
const ordered = [];
|
|
2276
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
2277
|
+
const visited = /* @__PURE__ */ new Set();
|
|
2278
|
+
const visit = (name) => {
|
|
2279
|
+
if (visited.has(name)) return;
|
|
2280
|
+
if (visiting.has(name)) {
|
|
2281
|
+
throw new Error(`Cycle detected in release package dependency order at ${name}.`);
|
|
2282
|
+
}
|
|
2283
|
+
visiting.add(name);
|
|
2284
|
+
for (const dependency of RELEASE_PACKAGE_DEPENDENCIES[name] ?? []) {
|
|
2285
|
+
if (selected.has(dependency)) visit(dependency);
|
|
2286
|
+
}
|
|
2287
|
+
visiting.delete(name);
|
|
2288
|
+
visited.add(name);
|
|
2289
|
+
ordered.push(name);
|
|
2290
|
+
};
|
|
2291
|
+
for (const name of packageNames) visit(name);
|
|
2292
|
+
return ordered;
|
|
2293
|
+
}
|
|
2254
2294
|
function stableDependencyVersionsForReleaseLine(root, options) {
|
|
2255
2295
|
const targetLine = typeof options.targetLine === "string" ? options.targetLine : null;
|
|
2256
2296
|
const group = new Set(Array.isArray(options.group) ? options.group.map(String) : []);
|
|
@@ -2492,7 +2532,7 @@ function buildReleasePlanSnapshot(input) {
|
|
|
2492
2532
|
versionPlan.versions.set(adapter.id, incrementVersion(adapter.version, input.level));
|
|
2493
2533
|
}
|
|
2494
2534
|
}
|
|
2495
|
-
const plannedSelected = [...versionPlan.selected].filter((name) => versionPlan.versions.has(name));
|
|
2535
|
+
const plannedSelected = orderReleasePackageNames([...versionPlan.selected].filter((name) => versionPlan.versions.has(name)));
|
|
2496
2536
|
const plannedChanged = input.repairVersionLine === true ? plannedSelected : Array.from(new Set(input.packageSelection.changed.filter((name) => plannedSelected.includes(name))));
|
|
2497
2537
|
const plannedDependents = plannedSelected.filter((name) => !plannedChanged.includes(name));
|
|
2498
2538
|
const plannedPackageSelection = {
|
|
@@ -2528,6 +2568,7 @@ function buildReleasePlanSnapshot(input) {
|
|
|
2528
2568
|
stableDependencyVersions,
|
|
2529
2569
|
applicationSelection,
|
|
2530
2570
|
plannedDevReferenceRewrites,
|
|
2571
|
+
releaseOrder: plannedPackageSelection.selected,
|
|
2531
2572
|
plannedPublishWaits: plannedPackageSelection.selected.map((name) => ({
|
|
2532
2573
|
name,
|
|
2533
2574
|
workflow: releaseWorkflowForPackage(input.root, name),
|
|
@@ -5717,7 +5758,10 @@ ${rendered}`);
|
|
|
5717
5758
|
};
|
|
5718
5759
|
});
|
|
5719
5760
|
const packageReleases = [];
|
|
5720
|
-
|
|
5761
|
+
const packageRepoByName = new Map(checkedOutWorkspacePackageRepos(root).map((entry) => [entry.name, entry]));
|
|
5762
|
+
for (const packageName of selectedPackageNames) {
|
|
5763
|
+
const pkg = packageRepoByName.get(packageName);
|
|
5764
|
+
if (!pkg) continue;
|
|
5721
5765
|
const version = selectedVersions.get(pkg.name);
|
|
5722
5766
|
if (!version) continue;
|
|
5723
5767
|
const packageRelease = await executeJournalStep(root, workflowRun.runId, `release-${pkg.name}`, async () => {
|
|
@@ -5832,7 +5876,7 @@ ${rendered}`);
|
|
|
5832
5876
|
}).then((workflowGates) => ({ workflowGates })));
|
|
5833
5877
|
const productionWebVerification = await executeJournalStep(root, workflowRun.runId, "production-web-live-verification", () => runReleaseWebLiveVerification(root, "prod", helpers, "release"));
|
|
5834
5878
|
const backMerge = await executeJournalStep(root, workflowRun.runId, "release-back-merge", () => {
|
|
5835
|
-
const packageBackMerges =
|
|
5879
|
+
const packageBackMerges = selectedPackageNames.map((name) => packageRepoByName.get(name)).filter((pkg) => Boolean(pkg)).map((pkg) => backMergeProductionIntoStaging(pkg.dir, pkg.name, releaseAdminMessage({
|
|
5836
5880
|
subject: `release: back-merge ${PRODUCTION_BRANCH} into ${STAGING_BRANCH}`,
|
|
5837
5881
|
version: selectedVersions.get(pkg.name) ?? null,
|
|
5838
5882
|
sourceRef: PRODUCTION_BRANCH,
|
|
@@ -6234,6 +6278,7 @@ export {
|
|
|
6234
6278
|
normalizeReleaseCandidateMode,
|
|
6235
6279
|
normalizeSaveCiMode,
|
|
6236
6280
|
normalizeSaveLane,
|
|
6281
|
+
orderReleasePackageNames,
|
|
6237
6282
|
reconcileTreeseedBranchPreview,
|
|
6238
6283
|
shouldUseHostedSaveCi,
|
|
6239
6284
|
workflowCi,
|