Workspace command decorators (#19397)
# Introduction Migrating the workspace commands to the decorator version + timestamp listing as for the instance commands We've now been able to remove the upgrade command abstraction where we needed to import all modules and order them Now they're dynamically retrieved at upgrade runtime, sorted by timestamp ## Instance and workspace commands name The name is computed from the command metadata `version` `className` and `timestamp` we have a duplicate validation at module init from the unified registry
This commit is contained in:
@@ -8,7 +8,7 @@ import { DataSource } from 'typeorm';
|
||||
|
||||
import { CoreEngineVersionService } from 'src/engine/core-engine-version/services/core-engine-version.service';
|
||||
import { InstanceUpgradeService } from 'src/engine/core-modules/upgrade/services/instance-upgrade.service';
|
||||
import { RegisteredInstanceMigrationService } from 'src/engine/core-modules/upgrade/services/registered-instance-migration-registry.service';
|
||||
import { UpgradeCommandRegistryService } from 'src/engine/core-modules/upgrade/services/upgrade-command-registry.service';
|
||||
import { WorkspaceVersionService } from 'src/engine/workspace-manager/workspace-version/services/workspace-version.service';
|
||||
|
||||
type RunInstanceCommandsOptions = {
|
||||
@@ -28,7 +28,7 @@ export class RunInstanceCommandsCommand extends CommandRunner {
|
||||
private readonly dataSource: DataSource,
|
||||
private readonly coreEngineVersionService: CoreEngineVersionService,
|
||||
private readonly workspaceVersionService: WorkspaceVersionService,
|
||||
private readonly registeredInstanceMigrationService: RegisteredInstanceMigrationService,
|
||||
private readonly upgradeCommandRegistryService: UpgradeCommandRegistryService,
|
||||
private readonly instanceUpgradeService: InstanceUpgradeService,
|
||||
) {
|
||||
super();
|
||||
@@ -79,7 +79,7 @@ export class RunInstanceCommandsCommand extends CommandRunner {
|
||||
|
||||
private async runAllInstanceCommands(): Promise<void> {
|
||||
const allInstanceCommands =
|
||||
this.registeredInstanceMigrationService.getAllInstanceCommands();
|
||||
this.upgradeCommandRegistryService.getAllInstanceCommands();
|
||||
|
||||
if (allInstanceCommands.length === 0) {
|
||||
this.logger.log('No registered instance commands');
|
||||
|
||||
Reference in New Issue
Block a user