Fix SQLite source-tree migration discovery#129
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
|
🚀 Deploy Preview PR Created/Updated A deploy preview has been created/updated for this PR. Deploy PR: https://github.com/OpenHands/deploy/pull/4348 Once the deploy PR's CI passes, the automation service will be deployed to the feature environment. |
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Clean refactoring that extracts migration path discovery into a testable helper while maintaining backward compatibility through a prioritized fallback chain.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
Backward-compatible refactoring with comprehensive test coverage. All previous migration paths are preserved as fallbacks, ensuring no breaking changes for packaged installs, source checkouts, or legacy layouts.
VERDICT:
✅ Worth merging: Solid engineering that fixes issue #128 with well-tested code.
KEY INSIGHT:
The three-candidate fallback approach elegantly handles multiple deployment contexts (packaged wheel, source checkout, legacy) without special-case logic, making the code both maintainable and robust.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/automation/actions/runs/26139299198
Summary
migrations/path viapackage_dir.parent.parent / "migrations".package_dir.parent / "migrations"path as a legacy fallback.Fixes #128.
Tests
uv run pytest tests/test_app_migrations.py -vuv run ruff check openhands/automation/app.py tests/test_app_migrations.pyuv run ruff format --check openhands/automation/app.py tests/test_app_migrations.pyuv run pre-commit run --files openhands/automation/app.py tests/test_app_migrations.py --show-diff-on-failureuv run pytest tests/ -v --ignore=tests/integration, but the full suite could not complete because this environment does not have a Docker daemon available for testcontainers.This PR was created by an AI agent (OpenHands) on behalf of the user.
@neubig can click here to continue refining the PR