Skip to content

LCORE-5372: Select psycopg2 explicitly for PostgreSQL database engines - #3116

Merged
tisnik merged 1 commit into
lightspeed-core:release/0.7from
dprince:sqlalchemy_fix_0_7
Nov 2, 2026
Merged

tisnik merged 1 commit into
lightspeed-core:release/0.7from
dprince:sqlalchemy_fix_0_7

Conversation

@dprince

@dprince dprince commented Nov 2, 2026

Copy link
Copy Markdown
Contributor
Select psycopg2 explicitly for PostgreSQL database engines

SQLAlchemy 2.1 changed the default driver for postgresql:// URLs from
psycopg2 to psycopg (version 3). LCS depends on psycopg2-binary, so the
implicit driver selection now fails with ModuleNotFoundError for psycopg
when initializing a PostgreSQL-backed runtime database.

Use postgresql+psycopg2:// to select the existing dependency explicitly
and update the database unit test to expect that URL.

This fixes startup for PostgreSQL-backed deployments, including those
managed by the OpenStack Lightspeed operator, which configures the LCS
runtime database to use PostgreSQL. SQLite-backed deployments do not
exercise this path.

Jira: LCORE-5372

SQLAlchemy 2.1 changed the default driver for postgresql:// URLs from
psycopg2 to psycopg (version 3). LCS depends on psycopg2-binary, so the
implicit driver selection now fails with ModuleNotFoundError for psycopg
when initializing a PostgreSQL-backed runtime database.

Use postgresql+psycopg2:// to select the existing dependency explicitly
and update the database unit test to expect that URL.

This fixes startup for PostgreSQL-backed deployments, including those
managed by the OpenStack Lightspeed operator, which configures the LCS
runtime database to use PostgreSQL. SQLite-backed deployments do not
exercise this path.

Jira: LCORE-5372
@coderabbitai

coderabbitai Bot commented Nov 2, 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

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@dprince
dprince changed the base branch from main to release/0.7 November 2, 2026 17:26

@tisnik tisnik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@tisnik
tisnik merged commit e2864ab into lightspeed-core:release/0.7 Nov 2, 2026
25 of 30 checks passed
@fullsend-ai-retro

fullsend-ai-retro Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 5:52 PM UTC · Completed 6:03 PM UTC

Commit: faef1b0 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.47

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #3116 — LCORE-5372: Select psycopg2 explicitly for PostgreSQL database engines (backport to release/0.7)

Workflow quality: Clean — nothing to improve. This PR is a straightforward backport of PR #3107 (already merged to main) to the release/0.7 branch. It changes the PostgreSQL connection URL from postgresql:// to postgresql+psycopg2:// to accommodate SQLAlchemy 2.1's default driver change, with a matching test update. One human reviewer (tisnik) approved. No agent involvement — no code, review, or fix agents ran. Merged ~26 minutes after creation.

No proposals filed — all findings map to existing open issues. This retro is a near-duplicate of the retro already completed on the parent PR #3107 (retro comment). The same pattern recurs: retro dispatched on a human-only PR merge despite the repo's .fullsend/harness/retro.yaml restricting retro to explicit /fs-retro commands. The root causes and existing coverage:

Repo-local PRs #3112 and #3070 (both still open) aim to work around this by moving the trigger restriction inline into config.yaml, but the platform-level root cause remains unresolved.

Additional data point for fullsend-ai/fullsend#5376 ("Skip retro dispatch for automated cherry-pick PRs that reference an already-analyzed original PR"): PR #3116 is a manual backport of PR #3107, which was already retro-analyzed. The backport introduces no new code — identical 2-line diff — yet triggered a full retro analysis. While #5376 targets automated cherry-picks specifically, this case shows the same waste pattern for manual backports.

Observation — pre-existing E2E failures on release/0.7: Three E2E suites failed (library/ci/default, server/ci/default, server/ci/other), but these are pre-existing and unrelated to this PR's change. Root causes: (1) a hardcoded version assertion expecting 0.7.1 that was not updated when PR #3045 bumped the version to 0.7.2, and (2) CI runner disk space exhaustion during Docker builds. These failures are consistent across recent release/0.7 PRs. The PR was merged despite them.

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.

2 participants