Skip to content

Conversation

@amibranch
Copy link
Contributor

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository.
  • I made sure to follow the project's coding style.
  • I've documented every RZ_API function and struct this PR changes.
  • I've added tests that prove my changes are effective (required for changes to RZ_API).
  • I've updated the Rizin book with the relevant information (if needed).
  • I've used AI tools to generate fully or partially these code changes and I'm sure the changes are not copyrighted by somebody else.

Detailed description

This PR will add a backup-mechanism. This is done to preserve a project before it is migrated, in case the side-effects of a migration are not intended by a user.

Please NOTE:

  • The API-changes were not really intended in the first place - they were just an easy solution. Feel free to reach out to me, how to avoid them or what needs to be considered
  • Further discussions should also take place in the linked issue (to avoid spreading the discussions across multiple places).
  • The free version of ChatGPT was used to create the compare_files-function, used in the integration test.

Test plan

To test this:

  • Load a project file with a dated version (e.g. from test/prj/...) into rizin (e.g. via ./binrz/rizin/rizin -p ../test/prj/v1-noreturn.rzdb from build-dir)
  • Verify that it is migrated accordingly (project migrated from version X to Y.)
  • Save the file (e.g. while exiting rizin)
  • Now, there should be a backup file next to the original file with the original version (e.g. .v1-noreturn.rzdb_1.BAK)
  • This backup-file must be identical to the originally loaded project file - reloading it, must again trigger a migration!

Closing issues

#5533

@amibranch amibranch force-pushed the backup_migrated_projects branch from b1693c9 to d3bea46 Compare January 12, 2026 06:58
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 46.42857% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.53%. Comparing base (141f05b) to head (d3bea46).
⚠️ Report is 26 commits behind head on dev.

Files with missing lines Patch % Lines
librz/core/project.c 43.75% 16 Missing and 11 partials ⚠️
librz/main/rizin.c 0.00% 2 Missing ⚠️
librz/core/project_migrate.c 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
librz/core/core.c 59.65% <100.00%> (+0.02%) ⬆️
librz/util/sdb/src/sdb.c 51.19% <100.00%> (+0.18%) ⬆️
librz/core/project_migrate.c 71.51% <66.66%> (-0.05%) ⬇️
librz/main/rizin.c 50.21% <0.00%> (-0.11%) ⬇️
librz/core/project.c 41.07% <43.75%> (+0.74%) ⬆️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 141f05b...d3bea46. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

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

Add a test to cover the lines in rizin.c please

@Rot127 Rot127 added the Requirements not met The PR doesn't meet the minimum contribution requirements. See CONTRIBUTING.md for details. label Jan 14, 2026
@Rot127 Rot127 marked this pull request as draft January 14, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Requirements not met The PR doesn't meet the minimum contribution requirements. See CONTRIBUTING.md for details. rizin rz-test RzCore RzUtil

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants