Skip to content

feat(rc-versioning)!: add version-aware object operations#270

Closed
cxymds wants to merge 1 commit into
cxymds/issue-1362-output-v3from
cxymds/issue-1368-versioning
Closed

feat(rc-versioning)!: add version-aware object operations#270
cxymds wants to merge 1 commit into
cxymds/issue-1362-output-v3from
cxymds/issue-1368-versioning

Conversation

@cxymds

@cxymds cxymds commented Jul 21, 2026

Copy link
Copy Markdown
Member

Related issues and stack

Background and user impact

Version selectors reached the S3 adapter, but version-aware JSON still used legacy command-specific shapes. Partial multi-version deletion discarded successful removals, JSON dry runs mixed human text with JSON, and status-only authorization responses could be misclassified. The version-specific ObjectStore additions also had no safe defaults for non-S3 implementors, while the end-to-end version suite was disabled on Windows.

Root cause

  • Version deletion collapsed backend failures to paths and returned an error without preserving successes from the same request.
  • Version-aware stat, copy, and remove paths did not adopt the output v3 operation envelope.
  • Dry-run reporting wrote per-item text before the JSON summary.
  • S3 error mapping inspected message strings before authoritative 401/403 status metadata in key paths.
  • New ObjectStore methods were required even when a backend could safely delegate unversioned operations or reject version-specific ones.

Solution

  • Emit schema v3 versioned_objects records for exact-version stat, version-bearing copy results, and version-aware removal.
  • Preserve source and destination version IDs, selected stat version IDs, removed versions, delete markers, and per-version failures.
  • Retain successful deletions in partial failures, reconcile omitted batch results, and make critical authentication/usage failures override earlier ordinary failures.
  • Emit exactly one JSON document for version removal dry runs, with explicit dry_run, outcome, planned, removed, failed, and summary fields.
  • Add safe ObjectStore defaults that delegate unversioned reads/deletes and return UnsupportedFeature for unsupported version-specific behavior.
  • Prefer structured authorization status/code metadata while keeping governance-retention denial distinct.
  • Run the versioned-object end-to-end suite on Windows and use the platform executable suffix.
  • Add output v3 schema contracts, golden fixtures, runtime tests, and protected command-reference documentation.

BREAKING change and migration

BREAKING: JSON produced by stat --version-id, rm --version-id, rm --versions, and cp when the server reports version identifiers now uses the schema v3 versioned_objects envelope. Successful data moves under data; partial and failed operations use status: error, retain operation data, and are written as one JSON document to stderr.

Unversioned stat/rm/cp JSON remains in its legacy shape. schemas/output_v1.json and schemas/output_v2.json are byte-for-byte unchanged. Consumers should dispatch on schema_version, read operation results under data, and use data.planned instead of data.removed for dry runs. The command references and output migration guide document the exact field mapping.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace
  • INSTA_UPDATE=no cargo test -p rustfs-cli --features golden --test golden --target-dir /tmp/rc-target-1368-fix
  • cargo test -p rustfs-cli --test output_schema_v3
  • Focused mixed-exit-priority, partial-removal, dry-run, stderr, and 401/403 authorization regressions
  • Confirmed output v1/v2 Git blobs are unchanged from the stacked base

@cxymds
cxymds marked this pull request as ready for review July 21, 2026 06:06
@cxymds cxymds changed the title feat(rc-versioning): add version-aware object operations feat(rc-versioning)!: add version-aware object operations Jul 21, 2026
@cxymds
cxymds force-pushed the cxymds/issue-1368-versioning branch from b16f9d4 to 7986997 Compare July 21, 2026 08:16
@cxymds
cxymds changed the base branch from main to cxymds/issue-1362-output-v3 July 21, 2026 08:16
@cxymds
cxymds deleted the branch cxymds/issue-1362-output-v3 July 22, 2026 13:02
@cxymds cxymds closed this Jul 22, 2026
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