Migrations Garage with AI
Running migrations with AI assistance in scoped batches.
Migrations Garage with AI
Our migrations garage is a structured way to run migrations (e.g. framework upgrades, dependency bumps, security fixes) with AI assistance.
Migrations Garage with AI
We use AI to support migrations and modernisation: automation, safety checks, and repeatable patterns so migrations are predictable and auditable.
Scoped batches
Migrations are broken into small, reviewable batches. AI can suggest changes; humans review and approve. We avoid massive PRs that are hard to reason about.
Example: instead of “upgrade React 17 → 18 in one PR,” we split into:
| Batch | Scope | AI role |
|---|---|---|
| 1 | Update package.json and fix type errors in 3 files | Suggest version and import changes |
| 2 | Replace deprecated ReactDOM.render in 5 components | Suggest createRoot usage |
| 3 | Update tests and fix act() warnings | Suggest test updates |
Each batch is reviewable in under an hour; we can roll back or pause between batches.
Automation
We use scripts and tools for repetitive migration steps (e.g. codemods, test updates). AI helps generate or refine scripts; we version and document them.
Example: a simple codemod script that renames a prop. We keep it in the repo so everyone runs the same transformation.
// scripts/codemods/rename-prop.ts (conceptual)
// Usage: npx jscodeshift -t scripts/codemods/rename-prop.ts src/
// Replaces oldProp with newProp in our component API
export const transformer = (file, api) => {
const j = api.jscodeshift;
return j(file.source)
.find(j.JSXAttribute, { name: { name: 'oldProp' } })
.renameTo('newProp')
.toSource();
};We run the codemod, then commit the result in a dedicated PR and review the diff. AI can help write the codemod; humans review and run it.
Tracking
Progress, rollback plans, and lessons learned are documented so future migrations are easier. We run retros after large migrations.
Checklist we use for each migration:
- Scope and batches defined
- Scripts/codemods in repo and runnable
- Rollback plan (e.g. revert PR, feature flag off)
- Retro notes added to our migration runbook
Risk control
Migrations can break production. We use feature flags, canaries, and rollback plans. AI assists with speed and consistency; humans own the decision to ship and the response to incidents.