[run-instance-commands] Preserve fast slow sequentiality (#19757)

# Introduction
The command was wrongly running all fast and then all slow ignoring
instance commands segment
Leading to 
```ts
1.23.0_AddGlobalObjectContextToCommandMenuItemAvailabilityTypeFastInstanceCommand_1776090711153 executed successfully
[Nest] 32679  - 04/16/2026, 1:21:07 PM     LOG [InstanceCommandRunnerService] 1.23.0_DropWorkspaceVersionColumnFastInstanceCommand_1785000000000 executed successfully
[Nest] 32679  - 04/16/2026, 1:21:07 PM     LOG [InstanceCommandRunnerService] 1.22.0_BackfillWorkspaceIdOnIndirectEntitiesSlowInstanceCommand_1775758621018 executed successfully
[Nest] 32679  - 04/16/2026, 1:21:07 PM     LOG [RunInstanceCommandsCommand] Instance commands completed
```

No prod/self host impact as 1.23 hasn't been released yet
This commit is contained in:
Paul Rastoin
2026-04-16 14:14:47 +02:00
committed by GitHub
parent 2b5b8a8b13
commit 2413af0ba9
2 changed files with 33 additions and 23 deletions
@@ -283,10 +283,10 @@ export class UpgradeMigrationService {
return completedCount === workspaceIds.length;
}
async getLastAttemptedInstanceCommandOrThrow(): Promise<{
async getLastAttemptedInstanceCommand(): Promise<{
name: string;
status: UpgradeMigrationStatus;
}> {
} | null> {
const migration = await this.upgradeMigrationRepository
.createQueryBuilder('migration')
.select(['migration.name', 'migration.status'])
@@ -304,11 +304,24 @@ export class UpgradeMigrationService {
.getOne();
if (!migration) {
return null;
}
return { name: migration.name, status: migration.status };
}
async getLastAttemptedInstanceCommandOrThrow(): Promise<{
name: string;
status: UpgradeMigrationStatus;
}> {
const result = await this.getLastAttemptedInstanceCommand();
if (!result) {
throw new Error(
'No instance command found — the database may not have been initialized',
);
}
return { name: migration.name, status: migration.status };
return result;
}
}