Skip to content

Decompose Fallout.Migrate into an IMigrationStep pipeline#507

Open
dennisdoomen wants to merge 1 commit into
Fallout-build:mainfrom
dennisdoomen:improve-migration
Open

Decompose Fallout.Migrate into an IMigrationStep pipeline#507
dennisdoomen wants to merge 1 commit into
Fallout-build:mainfrom
dennisdoomen:improve-migration

Conversation

@dennisdoomen

Copy link
Copy Markdown
Collaborator

Restructures fallout-migrate's migration logic into a step pipeline so new migration steps (more are coming soon) can be added without growing one class.

What changed

  • Common/ -- shared, behavior-free/static pieces: MigrationContext, Summary, RewriteResult, IMigrationStep, MigrationFileOperations (EnumerateFiles/ApplyRewrite/RelativePath)
  • Steps/ -- one class per migration step (ResolveFalloutVersionStep, RewriteCsprojsStep, RewriteCsFilesStep, RewriteBootstrapScriptsStep, RenameNukeDirectoryStep), each next to the rewriter it drives (CsprojRewriter, CodeRewriter, ScriptRewriter)
  • Migration.Run() now just builds a MigrationContext and iterates a fixed, ordered IMigrationStep list -- adding a step is one new class + one line

No behavior change; internal-only, no public API touched.

Verification

dotnet test tests/Fallout.Migrate.Specs -- 22/22 pass.

Migration.Run() hard-coded four migration actions as private methods
sharing private helpers, making it awkward to add the steps planned
next. Split into:

- Common/ -- MigrationContext (plain data), Summary, RewriteResult,
  IMigrationStep, and MigrationFileOperations (shared EnumerateFiles /
  ApplyRewrite / RelativePath helpers)
- Steps/ -- one class per step (ResolveFalloutVersionStep,
  RewriteCsprojsStep, RewriteCsFilesStep, RewriteBootstrapScriptsStep,
  RenameNukeDirectoryStep), each paired with the rewriter it drives
  (CsprojRewriter, CodeRewriter, ScriptRewriter)

Migration.Run() now just builds a MigrationContext and iterates a
fixed, ordered step list. Adding a future step is one new class plus
one line in that list.

No behavior change; MigrationIntegrationSpecs pass unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant