ConfigMigrationStep
Base class representing a single migration operation in a configuration pipeline.
Subclasses override the four lifecycle hooks to implement source-specific logic. The runner invokes each hook in order — detect, precheck, migrate, postcheck — and uses the boolean return values to decide whether to continue the pipeline or stop.
The default implementations return true for every hook, so a subclass that does not override any hook will run through all four phases successfully.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
ConfigMigrationStep | Constructs a step with no state. | |
~ConfigMigrationStep virtual | Virtual destructor to allow safe polymorphic deletion through base pointers. | |
bool | detect virtual | Returns whether this step has a configuration source that requires migration. |
bool | precheck virtual | Validates preconditions before attempting migration. |
bool | migrate virtual | Performs the actual configuration migration. |
bool | postcheck virtual | Validates that the migration produced a correct result. |
ConfigMigrationStep
Section titled “ConfigMigrationStep”Constructs a step with no state.
virtual
~ConfigMigrationStep
Section titled “~ConfigMigrationStep”Virtual destructor to allow safe polymorphic deletion through base pointers.
virtual
detect
Section titled “detect”Returns whether this step has a configuration source that requires migration.
When the runner calls detect() and it returns false the remaining hooks for this step are skipped and the runner considers the step successful. Override this to return true only when the source is present and should be processed.
Returns
Section titled “Returns”true if migration should proceed; false to skip this step.
virtual
precheck
Section titled “precheck”Validates preconditions before attempting migration.
Called only after detect() returns true. Return false to abort the entire pipeline without attempting migration.
Returns
Section titled “Returns”true if migration may proceed; false to abort the pipeline.
virtual
migrate
Section titled “migrate”Performs the actual configuration migration.
Called only after precheck() returns true. The runner stops on the first failed migration, so any incomplete state is left to the caller to handle.
Returns
Section titled “Returns”true if migration succeeded; false to abort the pipeline.
virtual
postcheck
Section titled “postcheck”Validates that the migration produced a correct result.
Called only after migrate() returns true. Use this hook for integrity checks that run after the mutation is complete.
Returns
Section titled “Returns”true if the migrated configuration is valid; false to abort the pipeline.
Public Types
Section titled “Public Types”| Name | Description |
|---|---|
Result | Terminal outcome of the detection phase for a legacy configuration source. |
Result
Section titled “Result”Terminal outcome of the detection phase for a legacy configuration source.
Detection is distinct from migration success so a detected-but-invalid source cannot be mistaken for an absent source and incorrectly skipped in favour of an older step.
| Value | Description |
|---|---|
NotDetected | The legacy configuration source was not found. |
Migrated | The legacy source was detected and migrated successfully. |
Failed | The legacy source was detected but migration failed. |