@treeseed/sdk 0.6.44 → 0.6.45
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/operations/services/project-platform.d.ts +4 -452
- package/dist/operations/services/project-platform.js +1 -1
- package/dist/operations/services/railway-deploy.d.ts +43 -114
- package/dist/operations/services/railway-deploy.js +135 -2
- package/dist/workflow/operations.js +10 -2
- package/package.json +1 -1
|
@@ -139,119 +139,7 @@ export declare function deployProjectPlatform(options: ProjectPlatformActionOpti
|
|
|
139
139
|
};
|
|
140
140
|
railwayResources: {
|
|
141
141
|
ok: boolean;
|
|
142
|
-
checks:
|
|
143
|
-
type: string;
|
|
144
|
-
service: string;
|
|
145
|
-
serviceName: string;
|
|
146
|
-
projectName: string;
|
|
147
|
-
environment: string;
|
|
148
|
-
ok: boolean;
|
|
149
|
-
status: string;
|
|
150
|
-
message: string;
|
|
151
|
-
serviceId?: undefined;
|
|
152
|
-
projectId?: undefined;
|
|
153
|
-
environmentId?: undefined;
|
|
154
|
-
instanceId?: undefined;
|
|
155
|
-
observed?: undefined;
|
|
156
|
-
volumeName?: undefined;
|
|
157
|
-
mountPath?: undefined;
|
|
158
|
-
} | {
|
|
159
|
-
type: string;
|
|
160
|
-
service: string;
|
|
161
|
-
serviceName: string;
|
|
162
|
-
serviceId: string;
|
|
163
|
-
projectId: string;
|
|
164
|
-
environment: string;
|
|
165
|
-
environmentId: string;
|
|
166
|
-
instanceId: string | null;
|
|
167
|
-
ok: boolean;
|
|
168
|
-
status: string;
|
|
169
|
-
observed: {
|
|
170
|
-
rootDirectory: string | null;
|
|
171
|
-
startCommand: string | null;
|
|
172
|
-
cronSchedule: string | null;
|
|
173
|
-
sleepApplication: boolean | null;
|
|
174
|
-
runtimeMode: string | null;
|
|
175
|
-
id?: undefined;
|
|
176
|
-
name?: undefined;
|
|
177
|
-
instances?: undefined;
|
|
178
|
-
} | null;
|
|
179
|
-
message: string | undefined;
|
|
180
|
-
projectName?: undefined;
|
|
181
|
-
volumeName?: undefined;
|
|
182
|
-
mountPath?: undefined;
|
|
183
|
-
} | {
|
|
184
|
-
type: string;
|
|
185
|
-
service: string;
|
|
186
|
-
serviceName: string;
|
|
187
|
-
serviceId: string;
|
|
188
|
-
projectId: string;
|
|
189
|
-
environment: string;
|
|
190
|
-
environmentId: string;
|
|
191
|
-
volumeName: string;
|
|
192
|
-
mountPath: string;
|
|
193
|
-
ok: boolean;
|
|
194
|
-
status: string;
|
|
195
|
-
observed: {
|
|
196
|
-
id: string;
|
|
197
|
-
name: string;
|
|
198
|
-
instances: import("./railway-api.ts").RailwayVolumeInstanceSummary[];
|
|
199
|
-
rootDirectory?: undefined;
|
|
200
|
-
startCommand?: undefined;
|
|
201
|
-
cronSchedule?: undefined;
|
|
202
|
-
sleepApplication?: undefined;
|
|
203
|
-
runtimeMode?: undefined;
|
|
204
|
-
} | null;
|
|
205
|
-
message: string | undefined;
|
|
206
|
-
projectName?: undefined;
|
|
207
|
-
instanceId?: undefined;
|
|
208
|
-
} | {
|
|
209
|
-
id: null;
|
|
210
|
-
ok: boolean;
|
|
211
|
-
status: string;
|
|
212
|
-
message: string;
|
|
213
|
-
service: string;
|
|
214
|
-
projectId: string | null;
|
|
215
|
-
projectName: string;
|
|
216
|
-
serviceId: string | null;
|
|
217
|
-
serviceName: string;
|
|
218
|
-
environment: string;
|
|
219
|
-
environmentId: string | null;
|
|
220
|
-
expression: string;
|
|
221
|
-
command: string | null;
|
|
222
|
-
enabled: boolean;
|
|
223
|
-
logicalName: string;
|
|
224
|
-
type: string;
|
|
225
|
-
instanceId?: undefined;
|
|
226
|
-
observed?: undefined;
|
|
227
|
-
volumeName?: undefined;
|
|
228
|
-
mountPath?: undefined;
|
|
229
|
-
} | {
|
|
230
|
-
id: string | null;
|
|
231
|
-
projectId: string;
|
|
232
|
-
serviceId: string;
|
|
233
|
-
environmentId: string;
|
|
234
|
-
ok: boolean;
|
|
235
|
-
status: string;
|
|
236
|
-
observed: {
|
|
237
|
-
expression: string | null;
|
|
238
|
-
command: string | null;
|
|
239
|
-
enabled: boolean;
|
|
240
|
-
} | null;
|
|
241
|
-
message: string | undefined;
|
|
242
|
-
service: string;
|
|
243
|
-
projectName: string;
|
|
244
|
-
serviceName: string;
|
|
245
|
-
environment: string;
|
|
246
|
-
expression: string;
|
|
247
|
-
command: string | null;
|
|
248
|
-
enabled: boolean;
|
|
249
|
-
logicalName: string;
|
|
250
|
-
type: string;
|
|
251
|
-
instanceId?: undefined;
|
|
252
|
-
volumeName?: undefined;
|
|
253
|
-
mountPath?: undefined;
|
|
254
|
-
})[];
|
|
142
|
+
checks: any[];
|
|
255
143
|
} | {
|
|
256
144
|
ok: boolean;
|
|
257
145
|
skipped: boolean;
|
|
@@ -437,119 +325,7 @@ export declare function monitorProjectPlatform(options: ProjectPlatformActionOpt
|
|
|
437
325
|
};
|
|
438
326
|
railwayResources: {
|
|
439
327
|
ok: boolean;
|
|
440
|
-
checks:
|
|
441
|
-
type: string;
|
|
442
|
-
service: string;
|
|
443
|
-
serviceName: string;
|
|
444
|
-
projectName: string;
|
|
445
|
-
environment: string;
|
|
446
|
-
ok: boolean;
|
|
447
|
-
status: string;
|
|
448
|
-
message: string;
|
|
449
|
-
serviceId?: undefined;
|
|
450
|
-
projectId?: undefined;
|
|
451
|
-
environmentId?: undefined;
|
|
452
|
-
instanceId?: undefined;
|
|
453
|
-
observed?: undefined;
|
|
454
|
-
volumeName?: undefined;
|
|
455
|
-
mountPath?: undefined;
|
|
456
|
-
} | {
|
|
457
|
-
type: string;
|
|
458
|
-
service: string;
|
|
459
|
-
serviceName: string;
|
|
460
|
-
serviceId: string;
|
|
461
|
-
projectId: string;
|
|
462
|
-
environment: string;
|
|
463
|
-
environmentId: string;
|
|
464
|
-
instanceId: string | null;
|
|
465
|
-
ok: boolean;
|
|
466
|
-
status: string;
|
|
467
|
-
observed: {
|
|
468
|
-
rootDirectory: string | null;
|
|
469
|
-
startCommand: string | null;
|
|
470
|
-
cronSchedule: string | null;
|
|
471
|
-
sleepApplication: boolean | null;
|
|
472
|
-
runtimeMode: string | null;
|
|
473
|
-
id?: undefined;
|
|
474
|
-
name?: undefined;
|
|
475
|
-
instances?: undefined;
|
|
476
|
-
} | null;
|
|
477
|
-
message: string | undefined;
|
|
478
|
-
projectName?: undefined;
|
|
479
|
-
volumeName?: undefined;
|
|
480
|
-
mountPath?: undefined;
|
|
481
|
-
} | {
|
|
482
|
-
type: string;
|
|
483
|
-
service: string;
|
|
484
|
-
serviceName: string;
|
|
485
|
-
serviceId: string;
|
|
486
|
-
projectId: string;
|
|
487
|
-
environment: string;
|
|
488
|
-
environmentId: string;
|
|
489
|
-
volumeName: string;
|
|
490
|
-
mountPath: string;
|
|
491
|
-
ok: boolean;
|
|
492
|
-
status: string;
|
|
493
|
-
observed: {
|
|
494
|
-
id: string;
|
|
495
|
-
name: string;
|
|
496
|
-
instances: import("./railway-api.ts").RailwayVolumeInstanceSummary[];
|
|
497
|
-
rootDirectory?: undefined;
|
|
498
|
-
startCommand?: undefined;
|
|
499
|
-
cronSchedule?: undefined;
|
|
500
|
-
sleepApplication?: undefined;
|
|
501
|
-
runtimeMode?: undefined;
|
|
502
|
-
} | null;
|
|
503
|
-
message: string | undefined;
|
|
504
|
-
projectName?: undefined;
|
|
505
|
-
instanceId?: undefined;
|
|
506
|
-
} | {
|
|
507
|
-
id: null;
|
|
508
|
-
ok: boolean;
|
|
509
|
-
status: string;
|
|
510
|
-
message: string;
|
|
511
|
-
service: string;
|
|
512
|
-
projectId: string | null;
|
|
513
|
-
projectName: string;
|
|
514
|
-
serviceId: string | null;
|
|
515
|
-
serviceName: string;
|
|
516
|
-
environment: string;
|
|
517
|
-
environmentId: string | null;
|
|
518
|
-
expression: string;
|
|
519
|
-
command: string | null;
|
|
520
|
-
enabled: boolean;
|
|
521
|
-
logicalName: string;
|
|
522
|
-
type: string;
|
|
523
|
-
instanceId?: undefined;
|
|
524
|
-
observed?: undefined;
|
|
525
|
-
volumeName?: undefined;
|
|
526
|
-
mountPath?: undefined;
|
|
527
|
-
} | {
|
|
528
|
-
id: string | null;
|
|
529
|
-
projectId: string;
|
|
530
|
-
serviceId: string;
|
|
531
|
-
environmentId: string;
|
|
532
|
-
ok: boolean;
|
|
533
|
-
status: string;
|
|
534
|
-
observed: {
|
|
535
|
-
expression: string | null;
|
|
536
|
-
command: string | null;
|
|
537
|
-
enabled: boolean;
|
|
538
|
-
} | null;
|
|
539
|
-
message: string | undefined;
|
|
540
|
-
service: string;
|
|
541
|
-
projectName: string;
|
|
542
|
-
serviceName: string;
|
|
543
|
-
environment: string;
|
|
544
|
-
expression: string;
|
|
545
|
-
command: string | null;
|
|
546
|
-
enabled: boolean;
|
|
547
|
-
logicalName: string;
|
|
548
|
-
type: string;
|
|
549
|
-
instanceId?: undefined;
|
|
550
|
-
volumeName?: undefined;
|
|
551
|
-
mountPath?: undefined;
|
|
552
|
-
})[];
|
|
328
|
+
checks: any[];
|
|
553
329
|
} | {
|
|
554
330
|
ok: boolean;
|
|
555
331
|
skipped: boolean;
|
|
@@ -740,119 +516,7 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
|
|
|
740
516
|
};
|
|
741
517
|
railwayResources: {
|
|
742
518
|
ok: boolean;
|
|
743
|
-
checks:
|
|
744
|
-
type: string;
|
|
745
|
-
service: string;
|
|
746
|
-
serviceName: string;
|
|
747
|
-
projectName: string;
|
|
748
|
-
environment: string;
|
|
749
|
-
ok: boolean;
|
|
750
|
-
status: string;
|
|
751
|
-
message: string;
|
|
752
|
-
serviceId?: undefined;
|
|
753
|
-
projectId?: undefined;
|
|
754
|
-
environmentId?: undefined;
|
|
755
|
-
instanceId?: undefined;
|
|
756
|
-
observed?: undefined;
|
|
757
|
-
volumeName?: undefined;
|
|
758
|
-
mountPath?: undefined;
|
|
759
|
-
} | {
|
|
760
|
-
type: string;
|
|
761
|
-
service: string;
|
|
762
|
-
serviceName: string;
|
|
763
|
-
serviceId: string;
|
|
764
|
-
projectId: string;
|
|
765
|
-
environment: string;
|
|
766
|
-
environmentId: string;
|
|
767
|
-
instanceId: string | null;
|
|
768
|
-
ok: boolean;
|
|
769
|
-
status: string;
|
|
770
|
-
observed: {
|
|
771
|
-
rootDirectory: string | null;
|
|
772
|
-
startCommand: string | null;
|
|
773
|
-
cronSchedule: string | null;
|
|
774
|
-
sleepApplication: boolean | null;
|
|
775
|
-
runtimeMode: string | null;
|
|
776
|
-
id?: undefined;
|
|
777
|
-
name?: undefined;
|
|
778
|
-
instances?: undefined;
|
|
779
|
-
} | null;
|
|
780
|
-
message: string | undefined;
|
|
781
|
-
projectName?: undefined;
|
|
782
|
-
volumeName?: undefined;
|
|
783
|
-
mountPath?: undefined;
|
|
784
|
-
} | {
|
|
785
|
-
type: string;
|
|
786
|
-
service: string;
|
|
787
|
-
serviceName: string;
|
|
788
|
-
serviceId: string;
|
|
789
|
-
projectId: string;
|
|
790
|
-
environment: string;
|
|
791
|
-
environmentId: string;
|
|
792
|
-
volumeName: string;
|
|
793
|
-
mountPath: string;
|
|
794
|
-
ok: boolean;
|
|
795
|
-
status: string;
|
|
796
|
-
observed: {
|
|
797
|
-
id: string;
|
|
798
|
-
name: string;
|
|
799
|
-
instances: import("./railway-api.ts").RailwayVolumeInstanceSummary[];
|
|
800
|
-
rootDirectory?: undefined;
|
|
801
|
-
startCommand?: undefined;
|
|
802
|
-
cronSchedule?: undefined;
|
|
803
|
-
sleepApplication?: undefined;
|
|
804
|
-
runtimeMode?: undefined;
|
|
805
|
-
} | null;
|
|
806
|
-
message: string | undefined;
|
|
807
|
-
projectName?: undefined;
|
|
808
|
-
instanceId?: undefined;
|
|
809
|
-
} | {
|
|
810
|
-
id: null;
|
|
811
|
-
ok: boolean;
|
|
812
|
-
status: string;
|
|
813
|
-
message: string;
|
|
814
|
-
service: string;
|
|
815
|
-
projectId: string | null;
|
|
816
|
-
projectName: string;
|
|
817
|
-
serviceId: string | null;
|
|
818
|
-
serviceName: string;
|
|
819
|
-
environment: string;
|
|
820
|
-
environmentId: string | null;
|
|
821
|
-
expression: string;
|
|
822
|
-
command: string | null;
|
|
823
|
-
enabled: boolean;
|
|
824
|
-
logicalName: string;
|
|
825
|
-
type: string;
|
|
826
|
-
instanceId?: undefined;
|
|
827
|
-
observed?: undefined;
|
|
828
|
-
volumeName?: undefined;
|
|
829
|
-
mountPath?: undefined;
|
|
830
|
-
} | {
|
|
831
|
-
id: string | null;
|
|
832
|
-
projectId: string;
|
|
833
|
-
serviceId: string;
|
|
834
|
-
environmentId: string;
|
|
835
|
-
ok: boolean;
|
|
836
|
-
status: string;
|
|
837
|
-
observed: {
|
|
838
|
-
expression: string | null;
|
|
839
|
-
command: string | null;
|
|
840
|
-
enabled: boolean;
|
|
841
|
-
} | null;
|
|
842
|
-
message: string | undefined;
|
|
843
|
-
service: string;
|
|
844
|
-
projectName: string;
|
|
845
|
-
serviceName: string;
|
|
846
|
-
environment: string;
|
|
847
|
-
expression: string;
|
|
848
|
-
command: string | null;
|
|
849
|
-
enabled: boolean;
|
|
850
|
-
logicalName: string;
|
|
851
|
-
type: string;
|
|
852
|
-
instanceId?: undefined;
|
|
853
|
-
volumeName?: undefined;
|
|
854
|
-
mountPath?: undefined;
|
|
855
|
-
})[];
|
|
519
|
+
checks: any[];
|
|
856
520
|
} | {
|
|
857
521
|
ok: boolean;
|
|
858
522
|
skipped: boolean;
|
|
@@ -999,119 +663,7 @@ export declare function runProjectPlatformAction(action: ProjectPlatformAction,
|
|
|
999
663
|
};
|
|
1000
664
|
railwayResources: {
|
|
1001
665
|
ok: boolean;
|
|
1002
|
-
checks:
|
|
1003
|
-
type: string;
|
|
1004
|
-
service: string;
|
|
1005
|
-
serviceName: string;
|
|
1006
|
-
projectName: string;
|
|
1007
|
-
environment: string;
|
|
1008
|
-
ok: boolean;
|
|
1009
|
-
status: string;
|
|
1010
|
-
message: string;
|
|
1011
|
-
serviceId?: undefined;
|
|
1012
|
-
projectId?: undefined;
|
|
1013
|
-
environmentId?: undefined;
|
|
1014
|
-
instanceId?: undefined;
|
|
1015
|
-
observed?: undefined;
|
|
1016
|
-
volumeName?: undefined;
|
|
1017
|
-
mountPath?: undefined;
|
|
1018
|
-
} | {
|
|
1019
|
-
type: string;
|
|
1020
|
-
service: string;
|
|
1021
|
-
serviceName: string;
|
|
1022
|
-
serviceId: string;
|
|
1023
|
-
projectId: string;
|
|
1024
|
-
environment: string;
|
|
1025
|
-
environmentId: string;
|
|
1026
|
-
instanceId: string | null;
|
|
1027
|
-
ok: boolean;
|
|
1028
|
-
status: string;
|
|
1029
|
-
observed: {
|
|
1030
|
-
rootDirectory: string | null;
|
|
1031
|
-
startCommand: string | null;
|
|
1032
|
-
cronSchedule: string | null;
|
|
1033
|
-
sleepApplication: boolean | null;
|
|
1034
|
-
runtimeMode: string | null;
|
|
1035
|
-
id?: undefined;
|
|
1036
|
-
name?: undefined;
|
|
1037
|
-
instances?: undefined;
|
|
1038
|
-
} | null;
|
|
1039
|
-
message: string | undefined;
|
|
1040
|
-
projectName?: undefined;
|
|
1041
|
-
volumeName?: undefined;
|
|
1042
|
-
mountPath?: undefined;
|
|
1043
|
-
} | {
|
|
1044
|
-
type: string;
|
|
1045
|
-
service: string;
|
|
1046
|
-
serviceName: string;
|
|
1047
|
-
serviceId: string;
|
|
1048
|
-
projectId: string;
|
|
1049
|
-
environment: string;
|
|
1050
|
-
environmentId: string;
|
|
1051
|
-
volumeName: string;
|
|
1052
|
-
mountPath: string;
|
|
1053
|
-
ok: boolean;
|
|
1054
|
-
status: string;
|
|
1055
|
-
observed: {
|
|
1056
|
-
id: string;
|
|
1057
|
-
name: string;
|
|
1058
|
-
instances: import("./railway-api.ts").RailwayVolumeInstanceSummary[];
|
|
1059
|
-
rootDirectory?: undefined;
|
|
1060
|
-
startCommand?: undefined;
|
|
1061
|
-
cronSchedule?: undefined;
|
|
1062
|
-
sleepApplication?: undefined;
|
|
1063
|
-
runtimeMode?: undefined;
|
|
1064
|
-
} | null;
|
|
1065
|
-
message: string | undefined;
|
|
1066
|
-
projectName?: undefined;
|
|
1067
|
-
instanceId?: undefined;
|
|
1068
|
-
} | {
|
|
1069
|
-
id: null;
|
|
1070
|
-
ok: boolean;
|
|
1071
|
-
status: string;
|
|
1072
|
-
message: string;
|
|
1073
|
-
service: string;
|
|
1074
|
-
projectId: string | null;
|
|
1075
|
-
projectName: string;
|
|
1076
|
-
serviceId: string | null;
|
|
1077
|
-
serviceName: string;
|
|
1078
|
-
environment: string;
|
|
1079
|
-
environmentId: string | null;
|
|
1080
|
-
expression: string;
|
|
1081
|
-
command: string | null;
|
|
1082
|
-
enabled: boolean;
|
|
1083
|
-
logicalName: string;
|
|
1084
|
-
type: string;
|
|
1085
|
-
instanceId?: undefined;
|
|
1086
|
-
observed?: undefined;
|
|
1087
|
-
volumeName?: undefined;
|
|
1088
|
-
mountPath?: undefined;
|
|
1089
|
-
} | {
|
|
1090
|
-
id: string | null;
|
|
1091
|
-
projectId: string;
|
|
1092
|
-
serviceId: string;
|
|
1093
|
-
environmentId: string;
|
|
1094
|
-
ok: boolean;
|
|
1095
|
-
status: string;
|
|
1096
|
-
observed: {
|
|
1097
|
-
expression: string | null;
|
|
1098
|
-
command: string | null;
|
|
1099
|
-
enabled: boolean;
|
|
1100
|
-
} | null;
|
|
1101
|
-
message: string | undefined;
|
|
1102
|
-
service: string;
|
|
1103
|
-
projectName: string;
|
|
1104
|
-
serviceName: string;
|
|
1105
|
-
environment: string;
|
|
1106
|
-
expression: string;
|
|
1107
|
-
command: string | null;
|
|
1108
|
-
enabled: boolean;
|
|
1109
|
-
logicalName: string;
|
|
1110
|
-
type: string;
|
|
1111
|
-
instanceId?: undefined;
|
|
1112
|
-
volumeName?: undefined;
|
|
1113
|
-
mountPath?: undefined;
|
|
1114
|
-
})[];
|
|
666
|
+
checks: any[];
|
|
1115
667
|
} | {
|
|
1116
668
|
ok: boolean;
|
|
1117
669
|
skipped: boolean;
|
|
@@ -1230,7 +1230,7 @@ async function monitorProjectPlatform(options) {
|
|
|
1230
1230
|
r2: options.dryRun ? { ok: true, skipped: true, reason: "dry_run" } : probeR2(options.tenantRoot, siteConfig, state, target),
|
|
1231
1231
|
queue: options.dryRun ? Promise.resolve({ ok: true, skipped: true, reason: "dry_run" }) : probeQueue(siteConfig, state),
|
|
1232
1232
|
scaleProbe: probeScaleConfiguration(siteConfig, state),
|
|
1233
|
-
railwayResources: options.scope === "local" || !apiSelected && !agentsSelected ? Promise.resolve({ ok: true, skipped: true, reason: options.scope === "local" ? "local_scope" : "railway_not_selected" }) : verifyRailwayManagedResources(options.tenantRoot, options.scope, { env }),
|
|
1233
|
+
railwayResources: options.scope === "local" || !apiSelected && !agentsSelected ? Promise.resolve({ ok: true, skipped: true, reason: options.scope === "local" ? "local_scope" : "railway_not_selected" }) : verifyRailwayManagedResources(options.tenantRoot, options.scope, { env, settleDeployments: true }),
|
|
1234
1234
|
readiness: state.readiness
|
|
1235
1235
|
};
|
|
1236
1236
|
const resolvedChecks = {
|
|
@@ -2,6 +2,7 @@ import { type TreeseedBootstrapTaskPrefix, type TreeseedBootstrapWriter } from '
|
|
|
2
2
|
export declare function deriveRailwayWorkerRunnerServiceName(projectSlug: any, index?: number): string;
|
|
3
3
|
export declare function deriveRailwayWorkerRunnerVolumeName(serviceName: any, environmentName?: string): string;
|
|
4
4
|
export declare function railwayServiceRuntimeStartCommand(service: any): any;
|
|
5
|
+
export declare function collectRailwayDeploymentStatusChecks(statusPayload: any, scope: any, services: any): any;
|
|
5
6
|
export declare function isUsableRailwayToken(value: any): boolean;
|
|
6
7
|
export declare function resolveRailwayAuthToken(env?: NodeJS.ProcessEnv): string;
|
|
7
8
|
export declare function buildRailwayCommandEnv(env?: NodeJS.ProcessEnv): {
|
|
@@ -12,6 +13,43 @@ export declare function runRailway(args: any, { cwd, capture, allowFailure, inpu
|
|
|
12
13
|
capture?: boolean | undefined;
|
|
13
14
|
allowFailure?: boolean | undefined;
|
|
14
15
|
}): import("child_process").SpawnSyncReturns<string>;
|
|
16
|
+
export declare function waitForRailwayManagedDeploymentsSettled(tenantRoot: any, scope: any, { services, env, timeoutMs, pollMs, }?: {
|
|
17
|
+
services?: ({
|
|
18
|
+
key: string;
|
|
19
|
+
scope: string;
|
|
20
|
+
projectId: string | null;
|
|
21
|
+
projectName: string;
|
|
22
|
+
serviceId: string | null;
|
|
23
|
+
serviceName: string;
|
|
24
|
+
rootDir: string;
|
|
25
|
+
publicBaseUrl: string | null;
|
|
26
|
+
railwayEnvironment: string;
|
|
27
|
+
buildCommand: string | null;
|
|
28
|
+
startCommand: string | null;
|
|
29
|
+
healthcheckPath: any;
|
|
30
|
+
healthcheckTimeoutSeconds: any;
|
|
31
|
+
healthcheckIntervalSeconds: any;
|
|
32
|
+
restartPolicy: any;
|
|
33
|
+
runtimeMode: any;
|
|
34
|
+
schedule: string[];
|
|
35
|
+
hostingKind: string;
|
|
36
|
+
runnerPool: {
|
|
37
|
+
bootstrapIndex: number;
|
|
38
|
+
volumeMountPath: string;
|
|
39
|
+
} | null;
|
|
40
|
+
} | null)[] | undefined;
|
|
41
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
42
|
+
timeoutMs?: number | undefined;
|
|
43
|
+
pollMs?: number | undefined;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
ok: boolean;
|
|
46
|
+
checks: any;
|
|
47
|
+
message?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
ok: boolean;
|
|
50
|
+
checks: any;
|
|
51
|
+
message: string;
|
|
52
|
+
}>;
|
|
15
53
|
export declare function setRailwaySecretVariable({ cwd, service, environment, key, value, env, capture, allowFailure }: {
|
|
16
54
|
cwd: any;
|
|
17
55
|
service: any;
|
|
@@ -281,124 +319,15 @@ export declare function verifyRailwayScheduledJobs(tenantRoot: any, scope: any,
|
|
|
281
319
|
unsupported?: undefined;
|
|
282
320
|
message?: undefined;
|
|
283
321
|
}>;
|
|
284
|
-
export declare function verifyRailwayManagedResources(tenantRoot: any, scope: any, { fetchImpl, apiToken, apiUrl, env }?: {
|
|
322
|
+
export declare function verifyRailwayManagedResources(tenantRoot: any, scope: any, { fetchImpl, apiToken, apiUrl, env, settleDeployments, settleTimeoutMs, settlePollMs, }?: {
|
|
285
323
|
fetchImpl?: typeof fetch | undefined;
|
|
286
324
|
env?: NodeJS.ProcessEnv | undefined;
|
|
325
|
+
settleDeployments?: boolean | undefined;
|
|
326
|
+
settleTimeoutMs?: number | undefined;
|
|
327
|
+
settlePollMs?: number | undefined;
|
|
287
328
|
}): Promise<{
|
|
288
329
|
ok: boolean;
|
|
289
|
-
checks:
|
|
290
|
-
type: string;
|
|
291
|
-
service: string;
|
|
292
|
-
serviceName: string;
|
|
293
|
-
projectName: string;
|
|
294
|
-
environment: string;
|
|
295
|
-
ok: boolean;
|
|
296
|
-
status: string;
|
|
297
|
-
message: string;
|
|
298
|
-
serviceId?: undefined;
|
|
299
|
-
projectId?: undefined;
|
|
300
|
-
environmentId?: undefined;
|
|
301
|
-
instanceId?: undefined;
|
|
302
|
-
observed?: undefined;
|
|
303
|
-
volumeName?: undefined;
|
|
304
|
-
mountPath?: undefined;
|
|
305
|
-
} | {
|
|
306
|
-
type: string;
|
|
307
|
-
service: string;
|
|
308
|
-
serviceName: string;
|
|
309
|
-
serviceId: string;
|
|
310
|
-
projectId: string;
|
|
311
|
-
environment: string;
|
|
312
|
-
environmentId: string;
|
|
313
|
-
instanceId: string | null;
|
|
314
|
-
ok: boolean;
|
|
315
|
-
status: string;
|
|
316
|
-
observed: {
|
|
317
|
-
rootDirectory: string | null;
|
|
318
|
-
startCommand: string | null;
|
|
319
|
-
cronSchedule: string | null;
|
|
320
|
-
sleepApplication: boolean | null;
|
|
321
|
-
runtimeMode: string | null;
|
|
322
|
-
id?: undefined;
|
|
323
|
-
name?: undefined;
|
|
324
|
-
instances?: undefined;
|
|
325
|
-
} | null;
|
|
326
|
-
message: string | undefined;
|
|
327
|
-
projectName?: undefined;
|
|
328
|
-
volumeName?: undefined;
|
|
329
|
-
mountPath?: undefined;
|
|
330
|
-
} | {
|
|
331
|
-
type: string;
|
|
332
|
-
service: string;
|
|
333
|
-
serviceName: string;
|
|
334
|
-
serviceId: string;
|
|
335
|
-
projectId: string;
|
|
336
|
-
environment: string;
|
|
337
|
-
environmentId: string;
|
|
338
|
-
volumeName: string;
|
|
339
|
-
mountPath: string;
|
|
340
|
-
ok: boolean;
|
|
341
|
-
status: string;
|
|
342
|
-
observed: {
|
|
343
|
-
id: string;
|
|
344
|
-
name: string;
|
|
345
|
-
instances: import("./railway-api.ts").RailwayVolumeInstanceSummary[];
|
|
346
|
-
rootDirectory?: undefined;
|
|
347
|
-
startCommand?: undefined;
|
|
348
|
-
cronSchedule?: undefined;
|
|
349
|
-
sleepApplication?: undefined;
|
|
350
|
-
runtimeMode?: undefined;
|
|
351
|
-
} | null;
|
|
352
|
-
message: string | undefined;
|
|
353
|
-
projectName?: undefined;
|
|
354
|
-
instanceId?: undefined;
|
|
355
|
-
} | {
|
|
356
|
-
id: null;
|
|
357
|
-
ok: boolean;
|
|
358
|
-
status: string;
|
|
359
|
-
message: string;
|
|
360
|
-
service: string;
|
|
361
|
-
projectId: string | null;
|
|
362
|
-
projectName: string;
|
|
363
|
-
serviceId: string | null;
|
|
364
|
-
serviceName: string;
|
|
365
|
-
environment: string;
|
|
366
|
-
environmentId: string | null;
|
|
367
|
-
expression: string;
|
|
368
|
-
command: string | null;
|
|
369
|
-
enabled: boolean;
|
|
370
|
-
logicalName: string;
|
|
371
|
-
type: string;
|
|
372
|
-
instanceId?: undefined;
|
|
373
|
-
observed?: undefined;
|
|
374
|
-
volumeName?: undefined;
|
|
375
|
-
mountPath?: undefined;
|
|
376
|
-
} | {
|
|
377
|
-
id: string | null;
|
|
378
|
-
projectId: string;
|
|
379
|
-
serviceId: string;
|
|
380
|
-
environmentId: string;
|
|
381
|
-
ok: boolean;
|
|
382
|
-
status: string;
|
|
383
|
-
observed: {
|
|
384
|
-
expression: string | null;
|
|
385
|
-
command: string | null;
|
|
386
|
-
enabled: boolean;
|
|
387
|
-
} | null;
|
|
388
|
-
message: string | undefined;
|
|
389
|
-
service: string;
|
|
390
|
-
projectName: string;
|
|
391
|
-
serviceName: string;
|
|
392
|
-
environment: string;
|
|
393
|
-
expression: string;
|
|
394
|
-
command: string | null;
|
|
395
|
-
enabled: boolean;
|
|
396
|
-
logicalName: string;
|
|
397
|
-
type: string;
|
|
398
|
-
instanceId?: undefined;
|
|
399
|
-
volumeName?: undefined;
|
|
400
|
-
mountPath?: undefined;
|
|
401
|
-
})[];
|
|
330
|
+
checks: any[];
|
|
402
331
|
}>;
|
|
403
332
|
export declare function planRailwayServiceDeploy(service: any, { env }?: {
|
|
404
333
|
env?: NodeJS.ProcessEnv | undefined;
|
|
@@ -95,6 +95,74 @@ function parseRailwayJsonOutput(output) {
|
|
|
95
95
|
}
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
98
|
+
function railwayEdgeNodes(value) {
|
|
99
|
+
return Array.isArray(value?.edges) ? value.edges.map((entry) => entry?.node).filter(Boolean) : [];
|
|
100
|
+
}
|
|
101
|
+
function railwayStatusEnvironmentNodes(payload) {
|
|
102
|
+
if (!payload || typeof payload !== "object") {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
if (Array.isArray(payload.environments)) {
|
|
106
|
+
return payload.environments;
|
|
107
|
+
}
|
|
108
|
+
return railwayEdgeNodes(payload.environments);
|
|
109
|
+
}
|
|
110
|
+
function railwayStatusDeploymentSettled(status) {
|
|
111
|
+
const normalized = String(status ?? "").trim().toUpperCase();
|
|
112
|
+
return normalized === "SUCCESS" || normalized === "SLEEPING";
|
|
113
|
+
}
|
|
114
|
+
function collectRailwayDeploymentStatusChecks(statusPayload, scope, services) {
|
|
115
|
+
const expectedEnvironment = resolveRailwayEnvironmentForScope(scope);
|
|
116
|
+
const environments = railwayStatusEnvironmentNodes(statusPayload);
|
|
117
|
+
const environment = environments.find(
|
|
118
|
+
(candidate) => normalizeRailwayEnvironmentName(candidate?.name) === expectedEnvironment
|
|
119
|
+
) ?? null;
|
|
120
|
+
if (!environment) {
|
|
121
|
+
return services.map((service) => ({
|
|
122
|
+
type: "deployment-status",
|
|
123
|
+
service: service.key,
|
|
124
|
+
serviceName: service.serviceName,
|
|
125
|
+
environment: expectedEnvironment,
|
|
126
|
+
ok: false,
|
|
127
|
+
status: "missing_environment",
|
|
128
|
+
message: `Railway status did not include the ${expectedEnvironment} environment.`
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
const instances = railwayEdgeNodes(environment.serviceInstances);
|
|
132
|
+
return services.map((service) => {
|
|
133
|
+
const instance = instances.find((candidate) => candidate?.serviceName === service.serviceName) ?? null;
|
|
134
|
+
if (!instance) {
|
|
135
|
+
return {
|
|
136
|
+
type: "deployment-status",
|
|
137
|
+
service: service.key,
|
|
138
|
+
serviceName: service.serviceName,
|
|
139
|
+
environment: expectedEnvironment,
|
|
140
|
+
ok: false,
|
|
141
|
+
status: "missing_service_instance",
|
|
142
|
+
message: `Railway status did not include service ${service.serviceName} in ${expectedEnvironment}.`
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const deployment = instance.latestDeployment ?? null;
|
|
146
|
+
const status = String(deployment?.status ?? "").trim().toUpperCase();
|
|
147
|
+
const instanceStatuses = Array.isArray(deployment?.instances) ? deployment.instances.map((entry) => String(entry?.status ?? "").trim()).filter(Boolean) : [];
|
|
148
|
+
const ok = railwayStatusDeploymentSettled(status);
|
|
149
|
+
return {
|
|
150
|
+
type: "deployment-status",
|
|
151
|
+
service: service.key,
|
|
152
|
+
serviceName: service.serviceName,
|
|
153
|
+
environment: normalizeRailwayEnvironmentName(environment.name),
|
|
154
|
+
ok,
|
|
155
|
+
status: status || "missing_deployment",
|
|
156
|
+
observed: {
|
|
157
|
+
status: status || null,
|
|
158
|
+
deploymentStopped: deployment?.deploymentStopped ?? null,
|
|
159
|
+
instanceStatuses,
|
|
160
|
+
volumeMounts: Array.isArray(deployment?.meta?.volumeMounts) ? deployment.meta.volumeMounts : []
|
|
161
|
+
},
|
|
162
|
+
message: ok ? void 0 : `Railway deployment for ${service.serviceName} is not settled yet; observed ${status || "missing deployment status"}.`
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
}
|
|
98
166
|
function normalizeRailwayCliVolume(value, { serviceId, environmentId, fallbackName, fallbackMountPath }) {
|
|
99
167
|
if (!value || typeof value !== "object") {
|
|
100
168
|
return null;
|
|
@@ -321,6 +389,50 @@ function runRailway(args, { cwd, capture = false, allowFailure = false, input, e
|
|
|
321
389
|
}
|
|
322
390
|
return result;
|
|
323
391
|
}
|
|
392
|
+
async function waitForRailwayManagedDeploymentsSettled(tenantRoot, scope, {
|
|
393
|
+
services = configuredRailwayServices(tenantRoot, scope),
|
|
394
|
+
env = process.env,
|
|
395
|
+
timeoutMs = 18e4,
|
|
396
|
+
pollMs = 15e3
|
|
397
|
+
} = {}) {
|
|
398
|
+
const deadline = Date.now() + timeoutMs;
|
|
399
|
+
let checks = [];
|
|
400
|
+
let lastError = null;
|
|
401
|
+
for (; ; ) {
|
|
402
|
+
try {
|
|
403
|
+
const result = runRailway(["status", "--json"], {
|
|
404
|
+
cwd: tenantRoot,
|
|
405
|
+
capture: true,
|
|
406
|
+
env
|
|
407
|
+
});
|
|
408
|
+
const payload = parseRailwayJsonOutput(result.stdout);
|
|
409
|
+
checks = collectRailwayDeploymentStatusChecks(payload, scope, services);
|
|
410
|
+
lastError = null;
|
|
411
|
+
if (checks.every((entry) => entry.ok === true)) {
|
|
412
|
+
return { ok: true, checks };
|
|
413
|
+
}
|
|
414
|
+
} catch (error) {
|
|
415
|
+
lastError = error;
|
|
416
|
+
checks = services.map((service) => ({
|
|
417
|
+
type: "deployment-status",
|
|
418
|
+
service: service.key,
|
|
419
|
+
serviceName: service.serviceName,
|
|
420
|
+
environment: resolveRailwayEnvironmentForScope(scope),
|
|
421
|
+
ok: false,
|
|
422
|
+
status: "status_error",
|
|
423
|
+
message: error instanceof Error ? error.message : String(error)
|
|
424
|
+
}));
|
|
425
|
+
}
|
|
426
|
+
if (Date.now() >= deadline) {
|
|
427
|
+
return {
|
|
428
|
+
ok: false,
|
|
429
|
+
checks,
|
|
430
|
+
message: lastError instanceof Error ? lastError.message : "Railway deployments did not settle before the monitor timeout."
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
await sleep(pollMs);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
324
436
|
function setRailwaySecretVariable({ cwd, service, environment, key, value, env = process.env, capture = false, allowFailure = false }) {
|
|
325
437
|
const effectiveEnv = buildRailwayCommandEnv({
|
|
326
438
|
...process.env,
|
|
@@ -842,7 +954,15 @@ async function verifyRailwayScheduledJobs(tenantRoot, scope, { fetchImpl = fetch
|
|
|
842
954
|
checks
|
|
843
955
|
};
|
|
844
956
|
}
|
|
845
|
-
async function verifyRailwayManagedResources(tenantRoot, scope, {
|
|
957
|
+
async function verifyRailwayManagedResources(tenantRoot, scope, {
|
|
958
|
+
fetchImpl = fetch,
|
|
959
|
+
apiToken,
|
|
960
|
+
apiUrl,
|
|
961
|
+
env = process.env,
|
|
962
|
+
settleDeployments = false,
|
|
963
|
+
settleTimeoutMs = 18e4,
|
|
964
|
+
settlePollMs = 15e3
|
|
965
|
+
} = {}) {
|
|
846
966
|
const effectiveApiToken = apiToken || resolveRailwayAuthToken(env);
|
|
847
967
|
const effectiveApiUrl = apiUrl || resolveRailwayApiUrl(env);
|
|
848
968
|
const effectiveEnv = { ...env, RAILWAY_API_TOKEN: effectiveApiToken, TREESEED_RAILWAY_API_URL: effectiveApiUrl };
|
|
@@ -943,6 +1063,17 @@ async function verifyRailwayManagedResources(tenantRoot, scope, { fetchImpl = fe
|
|
|
943
1063
|
...check
|
|
944
1064
|
});
|
|
945
1065
|
}
|
|
1066
|
+
if (settleDeployments) {
|
|
1067
|
+
const settled = await waitForRailwayManagedDeploymentsSettled(tenantRoot, scope, {
|
|
1068
|
+
services,
|
|
1069
|
+
env: effectiveEnv,
|
|
1070
|
+
timeoutMs: settleTimeoutMs,
|
|
1071
|
+
pollMs: settlePollMs
|
|
1072
|
+
});
|
|
1073
|
+
for (const check of settled.checks ?? []) {
|
|
1074
|
+
checks.push(check);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
946
1077
|
return {
|
|
947
1078
|
ok: checks.every((entry) => entry.ok === true || entry.skipped === true),
|
|
948
1079
|
checks
|
|
@@ -1255,6 +1386,7 @@ async function deployRailwayService(tenantRoot, service, {
|
|
|
1255
1386
|
}
|
|
1256
1387
|
export {
|
|
1257
1388
|
buildRailwayCommandEnv,
|
|
1389
|
+
collectRailwayDeploymentStatusChecks,
|
|
1258
1390
|
configuredRailwayScheduledJobs,
|
|
1259
1391
|
configuredRailwayServices,
|
|
1260
1392
|
deployRailwayService,
|
|
@@ -1276,5 +1408,6 @@ export {
|
|
|
1276
1408
|
validateRailwayDeployPrerequisites,
|
|
1277
1409
|
validateRailwayServiceConfiguration,
|
|
1278
1410
|
verifyRailwayManagedResources,
|
|
1279
|
-
verifyRailwayScheduledJobs
|
|
1411
|
+
verifyRailwayScheduledJobs,
|
|
1412
|
+
waitForRailwayManagedDeploymentsSettled
|
|
1280
1413
|
};
|
|
@@ -2986,7 +2986,11 @@ async function workflowSave(helpers, input) {
|
|
|
2986
2986
|
branch: String(repo.branch),
|
|
2987
2987
|
headSha: String(repo.commitSha)
|
|
2988
2988
|
}))
|
|
2989
|
-
], "hosted", {
|
|
2989
|
+
], "hosted", {
|
|
2990
|
+
root,
|
|
2991
|
+
runId: workflowRun.runId,
|
|
2992
|
+
onProgress: (line, stream) => helpers.write(line, stream)
|
|
2993
|
+
}).then((workflowGates) => ({ workflowGates }))) : { workflowGates: [] };
|
|
2990
2994
|
const releaseCandidate = branch === STAGING_BRANCH ? await executeJournalStep(root, workflowRun.runId, "release-candidate", () => {
|
|
2991
2995
|
const releaseSession = resolveTreeseedWorkflowSession(root);
|
|
2992
2996
|
const stagingReleasePlan = buildReleasePlanSnapshot({
|
|
@@ -3516,7 +3520,11 @@ async function workflowStage(helpers, input) {
|
|
|
3516
3520
|
branch: STAGING_BRANCH,
|
|
3517
3521
|
headSha: String(report.commitSha)
|
|
3518
3522
|
}))
|
|
3519
|
-
], ciMode, {
|
|
3523
|
+
], ciMode, {
|
|
3524
|
+
root,
|
|
3525
|
+
runId: workflowRun.runId,
|
|
3526
|
+
onProgress: (line, stream) => helpers.write(line, stream)
|
|
3527
|
+
}).then((workflowGates) => ({
|
|
3520
3528
|
status: "completed",
|
|
3521
3529
|
workflowGates
|
|
3522
3530
|
})));
|