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: restoring site breaks when checking backup version (backport #26186) #26203

Merged

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 29, 2024

When restoring a site from a backup SQL file, the restore fails due to an error when checking the version of the backup file. The backup_version variable exists if and only if the if match branch executes, but it is used in a condition in a scope where it may not exist. Changing the variable to match leads to correct behaviour.


This is an automatic backport of pull request #26186 done by Mergify.

* fix: restoring site breaks when checking backup version

The `backup_version` variable exists if and only if the `if match` branch executes, but it is used in a condition in a scope where it may not exist. Changing the variable to `match` leads to correct behaviour.

* fix: restoring site breaks when checking backup version

Co-authored-by: Akhil Narang <me@akhilnarang.dev>

* fix: version check when restoring site should be done from `match` scope

* chore: add a `return None` for better readability

No functional difference, just easier to understand/read the code.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 0576668)
@mergify mergify bot requested a review from a team as a code owner April 29, 2024 11:10
@mergify mergify bot requested review from akhilnarang and removed request for a team April 29, 2024 11:10
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Apr 29, 2024
@akhilnarang akhilnarang merged commit 1601bd4 into version-15-hotfix Apr 29, 2024
18 checks passed
@akhilnarang akhilnarang deleted the mergify/bp/version-15-hotfix/pr-26186 branch April 29, 2024 11:29
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 15.25.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add-test-cases Add test case to validate fix or enhancement released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants