Repository navigation
feat(restore): Allow skipping migrate in New Site from Backup (backport #626) - #627
Merged
Merged
Conversation
New Site from Backup always ran bench migrate after the restore. A migrate failure (a broken patch, a schema change that existing data can't take) then fails the whole job, and a site migration rolls back with it. Accept an optional skip_migrate in the restore request. When it is set, the site is restored and set up as before, but migrate doesn't run. It defaults to false, so existing callers behave the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 2e64688)
Contributor
Author
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
New Site from Backupalways runsbench migrateafter the restore. If migrate fails, the whole job fails. That can happen because of a broken patch in an app, or a schema change that the site's existing data can't take (for example, a Data custom field turned into Float while rows still hold text). A site migration then rolls back, and there's no way to move the site while leaving migrate for later.Change
POST /benches/<bench>/sites/restoreaccepts an optionalskip_migrate(defaultfalse).Bench.new_site_from_backupskipssite.migrate()when it's set. Everything else runs as before: new-site, restore, config update, uninstalling unavailable apps, admin password, scheduler, nginx.Requests without the key behave exactly as they do today.
The press side, which sends this from a desk-only Site Migration checkbox, is in a separate frappe/press PR. Deploy this agent change first, because an older agent ignores the key and still migrates.
Tests
Two tests in
agent/tests/test_site.pyrunnew_site_from_backupwith the bench, site and nginx calls mocked:migrateis called withskip_failing_patches.skip_migrate=True,migrateisn't called, and the admin password and scheduler steps still run.🤖 Generated with Claude Code
This is an automatic backport of pull request #626 done by [Mergify](https://mergify.com).