Skip to content

feat(postgresql-cluster): physical incremental backup method - #45

Open
RambokDev wants to merge 2 commits into
mainfrom
feat/postgresql-physical-incremental
Open

RambokDev wants to merge 2 commits into
mainfrom
feat/postgresql-physical-incremental

Conversation

@RambokDev

@RambokDev RambokDev commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • PostgreSQL setup now offers archive and physical backup methods, with a configurable full-backup interval for physical backups.
    • Physical restores can use a mounted restore folder when configured, and the agent receives its path automatically.
  • Bug Fixes
    • Invalid backup intervals are rejected, and physical backups cannot be selected when creating a new database.

postgresql-cluster gets -o method (archive, physical) and
-o full_every_days. physical mounts ./restores into the agent and sets
RESTORE_PATH; it is refused in new mode, where the CLI-created
container is not set up for replication.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

PostgreSQL cluster options now include archive and physical backup methods, with validation for physical backup intervals. Physical mode adds a restore mount for existing databases. Agent Compose rendering sets RESTORE_PATH when that mount is present.

Changes: PostgreSQL Backup and Restore

Layer / File(s) Summary
Backup options and validation
engines/postgresql.py, tests/engines/postgresql_cluster.py
Cluster options include archive and physical methods, with archive as the default. Physical mode adds a full_every_days option that defaults to 7 and must be at least 1. Generating a new database in physical mode raises a validation error. Tests cover option collection and validation.
Restore mount and agent rendering
engines/postgresql.py, services/project.py, services/renderer.py, templates/agent.yml.j2, tests/engines/postgresql_cluster.py
Physical mode adds a restore mount. The project and renderer pass its container path to the agent template, which sets RESTORE_PATH when the path is present. Tests cover rendering with physical and archive options.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant PostgresClusterEngine
  participant AgentProject
  participant ComposeRenderer
  participant AgentTemplate
  PostgresClusterEngine->>AgentProject: Physical mode adds restore mount
  AgentProject->>ComposeRenderer: Provides restore_path from project mounts
  ComposeRenderer->>AgentTemplate: Passes restore_path in template context
  AgentTemplate->>AgentTemplate: Sets RESTORE_PATH when restore_path is present
Loading
Merge Risk: Minimal · up to 1b6e4

This change adds physical backup options for PostgreSQL clusters with interval validation and a restore folder mount. No merge-blocking risk was identified in the supplied changes, and tests cover the new behavior.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a physical incremental backup method for the PostgreSQL cluster engine. The changeset adds a physical backup method option, a physical-only full_every_days setting…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a physical incremental backup method for the PostgreSQL cluster engine. The changeset adds a physical backup method option, a physical-only full_every_days setting defaulting to 7, validation that rejects values below 1, restore mount support, and agent rendering for restores. The title is specific and matches the primary intent stated in the PR objectives. It does not list every detail, which is expected.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

A rabbit checks the backup plan,
Archive first, then restore span.
Seven days mark the full-backup pace,
A mounted folder finds its place.
RESTORE_PATH joins the agent's run,
And hops away when work is done.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: cb4ed015-ee14-448d-bb4d-e10d98962970
Commits

Reviewing files that changed from the base of the PR and between 4725f4d and 1b6e48c.

Files selected for processing: 1

  • engines/postgresql.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit

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