Skip to content

feat: files copy method - #38

Merged
RambokDev merged 2 commits into
mainfrom
feat/files-copy-method
Oct 27, 2026
Merged

RambokDev merged 2 commits into
mainfrom
feat/files-copy-method

Conversation

@RambokDev

@RambokDev RambokDev commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • File backups now support the copy method.
    • Sync configurations can set maximum deletion counts and deleted-data sizes. These limits are only available for sync and can be left empty for no limit.
    • Forms can show or skip questions based on answers provided earlier.
  • Bug Fixes
    • Invalid deletion limits and values supplied for options that do not apply to the selected backup method are now rejected with validation feedback.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters: 1
  • uv.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

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: 41b7b6a5-366b-485d-8532-3a457064b354

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

No actionable comments were generated in the recent review.

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: 5e2f0f7e-5a68-4fcb-9c36-2d2f9515b226
Commits

Reviewing files that changed from the base of the PR and between e36a532 and e675409.

Files selected for processing: 5
  • core/fields.py
  • engines/files.py
  • tests/core/fields.py
  • tests/engines/files.py
  • ui/form.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: 8
  • GitHub Check: secrets
  • GitHub Check: dependencies
  • GitHub Check: tests
  • GitHub Check: format
  • GitHub Check: types
  • GitHub Check: lint
  • GitHub Check: audit
  • GitHub Check: binary
CI failures not shown inline: 2

GitHub Actions: Security / 0_dependencies.txt: feat: files copy method

Conclusion: failure

View job details

##[group]Run entrypoint.sh
 �[36;1mentrypoint.sh�[0m
 shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
 env:
   INPUT_SCAN_TYPE: fs
   INPUT_IMAGE_REF:
   INPUT_SCAN_REF: .
   INPUT_TRIVYIGNORES:
   INPUT_GITHUB_PAT:
   INPUT_LIMIT_SEVERITIES_FOR_SARIF:
   TRIVY_CACHE_DIR: /home/runner/work/cli/cli/.cache/trivy
 ##[endgroup]
 Running Trivy with options: trivy fs .
 	INFO	[vulndb] Need to update DB
 	INFO	[vulndb] Downloading vulnerability DB...
 	INFO	[vulndb] Downloading artifact...	repo="mirror.gcr.io/aquasec/trivy-db:2"
 9.01 MiB / 129.80 MiB [---->_________________________________________________________] 6.94% ? p/s ?45.01 MiB / 129.80 MiB [-------------------->_______________________________________] 34.67% ? p/s ?80.54 MiB / 129.80 MiB [------------------------------------->______________________] 62.05% ? p/s ?115.98 MiB / 129.80 MiB [---------------------------------------->____] 89.35% 178.39 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 178.39 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 178.39 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 168.37 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 168.37 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 168.37 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 157.51 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 157.51 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 157.51 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 147.35 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 147.35 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [--------------------------------...

GitHub Actions: Security / dependencies: feat: files copy method

Conclusion: failure

View job details

##[group]Run entrypoint.sh
 �[36;1mentrypoint.sh�[0m
 shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
 env:
   INPUT_SCAN_TYPE: fs
   INPUT_IMAGE_REF:
   INPUT_SCAN_REF: .
   INPUT_TRIVYIGNORES:
   INPUT_GITHUB_PAT:
   INPUT_LIMIT_SEVERITIES_FOR_SARIF:
   TRIVY_CACHE_DIR: /home/runner/work/cli/cli/.cache/trivy
 ##[endgroup]
 Running Trivy with options: trivy fs .
 	INFO	[vulndb] Need to update DB
 	INFO	[vulndb] Downloading vulnerability DB...
 	INFO	[vulndb] Downloading artifact...	repo="mirror.gcr.io/aquasec/trivy-db:2"
 9.01 MiB / 129.80 MiB [---->_________________________________________________________] 6.94% ? p/s ?45.01 MiB / 129.80 MiB [-------------------->_______________________________________] 34.67% ? p/s ?80.54 MiB / 129.80 MiB [------------------------------------->______________________] 62.05% ? p/s ?115.98 MiB / 129.80 MiB [---------------------------------------->____] 89.35% 178.39 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 178.39 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 178.39 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 168.37 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 168.37 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 168.37 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 157.51 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 157.51 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 157.51 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 147.35 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [------------------------------------------->] 100.00% 147.35 MiB p/s ETA 0s129.80 MiB / 129.80 MiB [--------------------------------...
Additional comments: 5
core/fields.py: 1

19-19: LGTM!

ui/form.py: 1

51-60: LGTM!

tests/core/fields.py: 1

10-17: LGTM!

tests/engines/files.py: 1

1-2: LGTM!

Also applies to: 10-11, 15-15, 24-24, 55-62, 72-73, 75-75, 131-167

engines/files.py: 1

133-134: 🗄️ Data Integrity & Integration

Verify the promised deletion preflight.

If Agent 1.25.0 does not build the complete deletion plan before syncing, the deletion-limit flags cannot support this help-text guarantee. Confirm that behavior, then either add the preflight or remove the guarantee from the help text.

Walkthrough

The form now supports fields that depend on previously collected answers. The files engine adds a copy backup method and sync-only deletion limits with count and size validation.

Changes: File backup options

Layer / File(s) Summary
Conditional form fields
core/fields.py, ui/form.py, tests/core/fields.py
Field adds an optional when callback. Form.collect evaluates it against answers collected so far, skips inapplicable fields without supplied values, and raises ValidationError when a value is supplied for an inapplicable field.
File methods and deletion limits
engines/files.py, tests/engines/files.py
The files engine adds copy and sync-only max_delete and max_delete_size fields. Count and size inputs are validated, and tests cover option collection, serialization, and invalid inputs. The warning now states that these options require Agent 1.25.0 or later.

Priority: Pending latest changes

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

Change: Feature

Merge Risk: Minimal · previous review e6754

This change adds a copy backup method and optional deletion limits for sync, and both are documented as requiring Agent 1.25.0 or later. On older Agents, copy is rejected and the deletion limits have no effect, so sync behaves as it did before this change. No merge-blocking issue was found.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… 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 "feat: files copy method" matches the main change. The objectives state that PR #38 adds a files copy method, and the summaries show copy added as a backup method in engines/files.py, wi…
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 "feat: files copy method" matches the main change. The objectives state that PR #38 adds a files copy method, and the summaries show copy added as a backup method in engines/files.py, with tests for the copy method. The title is short, specific, and follows conventional commit style. It does not cover the sync delete limits (max_delete, max_delete_size), the when field callback, or the size and count validation. Those are secondary to the main change, so the title does not need to list them.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 5 files.

Resolution

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

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • 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 the fields in line
A sync limit keeps counts in time
The size is checked before it goes
A copy path joins what the form now shows
I nibble greens and hop away
With tidy options saved today

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

@RambokDev
RambokDev merged commit 4f27a6e into main Oct 27, 2026
9 checks passed
@RambokDev
RambokDev deleted the feat/files-copy-method branch October 27, 2026 13:16
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