Skip to content

fix(rm): preserve recursive purge semantics#190

Open
overtrue wants to merge 1 commit intomainfrom
daily-bug-scan/integration-latest-regressions
Open

fix(rm): preserve recursive purge semantics#190
overtrue wants to merge 1 commit intomainfrom
daily-bug-scan/integration-latest-regressions

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented May 9, 2026

Summary

  • Route recursive rm --purge through single-object delete requests so RustFS applies force-delete semantics to each object.
  • Align the CORS stdin integration assertion with the existing camelCase JSON output contract.

Evidence

  • The scheduled Full Integration run on main failed in bucket_operations::test_bucket_cors_set_accepts_stdin_source and version_operations::test_rm_recursive_purge_permanently_deletes_versioned_prefix.
  • Both failures reproduced locally against rustfs/rustfs:latest using an isolated RustFS container.
  • Recursive purge reported deleted keys, but version list still showed delete markers and original versions because the batch delete path did not purge versions on latest RustFS.

Safety

  • Non-purge recursive deletion still uses the existing batch delete path.
  • The purge path reuses the existing single-object delete behavior already validated by the single-object purge integration test.
  • The CORS change only updates the test assertion to match the existing public JSON shape.

Validation

  • cargo test --package rustfs-cli --test integration --features integration bucket_operations::test_bucket_cors_set_accepts_stdin_source -- --exact --test-threads=1
  • cargo test --package rustfs-cli --test integration --features integration version_operations::test_rm_recursive_purge_permanently_deletes_versioned_prefix -- --exact --test-threads=1
  • cargo test --package rustfs-cli --test integration --features integration -- --test-threads=1
  • make pre-commit

Copilot AI review requested due to automatic review settings May 9, 2026 00:35
Copy link
Copy Markdown
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 fixes recursive rm --purge behavior by ensuring each object under a prefix is force-deleted via single-object delete requests (matching RustFS semantics), and updates a CORS stdin integration test assertion to match the existing camelCase JSON output contract.

Changes:

  • Route recursive purge deletes through delete_single (one request per key) instead of the batch delete path.
  • Update CORS integration test to assert allowedMethods rather than allowed_methods in JSON output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/cli/tests/integration.rs Adjusts CORS JSON assertion to use the camelCase allowedMethods field.
crates/cli/src/commands/rm.rs Adds a dedicated recursive --purge path that deletes keys individually via the single-object delete API.

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

Comment thread crates/cli/src/commands/rm.rs Outdated
@overtrue overtrue force-pushed the daily-bug-scan/integration-latest-regressions branch from ca7d5fe to 4459f0c Compare May 9, 2026 00:43
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