6161 * version against this build, printed; nothing is installed. A runtime
6262 * that refuses it, or does not serve install-local, stops the deploy here
6363 * with its sentence and exit 1;
64- * 3. the install, with `--confirm-access-upgrade` passed through; the door's
65- * refusals (an access upgrade to confirm, …) stop the deploy with exit 1;
64+ * 3. the install, with `--confirm-access-upgrade` and `--confirm-upgrade`
65+ * passed through; the door's refusals (an access upgrade or a schema
66+ * upgrade to confirm, …) stop the deploy with exit 1;
6667 * 4. the answer — install-local registers the package in the live kernel
6768 * before it answers, so the answer IS "live": `hotLoaded` ⇒ 0; a package
6869 * the running kernel could not load ⇒ 1, naming the restart it waits for.
@@ -102,6 +103,7 @@ export default class Deploy extends Command {
102103 '$ os deploy --env env_abc123 # your account reaches several environments' ,
103104 '$ os deploy --no-wait # return once the install is recorded' ,
104105 '$ os deploy --confirm-access-upgrade <finding-set> # self-hosted: confirm the findings the runtime printed' ,
106+ '$ os deploy --confirm-upgrade <finding-set> # self-hosted: confirm the schema findings the runtime printed' ,
105107 ] ;
106108
107109 static override flags = {
@@ -140,6 +142,16 @@ export default class Deploy extends Command {
140142 'Self-hosted runtime target: confirm the access findings of this upgrade with the finding-set token the '
141143 + "runtime's refusal printed (as `os package install --confirm-access-upgrade`)" ,
142144 } ) ,
145+ // [epic cloud#3652 Q3, #30884] The schema findings' confirmation, passed
146+ // through to the install as `--confirm-access-upgrade` is: the embedded
147+ // install's refusal prints `os deploy --confirm-upgrade <token>` as its
148+ // retry, so this command must take it.
149+ 'confirm-upgrade' : Flags . string ( {
150+ description :
151+ 'Self-hosted runtime target: confirm the schema findings of this upgrade (a suspected rename, a type change '
152+ + "that is not safe) with the finding-set token the runtime's refusal printed (as `os package install "
153+ + '--confirm-upgrade`)' ,
154+ } ) ,
143155 } ;
144156
145157 async run ( ) : Promise < void > {
@@ -151,12 +163,13 @@ export default class Deploy extends Command {
151163 // cloud environment was named.
152164 const runtime = flags . env ? undefined : await activeRuntimeTarget ( ) ;
153165 if ( runtime ) {
154- await this . deployToRuntime ( runtime , flags [ 'confirm-access-upgrade' ] ) ;
166+ await this . deployToRuntime ( runtime , flags [ 'confirm-access-upgrade' ] , flags [ 'confirm-upgrade' ] ) ;
155167 return ;
156168 }
157- if ( flags [ 'confirm-access-upgrade' ] !== undefined ) {
169+ for ( const flag of [ 'confirm-access-upgrade' , 'confirm-upgrade' ] as const ) {
170+ if ( flags [ flag ] === undefined ) continue ;
158171 printError (
159- '`--confirm-access-upgrade ` confirms a self-hosted runtime\ 's refusal; the deploy target is ObjectOS Cloud. '
172+ `\`-- ${ flag } \ ` confirms a self-hosted runtime's refusal; the deploy target is ObjectOS Cloud. `
160173 + 'Drop the flag, or record the runtime with `os environments use-runtime <url> --token <key>`.' ,
161174 ) ;
162175 this . exit ( 1 ) ;
@@ -285,7 +298,11 @@ export default class Deploy extends Command {
285298 * The self-hosted half (the header's "A self-hosted runtime target"):
286299 * build → dry run (plan printed) → install → the `hotLoaded` answer.
287300 */
288- private async deployToRuntime ( runtime : RuntimeTarget , confirmAccessUpgrade : string | undefined ) : Promise < void > {
301+ private async deployToRuntime (
302+ runtime : RuntimeTarget ,
303+ confirmAccessUpgrade : string | undefined ,
304+ confirmUpgrade : string | undefined ,
305+ ) : Promise < void > {
289306 printStep ( `Deploying to the self-hosted runtime ${ runtime . url } (os environments use-runtime)` ) ;
290307
291308 printStep ( 'Building...' ) ;
@@ -317,7 +334,10 @@ export default class Deploy extends Command {
317334 }
318335
319336 printStep ( `Installing ${ plan . manifestId } ${ plan . version } into ${ runtime . url } ...` ) ;
320- const outcome = await install ( confirmAccessUpgrade !== undefined ? [ '--confirm-access-upgrade' , confirmAccessUpgrade ] : [ ] ) ;
337+ const outcome = await install ( [
338+ ...( confirmAccessUpgrade !== undefined ? [ '--confirm-access-upgrade' , confirmAccessUpgrade ] : [ ] ) ,
339+ ...( confirmUpgrade !== undefined ? [ '--confirm-upgrade' , confirmUpgrade ] : [ ] ) ,
340+ ] ) ;
321341 if ( outcome ?. kind !== 'installed' ) {
322342 printError ( `${ runtime . url } did not answer the install as a managed package install, so this cannot say ${ plan . manifestId } is live (see above).` ) ;
323343 this . exit ( 1 ) ;
0 commit comments