Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make Mealie Alpha Migrations More Fault Tolerant #3170

Conversation

michael-genson
Copy link
Collaborator

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

This adds some additional try except logic when migrating from Mealie alpha, so bad recipes don't cause the entire migration to fail. It also restores some broken report functionality (probably broken from the Pydantic upgrade, but who knows) and updates the migration tests to catch if it breaks again.

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #3073

Testing

(fill-in or delete this section)

Added a test for bad data handling, and also updated the existing tests to verify the report entries are actually being generated

@@ -109,6 +111,7 @@ def _save_all_entries(self) -> None:
if not is_success and not is_failure:
self.report.status = ReportSummaryStatus.partial

self.report.entries = new_entries
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this used to work. Since we're saving the report again without updating the report's entry list, it should delete all the report entries that we just created. It's doing that now, but I don't know why it wasn't doing that before

Copy link
Collaborator

@boc-the-git boc-the-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boc-the-git boc-the-git merged commit 445ec18 into mealie-recipes:mealie-next Mar 6, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - JSON errors in a single recipe cause the entire Pre-v1 migration to fail
2 participants