Skip to content

chore(deps): upgrade psycopg packages to version 3.3.0#8222

Merged
sriramveeraghanta merged 3 commits intopreviewfrom
fix-psycopg-version
Dec 5, 2025
Merged

chore(deps): upgrade psycopg packages to version 3.3.0#8222
sriramveeraghanta merged 3 commits intopreviewfrom
fix-psycopg-version

Conversation

@pablohashescobar
Copy link
Member

@pablohashescobar pablohashescobar commented Dec 2, 2025

Description

chore(deps): upgrade psycopg packages to version 3.3.0

Type of Change

  • Improvement (change that would cause existing functionality to not work as expected)

Test Scenarios

  • manually test the entire platform lightly

Summary by CodeRabbit

  • Chores

    • Updated Postgres-related Python packages to a newer minor release.
    • Pinned CI Python setup to a specific 3.12.x minor version for consistent builds.
  • Bug Fixes

    • Reduced active API filter backends (may affect available filtering behavior).
    • Removed two predefined OpenAPI responses from the public API spec.
  • Style / Tests

    • Various formatting, import cleanup, and test tidy-ups; no behavior changes.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 2, 2025 13:59
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

Walkthrough

Updated Postgres-related packages and CI Python pin; removed some DRF filter backends and OpenAPI response exports; applied small refactors and formatting changes across several view, URL, task, and test files.

Changes

Cohort / File(s) Change Summary
Dependency updates
apps/api/requirements/base.txt
Bumped psycopg, psycopg-binary, and psycopg-c from 3.2.9 to 3.3.0.
CI workflow pinning
.github/workflows/pull-request-build-lint-api.yml
Changed GitHub Actions Python setup from 3.x to 3.12.x (pin minor version).
Filter backends removed
apps/api/plane/api/views/base.py
Removed DjangoFilterBackend and SearchFilter from DRF filter_backends list.
OpenAPI exports trimmed
apps/api/plane/api/views/module.py
Removed ARCHIVED_RESPONSE and UNARCHIVED_RESPONSE from the module's imports/exports.
Query formatting / minor refactors
apps/api/plane/app/views/search/base.py
Reflowed queryset .values(...) calls and compacted formatting of Subquery/ArrayAgg/Coalesce usages; no semantic changes.
Import / formatting tidy
apps/api/plane/api/urls/member.py, apps/api/plane/bgtasks/export_task.py
Rewrote single-line import to multi-line wrapped import; removed unused defaultdict import.
Exception handling minor change
apps/api/plane/app/views/user/base.py
Changed except Exception as e: to except Exception: (removed exception binding).
Tests cleanup / imports
apps/api/plane/tests/contract/api/test_cycles.py
Removed unused imports and cleaned whitespace/formatting in tests; no test logic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to DB-related behavior changes from psycopg 3.3.0 (connection params, async APIs).
  • Verify removal of DRF filter backends doesn't affect endpoints relying on those filters.
  • Confirm OpenAPI schema and any code referencing the removed response constants still build.
  • Scan for any CI/runtime mismatches introduced by pinning Python to 3.12.x.

Poem

🐇 I nibble lines of code beneath the moon,
Pushed packages forward, tuned the CI tune.
Trimmed a filter, tidied imports neat,
Hopped through tests with tiny feet—
A quiet hop, the repo hums in tune. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: upgrading psycopg packages to version 3.3.0, which aligns with the primary change in the changeset.
Description check ✅ Passed The PR description includes the required template sections (Description, Type of Change, Test Scenarios) with appropriate details. Description matches the actual changes, type is marked, and testing approach is documented.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-psycopg-version

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03c0918 and dac5b7c.

📒 Files selected for processing (7)
  • apps/api/plane/api/urls/member.py (1 hunks)
  • apps/api/plane/api/views/base.py (0 hunks)
  • apps/api/plane/api/views/module.py (0 hunks)
  • apps/api/plane/app/views/search/base.py (13 hunks)
  • apps/api/plane/app/views/user/base.py (1 hunks)
  • apps/api/plane/bgtasks/export_task.py (0 hunks)
  • apps/api/plane/tests/contract/api/test_cycles.py (8 hunks)
💤 Files with no reviewable changes (3)
  • apps/api/plane/api/views/module.py
  • apps/api/plane/bgtasks/export_task.py
  • apps/api/plane/api/views/base.py
✅ Files skipped from review due to trivial changes (1)
  • apps/api/plane/api/urls/member.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-17T10:46:13.825Z
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7969
File: apps/api/plane/api/views/cycle.py:1218-1228
Timestamp: 2025-10-17T10:46:13.825Z
Learning: In the cycle transfer functionality in apps/api/plane/api/views/cycle.py, transfers should only be allowed from completed cycles (end_date < timezone.now()), not from active or draft cycles. The guard should block when end_date is None or end_date >= timezone.now().

Applied to files:

  • apps/api/plane/tests/contract/api/test_cycles.py
📚 Learning: 2025-10-29T09:17:54.815Z
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7905
File: apps/api/plane/app/views/search/base.py:241-276
Timestamp: 2025-10-29T09:17:54.815Z
Learning: In apps/api/plane/app/views/search/base.py, the `filter_intakes` method uses `Issue.objects` (base manager) instead of `Issue.issue_objects` (custom manager) because the custom manager filters out all intake statuses, which would prevent querying pending and snoozed intake issues.

Applied to files:

  • apps/api/plane/app/views/search/base.py
🧬 Code graph analysis (2)
apps/api/plane/tests/contract/api/test_cycles.py (1)
apps/api/plane/tests/conftest.py (2)
  • api_key_client (57-60)
  • create_user (33-42)
apps/api/plane/app/views/search/base.py (2)
apps/api/plane/db/models/page.py (1)
  • ProjectPage (131-151)
apps/api/plane/api/views/base.py (2)
  • project_id (144-150)
  • project_id (259-265)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
apps/api/plane/app/views/user/base.py (1)

213-213: LGTM! Correctly removes unused exception variable.

The exception variable was not referenced in the handler block, so removing the binding is appropriate.

apps/api/plane/tests/contract/api/test_cycles.py (2)

4-4: LGTM! Removes unused import.

IntegrityError was not used anywhere in the test file.


196-380: LGTM! Formatting and whitespace cleanup.

The changes normalize whitespace and reformat function signatures without altering test logic or assertions.

apps/api/plane/app/views/search/base.py (1)

132-647: LGTM! Consistent formatting improvements across query methods.

The changes normalize formatting for .values() calls, Q objects, and list comprehensions without modifying query logic, field selections, or filters.


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 and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the psycopg PostgreSQL adapter packages from version 3.2.9 to 3.3.0 across all three related packages (psycopg, psycopg-binary, and psycopg-c). The upgrade maintains consistency across the dependency stack and is compatible with the existing Django 4.2.26 framework. This is a maintenance update to keep database adapter dependencies current.

Key changes:

  • Upgraded psycopg package from 3.2.9 to 3.3.0
  • Upgraded psycopg-binary package from 3.2.9 to 3.3.0
  • Upgraded psycopg-c package from 3.2.9 to 3.3.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e650b19 and 0873475.

📒 Files selected for processing (1)
  • apps/api/requirements/base.txt (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Agent
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/api/requirements/base.txt (1)

1-73: Clarify testing scope for the psycopg upgrade.

The PR summary notes "lightly manually tested end-to-end." For a database driver upgrade, consider documenting whether automated tests cover:

  • Database connection establishment (sync and async, if applicable)
  • Query execution and result handling
  • Data integrity and type conversions
  • Connection pooling (if used)
  • Error scenarios and recovery

This helps ensure the upgrade doesn't introduce subtle regressions in production.

Comment on lines +8 to +10
psycopg==3.3.0
psycopg-binary==3.3.0
psycopg-c==3.3.0
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, check the actual requirements file content around the psycopg packages
cat -n apps/api/requirements/base.txt | head -20

Repository: makeplane/plane

Length of output: 497


🏁 Script executed:

# Check if there are multiple requirements files and how psycopg is managed across them
find apps/api/requirements -type f -name "*.txt" | sort

Repository: makeplane/plane

Length of output: 189


🏁 Script executed:

# Look for any setup.py, setup.cfg, or pyproject.toml that might define psycopg extras
fd -t f \( -name "setup.py" -o -name "setup.cfg" -o -name "pyproject.toml" \) apps/

Repository: makeplane/plane

Length of output: 289


🏁 Script executed:

# Search for any comments or documentation about psycopg package choice
rg -B 3 -A 3 "psycopg" apps/api/requirements/ -C 2

Repository: makeplane/plane

Length of output: 399


🌐 Web query:

psycopg 3 binary c extension separate pinning requirements.txt best practice

💡 Result:

Short best-practices for using Psycopg‑3 (binary vs C extension) and pinning in requirements.txt:

  1. Choose the installer that matches your environment

    • For most apps use the prebuilt wheels: pip install "psycopg[binary]". It bundles the C extension and libpq so you avoid build tools and system libpq. [1][2]
    • If you need a system libpq (specific libpq features or unsupported platform) or want to build the extension yourself, install the C build: pip install "psycopg[c]" (requires libpq and build tools) or use the pure‑Python package when appropriate. [1]
  2. Pin explicitly in requirements files (and lock transitive deps)

    • In requirements.txt pin the package and the extra you rely on, e.g.:
      psycopg[binary]==3.2.10
    • If you build from source on CI/production, pin psycopg[c]== or pin the same psycopg version but ensure build deps (libpq, headers, compiler) are provided by your images. [1]
  3. Separate concerns (best practice)

    • Keep runtime requirements (what ships to production) separate from dev/build requirements:
      • requirements.txt (runtime): psycopg[binary]==X.Y.Z
      • requirements-dev.txt or Dockerfile (build/CI): system packages (libpq-dev), compiler, and optional psycopg[c] if you build locally.
    • Alternatively use a lockfile tool (pip-tools, pip‑freeze, poetry.lock) to capture exact transitive versions and platform wheels for reproducible installs.
  4. Be platform-aware

    • Binary wheels are produced for a set of platforms; verify your target platform/wheel exists (macOS ARM, older macOS, Linux manylinux) — if not, use local build or system libpq. Use psycopg.pq.version() / build_version to inspect bundled libpq if needed. [1][4]
  5. CI / container recommendations

    • For containers, either: (a) use psycopg[binary] in your runtime image (simpler), or (b) install system libpq and build tools in build stage and pin psycopg (or psycopg[c]) if you require system libpq. Keep runtime images minimal by only installing runtime wheel. [1][5]

References

  • Psycopg installation docs (binary/local/pure Python and handling dependencies). [1]
  • Psycopg GitHub/README install notes. [2]
  • PyPI / packaging notes about psycopg-binary availability and wheel builds. [4]

If you want, tell me your target OS/Python and whether you control the container/CI and I’ll give a concrete requirements.txt + Dockerfile example.


Correct the psycopg package pinning strategy.

The upgrade to psycopg 3.3.0 is valid and backward-compatible with Django 4.2.26. However, pinning psycopg, psycopg-binary, and psycopg-c separately is incorrect. These are mutually exclusive installation methods, not complementary packages:

  • psycopg[binary]: prebuilt wheel with bundled libpq (recommended for most deployments)
  • psycopg[c]: source build requiring system libpq and build tools
  • psycopg: pure-Python fallback

The requirements file should pin only one option. For standard deployments, replace lines 8-10 with:

psycopg[binary]==3.3.0

If your deployment requires building from source, use psycopg[c]==3.3.0 instead and ensure libpq and build tools are available in your environment.

🤖 Prompt for AI Agents
In apps/api/requirements/base.txt around lines 8 to 10, the three separate pins
for psycopg, psycopg-binary, and psycopg-c are incorrect because they are
mutually exclusive installation options; remove the three lines and replace them
with a single pin for the appropriate install method (for most deployments use
psycopg[binary]==3.3.0; if you must build from source use psycopg[c]==3.3.0) and
ensure any deployment-specific system libs/build-tools are provisioned when
choosing the [c] option.

@sriramveeraghanta sriramveeraghanta merged commit f81e120 into preview Dec 5, 2025
9 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix-psycopg-version branch December 5, 2025 10:36
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.

4 participants