@treeseed/sdk 0.12.39 → 0.12.41
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.
|
@@ -1192,6 +1192,20 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
1192
1192
|
};
|
|
1193
1193
|
};
|
|
1194
1194
|
productionWebVerification: Record<string, unknown> | null;
|
|
1195
|
+
productionFinalGuarantees: {
|
|
1196
|
+
ok: true;
|
|
1197
|
+
environment: string;
|
|
1198
|
+
runId: string;
|
|
1199
|
+
outputRoot: string;
|
|
1200
|
+
counts: {
|
|
1201
|
+
planned: number;
|
|
1202
|
+
passed: number;
|
|
1203
|
+
failed: number;
|
|
1204
|
+
skipped: number;
|
|
1205
|
+
blocked: number;
|
|
1206
|
+
releaseBlockingFailures: number;
|
|
1207
|
+
};
|
|
1208
|
+
};
|
|
1195
1209
|
backMerge: {
|
|
1196
1210
|
packages: {
|
|
1197
1211
|
status: string;
|
|
@@ -762,6 +762,54 @@ ${diagnostics.join("\n") || `See ${report.outputRoot}`}`, {
|
|
|
762
762
|
};
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
|
+
async function runReleaseProductionGuarantees(root, helpers, operation, sceneArtifacts) {
|
|
766
|
+
const environment = "prod";
|
|
767
|
+
const env = {
|
|
768
|
+
...helpers.context.env,
|
|
769
|
+
...collectTreeseedConfigSeedValues(root, environment, helpers.context.env)
|
|
770
|
+
};
|
|
771
|
+
env.TREESEED_ACCEPTANCE_SERVICE_ID ??= env.TREESEED_API_WEB_SERVICE_ID ?? env.TREESEED_WEB_SERVICE_ID;
|
|
772
|
+
env.TREESEED_ACCEPTANCE_SERVICE_SECRET ??= env.TREESEED_API_WEB_SERVICE_SECRET ?? env.TREESEED_WEB_SERVICE_SECRET;
|
|
773
|
+
if (!env.TREESEED_ACCEPTANCE_SERVICE_ID || !env.TREESEED_ACCEPTANCE_SERVICE_SECRET) {
|
|
774
|
+
workflowError(operation, "release_gate_failed", "Final production release guarantees cannot run because production acceptance service credentials are missing.", {
|
|
775
|
+
details: {
|
|
776
|
+
environment,
|
|
777
|
+
missing: [
|
|
778
|
+
!env.TREESEED_ACCEPTANCE_SERVICE_ID ? "TREESEED_ACCEPTANCE_SERVICE_ID" : null,
|
|
779
|
+
!env.TREESEED_ACCEPTANCE_SERVICE_SECRET ? "TREESEED_ACCEPTANCE_SERVICE_SECRET" : null
|
|
780
|
+
].filter((value) => Boolean(value))
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
helpers.write(`[${operation}][workflow] Running final production release guarantees against the fully deployed production environment.`);
|
|
785
|
+
return await withContextEnv(env, async () => {
|
|
786
|
+
const report = await runTreeseedGuarantees({
|
|
787
|
+
workspaceRoot: root,
|
|
788
|
+
environment,
|
|
789
|
+
evidenceTarget: "release",
|
|
790
|
+
sceneArtifacts
|
|
791
|
+
});
|
|
792
|
+
if (!report.ok) {
|
|
793
|
+
const diagnostics = report.diagnostics.filter((entry) => entry.severity === "error").slice(0, 20).map((entry) => `${entry.code}: ${entry.message}${entry.sourcePath ? ` (${entry.sourcePath})` : ""}`);
|
|
794
|
+
const failedGuarantees = report.results.filter((entry) => entry.status === "failed" || entry.status === "blocked").slice(0, 20).map((entry) => `${entry.id}: ${entry.status}`);
|
|
795
|
+
workflowError(operation, "release_gate_failed", [
|
|
796
|
+
"Final production release guarantees failed after production deployment.",
|
|
797
|
+
...failedGuarantees,
|
|
798
|
+
...diagnostics,
|
|
799
|
+
failedGuarantees.length === 0 && diagnostics.length === 0 ? `See ${report.outputRoot}` : null
|
|
800
|
+
].filter((line) => Boolean(line)).join("\n"), {
|
|
801
|
+
details: { environment, outputRoot: report.outputRoot, counts: report.counts, diagnostics: report.diagnostics }
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
return {
|
|
805
|
+
ok: report.ok,
|
|
806
|
+
environment: report.environment,
|
|
807
|
+
runId: report.runId,
|
|
808
|
+
outputRoot: report.outputRoot,
|
|
809
|
+
counts: report.counts
|
|
810
|
+
};
|
|
811
|
+
});
|
|
812
|
+
}
|
|
765
813
|
function recordHostedDeploymentStatesFromRootGates(root, rootRelease, workflowGates) {
|
|
766
814
|
const gates = Array.isArray(workflowGates) ? workflowGates.map((gate) => stringRecord(gate)).filter((gate) => Boolean(gate)) : [];
|
|
767
815
|
const releaseRecord = stringRecord(rootRelease) ?? {};
|
|
@@ -5697,6 +5745,7 @@ ${blockers.join("\n")}`, {
|
|
|
5697
5745
|
{ id: "release-root", description: `Release market ${plannedRelease.rootVersion}`, repoName: rootRepo.name, repoPath: rootRepo.path, branch: STAGING_BRANCH, resumable: true },
|
|
5698
5746
|
{ id: "publish-wait", description: "Wait for production release workflows", repoName: rootRepo.name, repoPath: rootRepo.path, branch: PRODUCTION_BRANCH, resumable: true },
|
|
5699
5747
|
{ id: "production-web-live-verification", description: "Run production web live verification after root deploy", repoName: rootRepo.name, repoPath: rootRepo.path, branch: PRODUCTION_BRANCH, resumable: true },
|
|
5748
|
+
{ id: "production-final-guarantees", description: "Run final production release guarantees after all production deploys", repoName: rootRepo.name, repoPath: rootRepo.path, branch: PRODUCTION_BRANCH, resumable: true },
|
|
5700
5749
|
{ id: "release-back-merge", description: "Back-merge production release history into staging", repoName: rootRepo.name, repoPath: rootRepo.path, branch: STAGING_BRANCH, resumable: true },
|
|
5701
5750
|
{ id: "workspace-link", description: "Restore local workspace links after release", repoName: rootRepo.name, repoPath: rootRepo.path, branch: STAGING_BRANCH, resumable: true }
|
|
5702
5751
|
],
|
|
@@ -5875,6 +5924,7 @@ ${rendered}`);
|
|
|
5875
5924
|
onProgress: (line, stream) => helpers.write(line, stream)
|
|
5876
5925
|
}).then((workflowGates) => ({ workflowGates })));
|
|
5877
5926
|
const productionWebVerification = await executeJournalStep(root, workflowRun.runId, "production-web-live-verification", () => runReleaseWebLiveVerification(root, "prod", helpers, "release"));
|
|
5927
|
+
const productionFinalGuarantees = await executeJournalStep(root, workflowRun.runId, "production-final-guarantees", () => runReleaseProductionGuarantees(root, helpers, "release", normalizeSceneArtifactsMode(effectiveInput.sceneArtifacts)));
|
|
5878
5928
|
const backMerge = await executeJournalStep(root, workflowRun.runId, "release-back-merge", () => {
|
|
5879
5929
|
const packageBackMerges = selectedPackageNames.map((name) => packageRepoByName.get(name)).filter((pkg) => Boolean(pkg)).map((pkg) => backMergeProductionIntoStaging(pkg.dir, pkg.name, releaseAdminMessage({
|
|
5880
5930
|
subject: `release: back-merge ${PRODUCTION_BRANCH} into ${STAGING_BRANCH}`,
|
|
@@ -5905,6 +5955,7 @@ ${rendered}`);
|
|
|
5905
5955
|
productionHosting,
|
|
5906
5956
|
productionApiGuarantees,
|
|
5907
5957
|
productionWebVerification,
|
|
5958
|
+
productionFinalGuarantees,
|
|
5908
5959
|
backMerge,
|
|
5909
5960
|
workspaceLinks,
|
|
5910
5961
|
releasedCommit: String(rootRelease.commit.commitSha ?? ""),
|