Skip to content

fix: support configurable backup file prefix#83

Merged
RambokDev merged 1 commit into
Portabase:devfrom
Antoninj:agent/configurable-backup-file-prefix
Jul 21, 2026
Merged

fix: support configurable backup file prefix#83
RambokDev merged 1 commit into
Portabase:devfrom
Antoninj:agent/configurable-backup-file-prefix

Conversation

@Antoninj

@Antoninj Antoninj commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Consumes the optional prefix included with each storage channel in the dashboard-to-agent status payload.

  • Preserves backups as the default when the field is absent, for compatibility with existing dashboards.
  • Normalizes surrounding whitespace and slashes.
  • Uses the shared path builder for S3, Azure Blob, Google Cloud Storage, Google Drive, and local uploads.
  • Adds focused coverage for default and configured paths.

Coordinated changes

Deploy this PR together with the dashboard change before setting a custom prefix.

Validation

Not run locally: cargo is unavailable in the development environment.

Summary by CodeRabbit

  • New Features

    • Added optional storage path prefixes for uploaded backups.
    • Applied configured prefixes consistently across local, S3, Azure Blob, Google Cloud Storage, and Google Drive destinations.
    • Backups continue using the default backups path when no prefix is configured.
    • Prefixes are normalized to produce consistent destination paths.
  • Tests

    • Added coverage for default and customized backup prefixes.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Storage prefix propagation

Layer / File(s) Summary
Prefix contract and path construction
src/services/api/models/agent/status.rs, src/utils/file.rs, src/tests/utils/file_tests.rs
DatabaseStorage accepts an optional prefix, path construction normalizes it with a backups fallback, and tests cover default and configured prefixes.
Provider remote path integration
src/services/storage/providers/{azure_blob,google_cloud_storage,google_drive,s3}/*, src/services/storage/providers/local.rs
All supported storage providers pass the configured prefix when generating upload destination paths.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: rambokdev

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding configurable backup file prefixes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/tests/utils/file_tests.rs (1)

33-42: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the normalization edge cases.

Add cases for surrounding whitespace, empty/only-slash prefixes falling back to backups, and nested prefixes. The current test proves only the default and one configured happy path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tests/utils/file_tests.rs` around lines 33 - 42, Extend
full_file_path_uses_default_or_configured_prefix to cover prefixes with
surrounding whitespace, empty or slash-only values falling back to the backups
prefix, and nested configured prefixes. Keep the existing default and
configured-path assertions, and verify each resulting path still ends with the
file name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/tests/utils/file_tests.rs`:
- Around line 33-42: Extend full_file_path_uses_default_or_configured_prefix to
cover prefixes with surrounding whitespace, empty or slash-only values falling
back to the backups prefix, and nested configured prefixes. Keep the existing
default and configured-path assertions, and verify each resulting path still
ends with the file name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 44527110-f44f-4f2e-b2a5-f785b409a058

📥 Commits

Reviewing files that changed from the base of the PR and between 82ffb71 and 44e6217.

📒 Files selected for processing (8)
  • src/services/api/models/agent/status.rs
  • src/services/storage/providers/azure_blob/mod.rs
  • src/services/storage/providers/google_cloud_storage/mod.rs
  • src/services/storage/providers/google_drive/mod.rs
  • src/services/storage/providers/local.rs
  • src/services/storage/providers/s3/mod.rs
  • src/tests/utils/file_tests.rs
  • src/utils/file.rs

@RambokDev
RambokDev changed the base branch from main to dev July 21, 2026 19:49
@RambokDev RambokDev changed the title feat: support configurable backup file prefix fix: support configurable backup file prefix Jul 21, 2026
@RambokDev
RambokDev merged commit 92a3324 into Portabase:dev Jul 21, 2026
1 check passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 21, 2026
Merged
RambokDev added a commit that referenced this pull request Jul 21, 2026
* fix: support configurable backup file prefix (#83)

* fix: backup folder name

* fix: ghcr publish agent image

---------

Co-authored-by: Antonin Jousson <18756890+Antoninj@users.noreply.github.com>
Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com>
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