Skip to content

fix(review): PR #345 follow-ups — error hints and live-test cleanup - #346

Open
Zochory wants to merge 2 commits into
dev-0.7from
feat/lakebase-postgres-state-review-fixes
Open

fix(review): PR #345 follow-ups — error hints and live-test cleanup#346
Zochory wants to merge 2 commits into
dev-0.7from
feat/lakebase-postgres-state-review-fixes

Conversation

@Zochory

@Zochory Zochory commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

Narrow review follow-ups to #345 (Lakebase Postgres state), cut from feat/lakebase-postgres-state:

  • Doctor remediation swallowedrun_daytona_doctor's database step collapsed the sanitized ensure_database_compatible exception into the fixed "Database connection or Alembic revision validation failed." string, so the shared remediation (run uv run python scripts/db_init.py``) never reached operators. The step message now appends the top-level sanitized message only for the closed DatabaseCompatibilityError/`DatabaseConnectionError` types; chained causes (paths, SQLAlchemy internals, secrets) stay hidden.
  • Supervisor hint regression — the preflight catch-all (raise SupervisorError(str(exc))) dropped the actionable "verify FLEET_DATABASE_URL" hint for connection failures. The hint is restored (f"{exc}; verify FLEET_DATABASE_URL") while the dedicated DatabaseCompatibilityError path keeps the remediation message untouched.
  • Live-test cleanup atomicitytest_lakebase_pooled_dml_round_trip used per-step session.commit() calls plus a second DELETE in finally on a possibly re-pinged connection, risking an orphaned fleet_users row on the shared dev instance. Insert/delete now run in engine.begin() transactional blocks and teardown is a single PK-scoped transactional DELETE; all SQL stays parameterized and assertions are unchanged.
  • Flush comment accuracy — the two-phase flush comment claimed "parents are durable"; db.flush() does not commit. Reworded to describe dependency-ordered SQL statement ordering within one transaction.

Test plan

  • uv run pytest tests/unit/backend/test_cli_supervisor.py tests/unit/backend/test_ensure_database_compatible.py tests/unit/backend/test_engine_pool_policy.py tests/unit/backend/test_daytona_diagnostics.py -q — 37 passed
  • git diff --check — clean
  • Live Lakebase proof (FLEET_LIVE=1) remains opt-in and unchanged in scope

Made with Cursor

Address PR #345 review follow-ups:

- doctor database step now appends the closed, sanitized message from
  ensure_database_compatible so the shared remediation
  ("run `uv run python scripts/db_init.py`") reaches the operator surface;
  chained causes stay hidden.
- supervisor preflight catch-all restores the actionable
  "verify FLEET_DATABASE_URL" hint alongside the sanitized message while
  keeping the dedicated DatabaseCompatibilityError remediation path.
- live Lakebase DML round-trip uses engine.begin() transactional blocks
  (plus one PK-scoped transactional DELETE in teardown) so fixture-row
  lifecycle is atomic on the shared dev instance.
- correct the two-phase flush comment in the session catalog: flush orders
  SQL statements within one transaction; it does not confer durability.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 0cf9eced-6dce-4656-a6c2-83fb64b608ca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant