Skip to content

feat(replication): add bucket replication rule editing - #195

Merged
overtrue merged 1 commit into
mainfrom
feat/replication-rule-edit
Aug 4, 2026
Merged

feat(replication): add bucket replication rule editing#195
overtrue merged 1 commit into
mainfrom
feat/replication-rule-edit

Conversation

@reatang

@reatang reatang commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The bucket replication tab only supported adding and deleting rules, so target-level settings — most importantly the sync/async replication mode — could never be changed after creation (customer-reported).

This PR adds rule editing with full field parity with the add form:

  • New components/replication/edit-form.tsx: edit dialog prefilled from the rule and its remote target (priority, mode, endpoint, target bucket, credentials, region, storage class, prefix, tags, TLS, existing-object/delete-marker/delete toggles, health check interval, bandwidth), with the same capability gating as the add form.
  • components/buckets/replication-tab.tsx: per-row Edit action (desktop table + mobile cards) and a Mode column (sync/async) joined from the bucket's remote targets; a targets listing failure only disables editing, never the rules table.
  • hooks/use-bucket.ts: setRemoteReplicationTarget gains update + field-group ops (MinIO TargetUpdateType contract: creds / sync / bandwidth).

Saving is a two-step write: the remote target is updated via set-remote-target?update=true&<ops> with only the field groups that actually changed (change detection), then the rule is rewritten in place by ID. The secret key may stay blank — untouched groups keep their stored values server-side, so flipping the replication mode no longer requires re-entering credentials; the secret is required only when connection settings (endpoint, target bucket, TLS, access key) change. The region field is read-only in the edit dialog because the MinIO update contract defines no region group.

Requires the companion server PR rustfs/rustfs#5715. Against older servers the edit dialog degrades: a zero-ops save is a server-side no-op and creds-bearing saves behave like the old full update.

i18n: three new strings translated for all 14 locales (locale-consistency test enforced).

Verification

  • pnpm install --frozen-lockfile — pass
  • pnpm tsc --noEmit — pass
  • pnpm lint — pass
  • pnpm prettier --check on changed files — pass
  • pnpm test:run — 387/387 pass (includes the locale key-parity suite covering the new strings)
  • Manual end-to-end against a local two-site RustFS lab with the companion server build: edit dialog prefill verified field-by-field against server state; async→sync flip with blank secret succeeded and list-remote-targets confirmed credentials untouched; rule-level edits (priority, delete replication toggle, storage class) persisted correctly; server-side credential mismatch surfaces the backend error in the dialog; bidirectional replication smoke passed after each edit.

The replication tab only supported adding and deleting rules, so target
settings — most importantly the sync/async replication mode — could never
be changed after creation.

Add an edit dialog with full field parity with the add form (priority,
mode, endpoint, target bucket, credentials, region, storage class, prefix,
tags, TLS, existing-object/delete-marker/delete toggles, health check,
bandwidth), prefilled from the rule and its remote target. Saving updates
the target via set-remote-target?update=true using the server's
MinIO-style field-group ops (creds/sync/bandwidth) computed by change
detection, then rewrites the rule in place. The secret key can stay blank:
untouched groups keep their stored values server-side, so flipping the
replication mode no longer requires re-entering credentials; the secret is
only required when connection settings actually change. The rules table
gains a replication-mode column joined from the bucket's remote targets.

The region field is read-only in the edit dialog because the MinIO update
contract defines no region group.
@overtrue
overtrue merged commit fee37c6 into main Aug 4, 2026
10 checks passed
@overtrue
overtrue deleted the feat/replication-rule-edit branch August 4, 2026 23:09
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