@@ -229,11 +229,13 @@ describe("per-environment worker queue overrides", () => {
229229 environmentType = "STAGING" ,
230230 v2Enabled = true ,
231231 migrationEnabled = false ,
232+ templateKey = "a" . repeat ( 64 ) ,
232233 } : {
233234 orgFeatureFlags : Record < string , unknown > ;
234235 environmentType ?: string ;
235236 v2Enabled ?: boolean ;
236237 migrationEnabled ?: boolean ;
238+ templateKey ?: string | null ;
237239 } ) {
238240 const environmentOverride = environmentWorkerQueueOverride ( {
239241 orgFeatureFlags,
@@ -251,7 +253,7 @@ describe("per-environment worker queue overrides", () => {
251253 flags : { computeMigrationEnabled : migrationEnabled , computeMigrationFreePercentage : 100 } ,
252254 envType : environmentType ,
253255 environmentCompat : environmentOverride . compat ,
254- templateKey : "a" . repeat ( 64 ) ,
256+ templateKey,
255257 } ) ;
256258 const workerQueue = workerQueueForBirth ( {
257259 workerQueue : migrated . workerQueue ! ,
@@ -263,6 +265,7 @@ describe("per-environment worker queue overrides", () => {
263265 splitEnabled : true ,
264266 workerGroups,
265267 rootTriggerSource : "api" ,
268+ templateFallback : migrated . templateFallback ,
266269 } ) ;
267270 return { workerQueue, enableFastPath : migrated . enableFastPath } ;
268271 }
@@ -386,5 +389,39 @@ describe("per-environment worker queue overrides", () => {
386389 enableFastPath : true ,
387390 } ) ;
388391 } ) ;
392+
393+ it ( "puts a migrated org's keyless run on the stable container channel" , ( ) => {
394+ const canaryStaging = {
395+ [ FEATURE_FLAG . workerQueueEnvironmentOverrides ] : { STAGING : { channel : "canary" } } ,
396+ } ;
397+ const canaryOrg = { [ FEATURE_FLAG . workerQueueChannel ] : "canary" } ;
398+ for ( const orgFeatureFlags of [ canaryStaging , canaryOrg ] ) {
399+ expect ( trigger ( { orgFeatureFlags, migrationEnabled : true , templateKey : null } ) ) . toEqual ( {
400+ workerQueue : "us-east-1:v2:ondemand:fresh:container:stable" ,
401+ enableFastPath : false ,
402+ } ) ;
403+ // A run that is not migrated keeps its channel, keyless or not.
404+ expect ( trigger ( { orgFeatureFlags, templateKey : null } ) ) . toEqual ( {
405+ workerQueue : "us-east-1:v2:ondemand:fresh:container:canary" ,
406+ enableFastPath : false ,
407+ } ) ;
408+ }
409+ } ) ;
410+
411+ it ( "keeps an explicit compute compatibility for a keyless run, for the dequeue check" , ( ) => {
412+ expect (
413+ trigger ( {
414+ orgFeatureFlags : {
415+ [ FEATURE_FLAG . workerQueueCompatibility ] : "compute" ,
416+ [ FEATURE_FLAG . workerQueueChannel ] : "canary" ,
417+ } ,
418+ migrationEnabled : true ,
419+ templateKey : null ,
420+ } )
421+ ) . toEqual ( {
422+ workerQueue : "us-east-1:v2:ondemand:fresh:compute:canary" ,
423+ enableFastPath : false ,
424+ } ) ;
425+ } ) ;
389426 } ) ;
390427} ) ;
0 commit comments