Skip to content

feat: files-source-provider - #37

Merged
RambokDev merged 2 commits into
mainfrom
feat/files-source-provider
Oct 20, 2026
Merged

RambokDev merged 2 commits into
mainfrom
feat/files-source-provider

Conversation

@RambokDev

@RambokDev RambokDev commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added support for backing up host directories as file-based databases.
    • File backups support archiving, snapshots, synchronization, configurable options, exclusions, and restore guidance.
    • File-based databases are now available throughout project configuration and container mount generation.
    • Added validation for source paths and exclusion patterns.
  • Improvements

    • Updated db add --path help text to clarify supported file and directory paths.
    • db list now displays N/A for the user associated with file-based databases.
  • Tests

    • Added coverage for file backup creation, validation, configuration, mounts, and rendering.

charles-gauthereau added 2 commits October 20, 2026 17:50
Declare a files source (agent 1.24.0+) with portabase agent db add
--engine files --path /srv/dir. The host directory is bind-mounted
read-write at /data<path> and databases.json keeps the container path,
so re-renders rebuild the mount without extra state. Options method,
exclude and one_file_system reuse -o KEY=VALUE.

Mounts now come from DbEngine.mount_for, shared with SQLite.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: da1bdbe0-1e79-4845-b011-b31bd1bd4a12
📥 Commits

Reviewing files that changed from the base of the PR and between bf16d94 and 0a0b874.

📒 Files selected for processing: 10
  • .gitignore
  • commands/db.py
  • engines/__init__.py
  • engines/base.py
  • engines/files.py
  • services/project.py
  • services/renderer.py
  • tests/engines/files.py
  • tests/engines/registry.py
  • tests/services/project.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: 7
  • GitHub Check: dependencies
  • GitHub Check: secrets
  • GitHub Check: audit
  • GitHub Check: types
  • GitHub Check: format
  • GitHub Check: tests
  • GitHub Check: binary
🔇 Additional comments: 10
.gitignore: 1

11-11: LGTM!

commands/db.py: 1

99-102: LGTM!

Also applies to: 249-249

engines/base.py: 1

129-133: LGTM!

engines/__init__.py: 1

8-8: LGTM!

Also applies to: 62-62

tests/engines/files.py: 1

1-114: LGTM!

tests/engines/registry.py: 1

19-19: LGTM!

services/project.py: 1

10-10: LGTM!

Also applies to: 64-64, 120-125

services/renderer.py: 1

129-129: LGTM!

tests/services/project.py: 1

23-23: LGTM!

Also applies to: 93-104, 207-221

engines/files.py: 1

103-110: 🎯 Functional Correctness

The complete source for FilesEngine.from_existing, host_dir, mount_for, and the CLI answer construction is required to decide whether unvalidated relative paths can reach this method.

📝 Walkthrough

The change adds a registered files database engine for host directories, including path and exclude-pattern validation and backup options. Project mount resolution now uses registered engines, and agent Compose rendering includes their mounts. The CLI help and database listing also account for files databases.

Changes: Files database support

Layer / File(s) Summary
Files engine contract and registration
engines/base.py, engines/files.py, engines/__init__.py, tests/engines/*
Adds the files engine, its directory and backup-option handling, path mapping, and agent metadata. Registers the engine and tests its behavior and registry entry.
Engine-based project mounts
services/project.py, services/renderer.py, tests/services/project.py
Preserves paths for non-SQLite database specifications. Resolves unique mounts through registered engines and renders them in agent Compose configuration. Tests cover file specifications and mounts.
Files database CLI support
commands/db.py
Updates the --path help text and displays N/A in the user column for files databases.

Documentation directory ignore rule

Layer / File(s) Summary
Ignore documentation directory
.gitignore
Adds /docs to the ignored paths.

Priority: ➖ Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant AgentProject
  participant ALL as engines.ALL
  participant FilesEngine
  participant ComposeRenderer
  AgentProject->>ALL: Resolve engine for database spec
  ALL-->>AgentProject: Return FilesEngine
  AgentProject->>FilesEngine: Request mount_for(spec)
  FilesEngine-->>AgentProject: Return optional mount paths
  AgentProject->>ComposeRenderer: Provide project.mounts
  ComposeRenderer->>ComposeRenderer: Render mounts in agent Compose configuration
Loading
Merge Risk: ⚪ Minimal · up to 0a0b8

No actionable merge-blocking issue remains; the files database change is ready for normal merge checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 2.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 9 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: adding a files source provider and engine support.
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: Docstring Coverage

Explanation

Docstring coverage is 2.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 9 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 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 each path at night,
And maps the folders clean and right.
Excludes pass through careful checks,
Mounts join the Compose project specs.
The engine joins the registry line,
While docs stay out of version time.

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

@RambokDev
RambokDev merged commit 6258ca9 into main Oct 20, 2026
9 checks passed
@RambokDev
RambokDev deleted the feat/files-source-provider branch October 20, 2026 18:45
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