@treeseed/sdk 0.12.26 → 0.12.28
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/README.md +1 -1
- package/dist/guarantees/index.js +15 -1
- package/dist/hosting/builtins.js +4 -4
- package/dist/hosting/contracts.d.ts +3 -3
- package/dist/hosting/graph.d.ts +4 -4
- package/dist/hosting/graph.js +17 -17
- package/dist/operations/agent-tools.d.ts +1 -1
- package/dist/operations/agent-tools.js +1 -1
- package/dist/operations/providers/default.js +2 -2
- package/dist/operations/services/config-runtime.d.ts +9 -9
- package/dist/operations/services/config-runtime.js +10 -10
- package/dist/operations/services/deploy.d.ts +8 -8
- package/dist/operations/services/deploy.js +151 -151
- package/dist/operations/services/github-automation.d.ts +6 -6
- package/dist/operations/services/github-automation.js +8 -8
- package/dist/operations/services/hub-launch.d.ts +1 -1
- package/dist/operations/services/hub-launch.js +1 -1
- package/dist/operations/services/package-adapters.d.ts +2 -2
- package/dist/operations/services/package-adapters.js +2 -2
- package/dist/operations/services/project-host-operations.d.ts +1 -1
- package/dist/operations/services/project-host-operations.js +1 -1
- package/dist/operations/services/project-platform.d.ts +8 -8
- package/dist/operations/services/project-platform.js +31 -31
- package/dist/operations/services/project-web-monitor.d.ts +1 -1
- package/dist/operations/services/project-web-monitor.js +4 -4
- package/dist/operations/services/railway-deploy.d.ts +4 -4
- package/dist/operations/services/railway-deploy.js +7 -7
- package/dist/operations/services/repository-save-orchestrator.js +3 -3
- package/dist/operations/services/template-secret-sync.d.ts +1 -1
- package/dist/operations/services/template-secret-sync.js +3 -3
- package/dist/reconcile/builtin-adapters.js +86 -40
- package/dist/reconcile/contracts.d.ts +1 -1
- package/dist/reconcile/engine.d.ts +4 -4
- package/dist/reconcile/engine.js +12 -12
- package/dist/reconcile/providers/release-private.d.ts +1 -1
- package/dist/scripts/tenant-deploy.js +9 -9
- package/dist/scripts/tenant-destroy.js +7 -7
- package/dist/scripts/tenant-workflow-action.js +4 -4
- package/dist/scripts/test-scaffold.js +2 -2
- package/dist/scripts/workspace-command-e2e.js +4 -4
- package/dist/sdk-types.d.ts +2 -2
- package/dist/treedx/generated/openapi-types.d.ts +11 -11
- package/dist/treedx/types.d.ts +15 -15
- package/dist/workflow/operations.d.ts +6 -4
- package/dist/workflow/operations.js +46 -23
- package/dist/workflow.d.ts +0 -9
- package/package.json +1 -1
package/dist/sdk-types.d.ts
CHANGED
|
@@ -199,7 +199,7 @@ export interface TreeDxDeploymentRequest {
|
|
|
199
199
|
volumeMountPath?: string | null;
|
|
200
200
|
publicRead?: boolean;
|
|
201
201
|
baseUrl?: string | null;
|
|
202
|
-
|
|
202
|
+
planOnly?: boolean;
|
|
203
203
|
}
|
|
204
204
|
export interface TreeDxDeploymentResult {
|
|
205
205
|
ok: boolean;
|
|
@@ -1661,7 +1661,7 @@ export interface CreateProjectWebDeploymentRequest {
|
|
|
1661
1661
|
reason?: string;
|
|
1662
1662
|
idempotencyKey?: string;
|
|
1663
1663
|
previewId?: string | null;
|
|
1664
|
-
|
|
1664
|
+
planOnly?: boolean;
|
|
1665
1665
|
confirmProduction?: boolean;
|
|
1666
1666
|
}
|
|
1667
1667
|
export interface CreateProjectWebDeploymentResponse {
|
|
@@ -351,7 +351,7 @@ export interface components {
|
|
|
351
351
|
[key: string]: unknown;
|
|
352
352
|
};
|
|
353
353
|
TreeDxArtifactCleanupRequest: {
|
|
354
|
-
|
|
354
|
+
planOnly?: boolean;
|
|
355
355
|
};
|
|
356
356
|
TreeDxArtifactCleanupResult: {
|
|
357
357
|
[key: string]: unknown;
|
|
@@ -916,7 +916,7 @@ export interface components {
|
|
|
916
916
|
remoteUrl?: string;
|
|
917
917
|
credentialId?: string;
|
|
918
918
|
refspecs?: string[];
|
|
919
|
-
|
|
919
|
+
planOnly?: boolean;
|
|
920
920
|
};
|
|
921
921
|
TreeDxFetchRemoteResult: {
|
|
922
922
|
[key: string]: unknown;
|
|
@@ -1275,7 +1275,7 @@ export interface components {
|
|
|
1275
1275
|
TreeDxMigrationRequest: {
|
|
1276
1276
|
targetNodeId?: string;
|
|
1277
1277
|
mode?: string;
|
|
1278
|
-
|
|
1278
|
+
planOnly?: boolean;
|
|
1279
1279
|
requireMirrorSynced?: boolean;
|
|
1280
1280
|
[key: string]: unknown;
|
|
1281
1281
|
};
|
|
@@ -1301,7 +1301,7 @@ export interface components {
|
|
|
1301
1301
|
TreeDxMirrorPromotionRequest: {
|
|
1302
1302
|
repoId?: string;
|
|
1303
1303
|
mirrorId: string;
|
|
1304
|
-
|
|
1304
|
+
planOnly?: boolean;
|
|
1305
1305
|
requireSynced?: boolean;
|
|
1306
1306
|
[key: string]: unknown;
|
|
1307
1307
|
};
|
|
@@ -1320,7 +1320,7 @@ export interface components {
|
|
|
1320
1320
|
remoteName?: string;
|
|
1321
1321
|
remoteUrl?: string;
|
|
1322
1322
|
credentialId?: string;
|
|
1323
|
-
|
|
1323
|
+
planOnly?: boolean;
|
|
1324
1324
|
[key: string]: unknown;
|
|
1325
1325
|
};
|
|
1326
1326
|
TreeDxMirrorSyncResult: {
|
|
@@ -1401,7 +1401,7 @@ export interface components {
|
|
|
1401
1401
|
remoteUrl?: string;
|
|
1402
1402
|
credentialId?: string;
|
|
1403
1403
|
refspecs?: string[];
|
|
1404
|
-
|
|
1404
|
+
planOnly?: boolean;
|
|
1405
1405
|
expectedRemoteHead?: string | null;
|
|
1406
1406
|
};
|
|
1407
1407
|
TreeDxPushResult: {
|
|
@@ -1623,7 +1623,7 @@ export interface components {
|
|
|
1623
1623
|
TreeDxSearchIndexCompactRequest: {
|
|
1624
1624
|
repoId?: string;
|
|
1625
1625
|
ref?: string;
|
|
1626
|
-
|
|
1626
|
+
planOnly?: boolean;
|
|
1627
1627
|
};
|
|
1628
1628
|
TreeDxSearchIndexCompactResult: {
|
|
1629
1629
|
[key: string]: unknown;
|
|
@@ -1706,7 +1706,7 @@ export interface components {
|
|
|
1706
1706
|
};
|
|
1707
1707
|
TreeDxStorageCompactRequest: {
|
|
1708
1708
|
logs?: string[];
|
|
1709
|
-
|
|
1709
|
+
planOnly?: boolean;
|
|
1710
1710
|
backupBefore?: boolean;
|
|
1711
1711
|
};
|
|
1712
1712
|
TreeDxStorageCompactResult: {
|
|
@@ -1719,13 +1719,13 @@ export interface components {
|
|
|
1719
1719
|
[key: string]: unknown;
|
|
1720
1720
|
};
|
|
1721
1721
|
TreeDxStorageMigrationPlanRequest: {
|
|
1722
|
-
|
|
1722
|
+
planOnly?: boolean;
|
|
1723
1723
|
targetVersion?: string;
|
|
1724
1724
|
[key: string]: unknown;
|
|
1725
1725
|
};
|
|
1726
1726
|
TreeDxStorageMigrationRollbackRequest: {
|
|
1727
1727
|
migrationId: string;
|
|
1728
|
-
|
|
1728
|
+
planOnly?: boolean;
|
|
1729
1729
|
[key: string]: unknown;
|
|
1730
1730
|
};
|
|
1731
1731
|
TreeDxStorageRecoverRequest: {
|
|
@@ -1737,7 +1737,7 @@ export interface components {
|
|
|
1737
1737
|
};
|
|
1738
1738
|
TreeDxStorageRestoreRequest: {
|
|
1739
1739
|
backupId: string;
|
|
1740
|
-
|
|
1740
|
+
planOnly?: boolean;
|
|
1741
1741
|
backupBeforeRestore?: boolean;
|
|
1742
1742
|
force?: boolean;
|
|
1743
1743
|
[key: string]: unknown;
|
package/dist/treedx/types.d.ts
CHANGED
|
@@ -605,12 +605,12 @@ export interface TreeDxSearchIndexStatus {
|
|
|
605
605
|
export interface TreeDxSearchIndexCompactRequest {
|
|
606
606
|
repoId?: string;
|
|
607
607
|
ref?: string;
|
|
608
|
-
|
|
608
|
+
planOnly?: boolean;
|
|
609
609
|
}
|
|
610
610
|
export interface TreeDxSearchIndexCompactResult {
|
|
611
611
|
repoId: string;
|
|
612
612
|
ref: string;
|
|
613
|
-
|
|
613
|
+
planOnly: boolean;
|
|
614
614
|
segmentsBefore: number;
|
|
615
615
|
segmentsAfter: number;
|
|
616
616
|
compacted: boolean;
|
|
@@ -859,7 +859,7 @@ export interface TreeDxMirrorSyncRequest {
|
|
|
859
859
|
remoteUrl?: string;
|
|
860
860
|
credentialId?: string;
|
|
861
861
|
refspecs?: string[];
|
|
862
|
-
|
|
862
|
+
planOnly?: boolean;
|
|
863
863
|
}
|
|
864
864
|
export interface TreeDxMirrorSyncResult {
|
|
865
865
|
mirror: TreeDxMirror;
|
|
@@ -871,7 +871,7 @@ export interface TreeDxFetchRemoteRequest {
|
|
|
871
871
|
remoteUrl?: string;
|
|
872
872
|
credentialId?: string;
|
|
873
873
|
refspecs?: string[];
|
|
874
|
-
|
|
874
|
+
planOnly?: boolean;
|
|
875
875
|
}
|
|
876
876
|
export interface TreeDxFetchRemoteResult {
|
|
877
877
|
fetch: {
|
|
@@ -895,9 +895,9 @@ export interface TreeDxPushResult {
|
|
|
895
895
|
remoteName: string;
|
|
896
896
|
remoteUrl?: string | null;
|
|
897
897
|
refspecs: string[];
|
|
898
|
-
|
|
898
|
+
planOnly?: boolean;
|
|
899
899
|
backend: string;
|
|
900
|
-
status: '
|
|
900
|
+
status: 'plan' | 'pushed' | string;
|
|
901
901
|
updatedRefs: string[];
|
|
902
902
|
rejectedRefs: string[];
|
|
903
903
|
beforeHead?: string | null;
|
|
@@ -920,14 +920,14 @@ export interface TreeDxMirrorHealthResult {
|
|
|
920
920
|
export interface TreeDxMirrorPromotionRequest {
|
|
921
921
|
repoId?: string;
|
|
922
922
|
mirrorId: string;
|
|
923
|
-
|
|
923
|
+
planOnly?: boolean;
|
|
924
924
|
requireSynced?: boolean;
|
|
925
925
|
}
|
|
926
926
|
export interface TreeDxMirrorPromotionResult {
|
|
927
927
|
promotion: {
|
|
928
928
|
mirrorId: string;
|
|
929
929
|
repoId: string;
|
|
930
|
-
|
|
930
|
+
planOnly: boolean;
|
|
931
931
|
status: 'planned' | 'promoted' | string;
|
|
932
932
|
previousPlacement?: TreeDxRepositoryPlacement | null;
|
|
933
933
|
resultingPlacement?: TreeDxRepositoryPlacement | null;
|
|
@@ -935,13 +935,13 @@ export interface TreeDxMirrorPromotionResult {
|
|
|
935
935
|
}
|
|
936
936
|
export interface TreeDxStorageCompactRequest {
|
|
937
937
|
logs?: string[];
|
|
938
|
-
|
|
938
|
+
planOnly?: boolean;
|
|
939
939
|
backupBefore?: boolean;
|
|
940
940
|
}
|
|
941
941
|
export interface TreeDxStorageCompactResult {
|
|
942
942
|
compact: {
|
|
943
943
|
status: string;
|
|
944
|
-
|
|
944
|
+
planOnly: boolean;
|
|
945
945
|
backupId?: string | null;
|
|
946
946
|
files: Array<{
|
|
947
947
|
file: string;
|
|
@@ -971,7 +971,7 @@ export interface TreeDxStorageMigration {
|
|
|
971
971
|
migrationId: string;
|
|
972
972
|
fromVersion?: string;
|
|
973
973
|
toVersion?: string;
|
|
974
|
-
|
|
974
|
+
planOnly?: boolean;
|
|
975
975
|
reversible?: boolean;
|
|
976
976
|
logs?: string[];
|
|
977
977
|
status: string;
|
|
@@ -990,7 +990,7 @@ export interface TreeDxStorageRestoreVerifyRequest {
|
|
|
990
990
|
backupId: string;
|
|
991
991
|
}
|
|
992
992
|
export interface TreeDxStorageRestoreRequest extends TreeDxStorageRestoreVerifyRequest {
|
|
993
|
-
|
|
993
|
+
planOnly?: boolean;
|
|
994
994
|
backupBeforeRestore?: boolean;
|
|
995
995
|
force?: boolean;
|
|
996
996
|
}
|
|
@@ -998,7 +998,7 @@ export interface TreeDxStorageRestoreResult {
|
|
|
998
998
|
restore: {
|
|
999
999
|
restoreId?: string;
|
|
1000
1000
|
backupId: string;
|
|
1001
|
-
|
|
1001
|
+
planOnly: boolean;
|
|
1002
1002
|
verified?: boolean;
|
|
1003
1003
|
backupBeforeRestore?: boolean;
|
|
1004
1004
|
preRestoreBackupId?: string | null;
|
|
@@ -1011,7 +1011,7 @@ export interface TreeDxMigrationRequest {
|
|
|
1011
1011
|
targetNodeId: string;
|
|
1012
1012
|
sourceNodeId?: string;
|
|
1013
1013
|
mode?: 'primary_transfer' | 'mirror_promotion';
|
|
1014
|
-
|
|
1014
|
+
planOnly?: boolean;
|
|
1015
1015
|
requireMirrorSynced?: boolean;
|
|
1016
1016
|
}
|
|
1017
1017
|
export interface TreeDxMigration {
|
|
@@ -1021,7 +1021,7 @@ export interface TreeDxMigration {
|
|
|
1021
1021
|
targetNodeId: string;
|
|
1022
1022
|
mode: string;
|
|
1023
1023
|
status: string;
|
|
1024
|
-
|
|
1024
|
+
planOnly: boolean;
|
|
1025
1025
|
requireMirrorSynced: boolean;
|
|
1026
1026
|
previousPlacement?: TreeDxRepositoryPlacement | null;
|
|
1027
1027
|
resultingPlacement?: TreeDxRepositoryPlacement | null;
|
|
@@ -103,7 +103,7 @@ export declare function reconcileTreeseedBranchPreview(input: {
|
|
|
103
103
|
root: string;
|
|
104
104
|
branch: string;
|
|
105
105
|
appId?: string[];
|
|
106
|
-
|
|
106
|
+
planOnly: boolean;
|
|
107
107
|
execute: boolean;
|
|
108
108
|
workflowRunId?: string;
|
|
109
109
|
initialize?: boolean;
|
|
@@ -117,7 +117,7 @@ export declare function reconcileTreeseedBranchPreview(input: {
|
|
|
117
117
|
export declare function destroyTreeseedBranchPreview(input: {
|
|
118
118
|
root: string;
|
|
119
119
|
branch: string;
|
|
120
|
-
|
|
120
|
+
planOnly: boolean;
|
|
121
121
|
execute: boolean;
|
|
122
122
|
reason: 'close' | 'branch-delete' | 'expired' | 'manual';
|
|
123
123
|
env?: NodeJS.ProcessEnv;
|
|
@@ -954,6 +954,7 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
954
954
|
level: "patch" | "major" | "minor";
|
|
955
955
|
fresh: boolean;
|
|
956
956
|
sceneArtifacts: "full" | "screenshots";
|
|
957
|
+
releaseImageRefs: Record<string, string>;
|
|
957
958
|
localCleanup: import("../workflow-support.js").TreeseedLocalCleanupReport | null;
|
|
958
959
|
autoResumeCandidate: {
|
|
959
960
|
runId: string;
|
|
@@ -1229,6 +1230,7 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
1229
1230
|
level: "patch" | "major" | "minor";
|
|
1230
1231
|
fresh: boolean;
|
|
1231
1232
|
sceneArtifacts: "full" | "screenshots";
|
|
1233
|
+
releaseImageRefs: Record<string, string>;
|
|
1232
1234
|
localCleanup: import("../workflow-support.js").TreeseedLocalCleanupReport | null;
|
|
1233
1235
|
freshArchivedRuns: never[];
|
|
1234
1236
|
autoResumeCandidate: {
|
|
@@ -1483,7 +1485,7 @@ export declare function workflowDestroy(helpers: WorkflowOperationHelpers, input
|
|
|
1483
1485
|
} | null;
|
|
1484
1486
|
} | null;
|
|
1485
1487
|
scope: string;
|
|
1486
|
-
|
|
1488
|
+
planOnly: boolean;
|
|
1487
1489
|
force: boolean;
|
|
1488
1490
|
deleteData: boolean;
|
|
1489
1491
|
sweepTreeseed: boolean;
|
|
@@ -1503,7 +1505,7 @@ export declare function workflowDestroy(helpers: WorkflowOperationHelpers, input
|
|
|
1503
1505
|
finalState?: WorkflowStatePayload;
|
|
1504
1506
|
timing?: TreeseedWorkflowTiming;
|
|
1505
1507
|
}> | TreeseedWorkflowResult<{
|
|
1506
|
-
|
|
1508
|
+
planOnly: boolean;
|
|
1507
1509
|
remoteResult: Record<string, unknown> | null;
|
|
1508
1510
|
scope: string;
|
|
1509
1511
|
force: boolean;
|
|
@@ -569,7 +569,7 @@ async function reconcileSaveHostedEnvironment(root, environment, helpers, workfl
|
|
|
569
569
|
target,
|
|
570
570
|
env,
|
|
571
571
|
selector,
|
|
572
|
-
|
|
572
|
+
planOnly: false,
|
|
573
573
|
write: (line) => helpers.write(`[${operation}][reconcile] ${line}`, "stderr"),
|
|
574
574
|
session: reconcileSession
|
|
575
575
|
});
|
|
@@ -683,6 +683,23 @@ function productionReleaseImageRefEnv(selectedVersions) {
|
|
|
683
683
|
}
|
|
684
684
|
return refs;
|
|
685
685
|
}
|
|
686
|
+
function productionReleaseImageRefVersions(root, selectedVersions) {
|
|
687
|
+
const versions = new Map(selectedVersions);
|
|
688
|
+
for (const adapter of discoverTreeseedPackageAdapters(root)) {
|
|
689
|
+
if (adapter.id !== "treedx" && adapter.id !== "@treeseed/treedx") continue;
|
|
690
|
+
const prodSource = stringRecord(adapter.metadata.deploymentSource)?.prod;
|
|
691
|
+
if (prodSource !== "image") continue;
|
|
692
|
+
if (versions.has(adapter.id) || !adapter.version) continue;
|
|
693
|
+
const line = stableVersionLine(adapter.version);
|
|
694
|
+
const stableVersion = (line ? highestStableGitTagOnLine(adapter.dir, line) : null) ?? adapter.version;
|
|
695
|
+
versions.set(adapter.id, stableVersion);
|
|
696
|
+
}
|
|
697
|
+
return versions;
|
|
698
|
+
}
|
|
699
|
+
function stableVersionLine(version) {
|
|
700
|
+
const match = version.match(/^(\d+\.\d+)\.\d+$/u);
|
|
701
|
+
return match?.[1] ?? null;
|
|
702
|
+
}
|
|
686
703
|
async function runReleaseApiGuarantees(root, environment, helpers, operation, sceneArtifacts) {
|
|
687
704
|
const env = {
|
|
688
705
|
...helpers.context.env,
|
|
@@ -1047,7 +1064,7 @@ ${failures.join("\n")}`, {
|
|
|
1047
1064
|
});
|
|
1048
1065
|
}
|
|
1049
1066
|
function normalizeExecutionMode(input) {
|
|
1050
|
-
return input?.plan === true
|
|
1067
|
+
return input?.plan === true ? "plan" : "execute";
|
|
1051
1068
|
}
|
|
1052
1069
|
function submodulePointerForRef(repoDir, ref, relativeDir) {
|
|
1053
1070
|
try {
|
|
@@ -2296,10 +2313,10 @@ async function workflowProof(helpers, input = {}) {
|
|
|
2296
2313
|
const timer = createTreeseedWorkflowTimer();
|
|
2297
2314
|
const tenantRoot = resolveProjectRootOrThrow("proof", helpers.cwd());
|
|
2298
2315
|
const root = workspaceRoot(tenantRoot);
|
|
2299
|
-
const action = input.action ?? (input.plan
|
|
2316
|
+
const action = input.action ?? (input.plan ? "plan" : "status");
|
|
2300
2317
|
const target = input.target ?? "staging";
|
|
2301
2318
|
const driver = input.driver ?? "github-hosted";
|
|
2302
|
-
const executionMode = action === "plan" || input.plan
|
|
2319
|
+
const executionMode = action === "plan" || input.plan ? "plan" : "execute";
|
|
2303
2320
|
let payload;
|
|
2304
2321
|
if (action === "run") {
|
|
2305
2322
|
const result = await timer.phaseAsync("proof-run", "Run release proof subjects", () => runTreeseedProof({
|
|
@@ -2925,7 +2942,7 @@ async function reconcileWorkflowBranchPreview(tenantRoot, branchName, context, {
|
|
|
2925
2942
|
return reconcileTreeseedBranchPreview({
|
|
2926
2943
|
root: tenantRoot,
|
|
2927
2944
|
branch: branchName,
|
|
2928
|
-
|
|
2945
|
+
planOnly: false,
|
|
2929
2946
|
execute: true,
|
|
2930
2947
|
workflowRunId: context.workflow?.resumeRunId ?? void 0,
|
|
2931
2948
|
initialize,
|
|
@@ -2941,16 +2958,17 @@ async function reconcileTreeseedBranchPreview(input) {
|
|
|
2941
2958
|
...input.appId?.length ? { appId: input.appId } : {}
|
|
2942
2959
|
};
|
|
2943
2960
|
const units = compileTreeseedDesiredUnitsFromGraph(graph, selector);
|
|
2944
|
-
const
|
|
2961
|
+
const planOnly = input.planOnly || !input.execute;
|
|
2962
|
+
const reconcile = planOnly ? await planTreeseedReconciliation({ tenantRoot: input.root, target, env: input.env ?? process.env, units, selector }) : await reconcileTreeseedTarget({
|
|
2945
2963
|
tenantRoot: input.root,
|
|
2946
2964
|
target,
|
|
2947
2965
|
env: input.env ?? process.env,
|
|
2948
2966
|
units,
|
|
2949
2967
|
selector,
|
|
2950
|
-
|
|
2968
|
+
planOnly: false
|
|
2951
2969
|
});
|
|
2952
2970
|
return {
|
|
2953
|
-
status:
|
|
2971
|
+
status: planOnly ? "planned" : "reconciled",
|
|
2954
2972
|
branch: input.branch,
|
|
2955
2973
|
initialize: input.initialize === true,
|
|
2956
2974
|
reconcile
|
|
@@ -2960,7 +2978,7 @@ async function destroyWorkflowBranchPreviewIfPresent(tenantRoot, branchName, con
|
|
|
2960
2978
|
return destroyTreeseedBranchPreview({
|
|
2961
2979
|
root: tenantRoot,
|
|
2962
2980
|
branch: branchName,
|
|
2963
|
-
|
|
2981
|
+
planOnly: false,
|
|
2964
2982
|
execute: true,
|
|
2965
2983
|
reason: "close",
|
|
2966
2984
|
env: context?.env
|
|
@@ -2974,7 +2992,8 @@ async function destroyTreeseedBranchPreview(input) {
|
|
|
2974
2992
|
resourceKind: ["branch-preview", "branch-preview-cleanup"]
|
|
2975
2993
|
};
|
|
2976
2994
|
const units = compileTreeseedDesiredUnitsFromGraph(graph, selector).map((unit) => unit.unitType === "branch-preview-cleanup" ? { ...unit, spec: { ...unit.spec, reason: input.reason } } : unit);
|
|
2977
|
-
const
|
|
2995
|
+
const planOnly = input.planOnly || !input.execute;
|
|
2996
|
+
const reconcile = planOnly ? await planTreeseedReconciliation({ tenantRoot: input.root, target, env: input.env ?? process.env, units, selector }) : await destroyTreeseedTargetUnits({
|
|
2978
2997
|
tenantRoot: input.root,
|
|
2979
2998
|
target,
|
|
2980
2999
|
env: input.env ?? process.env,
|
|
@@ -2982,14 +3001,14 @@ async function destroyTreeseedBranchPreview(input) {
|
|
|
2982
3001
|
selector
|
|
2983
3002
|
});
|
|
2984
3003
|
return {
|
|
2985
|
-
status:
|
|
3004
|
+
status: planOnly ? "planned" : "destroyed",
|
|
2986
3005
|
branch: input.branch,
|
|
2987
3006
|
reason: input.reason,
|
|
2988
3007
|
reconcile
|
|
2989
3008
|
};
|
|
2990
3009
|
}
|
|
2991
3010
|
function resolveDestroyConfirmation(context, expected, input) {
|
|
2992
|
-
if (input.
|
|
3011
|
+
if (input.plan) {
|
|
2993
3012
|
return true;
|
|
2994
3013
|
}
|
|
2995
3014
|
if (input.confirm === true) {
|
|
@@ -3648,7 +3667,7 @@ async function workflowSwitch(helpers, input) {
|
|
|
3648
3667
|
const previewPlan = preview ? await reconcileTreeseedBranchPreview({
|
|
3649
3668
|
root,
|
|
3650
3669
|
branch: branchName,
|
|
3651
|
-
|
|
3670
|
+
planOnly: true,
|
|
3652
3671
|
execute: false,
|
|
3653
3672
|
initialize: !branchPreviewInitialized(root, branchName),
|
|
3654
3673
|
env: helpers.context.env
|
|
@@ -5426,7 +5445,7 @@ ${blockers.join("\n")}`, {
|
|
|
5426
5445
|
env: reconcileEnv,
|
|
5427
5446
|
units,
|
|
5428
5447
|
selector: unitSelector,
|
|
5429
|
-
|
|
5448
|
+
planOnly: false,
|
|
5430
5449
|
write: (line) => helpers.write(`[${operation}][reconcile] ${line}`, "stderr")
|
|
5431
5450
|
}) : null;
|
|
5432
5451
|
const payload = {
|
|
@@ -5540,6 +5559,9 @@ async function workflowRelease(helpers, input) {
|
|
|
5540
5559
|
level,
|
|
5541
5560
|
repairVersionLine: effectiveInput.repairVersionLine === true
|
|
5542
5561
|
});
|
|
5562
|
+
const selectedVersions = releasePlanVersionMap(plannedRelease.plannedVersions);
|
|
5563
|
+
const releaseImageVersions = productionReleaseImageRefVersions(root, selectedVersions);
|
|
5564
|
+
const releaseImageRefs = productionReleaseImageRefEnv(releaseImageVersions);
|
|
5543
5565
|
traceReleaseStartup("collect production readiness");
|
|
5544
5566
|
const plannedReadiness = collectTreeseedDeploymentReadiness({
|
|
5545
5567
|
tenantRoot: root,
|
|
@@ -5555,6 +5577,7 @@ async function workflowRelease(helpers, input) {
|
|
|
5555
5577
|
level,
|
|
5556
5578
|
fresh: input.fresh === true,
|
|
5557
5579
|
sceneArtifacts: normalizeSceneArtifactsMode(effectiveInput.sceneArtifacts),
|
|
5580
|
+
releaseImageRefs,
|
|
5558
5581
|
localCleanup,
|
|
5559
5582
|
freshArchivedRuns: [],
|
|
5560
5583
|
autoResumeCandidate: planAutoResumeRun ? {
|
|
@@ -5572,7 +5595,8 @@ async function workflowRelease(helpers, input) {
|
|
|
5572
5595
|
{ kind: "persistent", scope: "prod" },
|
|
5573
5596
|
{
|
|
5574
5597
|
plan: true,
|
|
5575
|
-
verifyDeployedResources: effectiveInput.verifyDeployedResources
|
|
5598
|
+
verifyDeployedResources: effectiveInput.verifyDeployedResources,
|
|
5599
|
+
releaseImageRefs
|
|
5576
5600
|
},
|
|
5577
5601
|
releaseBasePayload
|
|
5578
5602
|
);
|
|
@@ -5587,7 +5611,6 @@ ${blockers.join("\n")}`, {
|
|
|
5587
5611
|
traceReleaseStartup("prepare fresh release");
|
|
5588
5612
|
const freshPreparation = input.fresh === true ? prepareFreshReleaseRun(root, session.branchName, rootRepo, packageReports) : { archived: [], blockers: [] };
|
|
5589
5613
|
traceReleaseStartup("compute versions");
|
|
5590
|
-
const selectedVersions = releasePlanVersionMap(plannedRelease.plannedVersions);
|
|
5591
5614
|
const stableVersions = new Map([
|
|
5592
5615
|
...releasePlanStableDependencyVersionMap(plannedRelease).entries(),
|
|
5593
5616
|
...selectedVersions.entries()
|
|
@@ -5658,7 +5681,7 @@ ${blockers.join("\n")}`, {
|
|
|
5658
5681
|
{
|
|
5659
5682
|
execute: true,
|
|
5660
5683
|
verifyDeployedResources: effectiveInput.verifyDeployedResources,
|
|
5661
|
-
releaseImageRefs
|
|
5684
|
+
releaseImageRefs
|
|
5662
5685
|
},
|
|
5663
5686
|
{
|
|
5664
5687
|
...releaseBasePayload,
|
|
@@ -5751,7 +5774,7 @@ ${rendered}`);
|
|
|
5751
5774
|
onProgress: (line, stream) => helpers.write(line, stream)
|
|
5752
5775
|
}).then((workflowGates) => ({ workflowGates }));
|
|
5753
5776
|
});
|
|
5754
|
-
const productionHosting = await executeJournalStep(root, workflowRun.runId, "production-hosting", () => reconcileSaveHostedEnvironment(root, "prod", helpers, workflowRun.runId, "release",
|
|
5777
|
+
const productionHosting = await executeJournalStep(root, workflowRun.runId, "production-hosting", () => reconcileSaveHostedEnvironment(root, "prod", helpers, workflowRun.runId, "release", releaseImageRefs, { liveAppId: "api" }));
|
|
5755
5778
|
const productionApiGuarantees = await executeJournalStep(root, workflowRun.runId, "production-api-guarantees", () => runReleaseApiGuarantees(root, "prod", helpers, "release", normalizeSceneArtifactsMode(effectiveInput.sceneArtifacts)));
|
|
5756
5779
|
const rootRelease = await executeJournalStep(root, workflowRun.runId, "release-root", () => {
|
|
5757
5780
|
const rootInstall = runReleaseNpmInstall(root, { workspaceRoot: root });
|
|
@@ -6065,7 +6088,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
6065
6088
|
}
|
|
6066
6089
|
const executionMode = normalizeExecutionMode(input);
|
|
6067
6090
|
const target = createPersistentDeployTarget(scope);
|
|
6068
|
-
const
|
|
6091
|
+
const planOnly = executionMode === "plan";
|
|
6069
6092
|
const force = input.force === true;
|
|
6070
6093
|
const deleteData = input.deleteData === true;
|
|
6071
6094
|
const sweepTreeseed = input.sweepTreeseed === true;
|
|
@@ -6079,7 +6102,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
6079
6102
|
const expectedConfirmation = deployConfig.slug;
|
|
6080
6103
|
const payload = {
|
|
6081
6104
|
scope,
|
|
6082
|
-
|
|
6105
|
+
planOnly,
|
|
6083
6106
|
force,
|
|
6084
6107
|
deleteData,
|
|
6085
6108
|
sweepTreeseed,
|
|
@@ -6099,7 +6122,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
6099
6122
|
remoteResult: null
|
|
6100
6123
|
};
|
|
6101
6124
|
if (executionMode === "plan") {
|
|
6102
|
-
const plannedRemoteResult = destroyRemote ? await destroyTreeseedEnvironmentResources(tenantRoot, {
|
|
6125
|
+
const plannedRemoteResult = destroyRemote ? await destroyTreeseedEnvironmentResources(tenantRoot, { planOnly: true, force, deleteData, sweepTreeseed, target }) : null;
|
|
6103
6126
|
return buildWorkflowResult(
|
|
6104
6127
|
"destroy",
|
|
6105
6128
|
tenantRoot,
|
|
@@ -6153,7 +6176,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
6153
6176
|
if (!confirmed) {
|
|
6154
6177
|
workflowError("destroy", "confirmation_required", `Destroy confirmation required. Re-run with confirm="${expectedConfirmation}".`);
|
|
6155
6178
|
}
|
|
6156
|
-
const remoteResult = destroyRemote ? await executeJournalStep(root, workflowRun.runId, "destroy-remote", () => destroyTreeseedEnvironmentResources(tenantRoot, {
|
|
6179
|
+
const remoteResult = destroyRemote ? await executeJournalStep(root, workflowRun.runId, "destroy-remote", () => destroyTreeseedEnvironmentResources(tenantRoot, { planOnly: false, force, deleteData, sweepTreeseed, target })) : null;
|
|
6157
6180
|
if (!destroyRemote) {
|
|
6158
6181
|
skipJournalStep(root, workflowRun.runId, "destroy-remote", { skippedReason: "destroyRemote=false" });
|
|
6159
6182
|
}
|
|
@@ -6170,7 +6193,7 @@ async function workflowDestroy(helpers, input) {
|
|
|
6170
6193
|
}
|
|
6171
6194
|
const resultPayload = {
|
|
6172
6195
|
...payload,
|
|
6173
|
-
|
|
6196
|
+
planOnly: false,
|
|
6174
6197
|
remoteResult
|
|
6175
6198
|
};
|
|
6176
6199
|
completeWorkflowRun(root, workflowRun.runId, resultPayload);
|
package/dist/workflow.d.ts
CHANGED
|
@@ -122,7 +122,6 @@ export type TreeseedSaveInput = {
|
|
|
122
122
|
skipCleanup?: boolean;
|
|
123
123
|
sceneArtifacts?: 'full' | 'screenshots';
|
|
124
124
|
plan?: boolean;
|
|
125
|
-
dryRun?: boolean;
|
|
126
125
|
};
|
|
127
126
|
export type TreeseedUpdateInput = {
|
|
128
127
|
from?: string;
|
|
@@ -131,7 +130,6 @@ export type TreeseedUpdateInput = {
|
|
|
131
130
|
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
132
131
|
workspaceLinks?: 'auto' | 'off';
|
|
133
132
|
plan?: boolean;
|
|
134
|
-
dryRun?: boolean;
|
|
135
133
|
};
|
|
136
134
|
export type TreeseedCiInput = {
|
|
137
135
|
failed?: boolean;
|
|
@@ -161,7 +159,6 @@ export type TreeseedCloseInput = {
|
|
|
161
159
|
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
162
160
|
workspaceLinks?: 'auto' | 'off';
|
|
163
161
|
plan?: boolean;
|
|
164
|
-
dryRun?: boolean;
|
|
165
162
|
};
|
|
166
163
|
export type TreeseedStageInput = {
|
|
167
164
|
message: string;
|
|
@@ -180,7 +177,6 @@ export type TreeseedStageInput = {
|
|
|
180
177
|
skipCleanup?: boolean;
|
|
181
178
|
sceneArtifacts?: 'full' | 'screenshots';
|
|
182
179
|
plan?: boolean;
|
|
183
|
-
dryRun?: boolean;
|
|
184
180
|
};
|
|
185
181
|
export type TreeseedReleaseCandidateInput = {
|
|
186
182
|
mode?: TreeseedReleaseCandidateMode;
|
|
@@ -188,7 +184,6 @@ export type TreeseedReleaseCandidateInput = {
|
|
|
188
184
|
package?: string | string[];
|
|
189
185
|
keepWorkspace?: boolean;
|
|
190
186
|
plan?: boolean;
|
|
191
|
-
dryRun?: boolean;
|
|
192
187
|
};
|
|
193
188
|
export type TreeseedProofInput = {
|
|
194
189
|
action?: 'plan' | 'run' | 'status' | 'failures' | 'explain' | 'clean';
|
|
@@ -198,7 +193,6 @@ export type TreeseedProofInput = {
|
|
|
198
193
|
last?: boolean;
|
|
199
194
|
olderThan?: string | null;
|
|
200
195
|
plan?: boolean;
|
|
201
|
-
dryRun?: boolean;
|
|
202
196
|
};
|
|
203
197
|
export type TreeseedSwitchInput = {
|
|
204
198
|
branch?: string;
|
|
@@ -209,7 +203,6 @@ export type TreeseedSwitchInput = {
|
|
|
209
203
|
worktreeMode?: TreeseedWorkflowWorktreeMode;
|
|
210
204
|
workspaceLinks?: 'auto' | 'off';
|
|
211
205
|
plan?: boolean;
|
|
212
|
-
dryRun?: boolean;
|
|
213
206
|
};
|
|
214
207
|
export type TreeseedConfigScope = 'all' | 'local' | 'staging' | 'prod';
|
|
215
208
|
export type TreeseedBootstrapSystem = 'all' | 'github' | 'data' | 'web' | 'api' | 'agents';
|
|
@@ -265,7 +258,6 @@ export type TreeseedReleaseInput = {
|
|
|
265
258
|
skipCleanup?: boolean;
|
|
266
259
|
sceneArtifacts?: 'full' | 'screenshots';
|
|
267
260
|
plan?: boolean;
|
|
268
|
-
dryRun?: boolean;
|
|
269
261
|
};
|
|
270
262
|
export type TreeseedResumeInput = {
|
|
271
263
|
runId: string;
|
|
@@ -280,7 +272,6 @@ export type TreeseedDestroyInput = {
|
|
|
280
272
|
target?: 'local' | 'staging' | 'prod';
|
|
281
273
|
environment?: 'local' | 'staging' | 'prod';
|
|
282
274
|
confirm?: boolean | string;
|
|
283
|
-
dryRun?: boolean;
|
|
284
275
|
plan?: boolean;
|
|
285
276
|
destroyRemote?: boolean;
|
|
286
277
|
destroyLocal?: boolean;
|