Skip to content

Field-level drift — shares/users/groups (#57)#6

Merged
ChrisonSimtian merged 1 commit into
mainfrom
feat/field-level-drift
May 31, 2026
Merged

Field-level drift — shares/users/groups (#57)#6
ChrisonSimtian merged 1 commit into
mainfrom
feat/field-level-drift

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

The reconciler now does existence + field reconciliation: on an existing+desired resource it diffs field values and emits a Modify action when managed fields drift (previously existence-only).

What

  • Reads current state via synoshare --get / synouser --get / synogroup --descget. New GetFields parser handles both the dotted (Comment ....[x]) and colon (User Mail : [x]) label [value] formats.
  • Managed fields: share/group Description, user FullName/Email. Setters: synoshare --setdesc, synogroup --descset, synouser --modify.
    • expired is preserved (not modelled in the spec).
    • Empty/null spec fields are unmanaged — never clobbered. (So you can't blank a field via the reconciler; documented.)
    • Path changes aren't supported (that's a recreate).
  • ActionKind.Modify (+ ~ modify render line showing old → new).
  • 7 new reconciler tests (drift / no-drift / unmanaged / preserve-email). 19 total.

Verified live (read-only, zero mutation)

= skip   group users  (in sync)
~ modify share web  (desc 'System default shared folder' → 'DRIFT TEST - not applied')
      $ synoshare --setdesc web 'DRIFT TEST - not applied'

Still parked

List-valued fields (share ACLs, group membership) and NFS (synowebapi) — later phases.

🤖 Generated with Claude Code

The reconciler now diffs field values on existing resources, not just
existence — emitting a Modify action when managed fields drift.

- Reads current state via --get / --descget (GetFields parser handles both
  the dotted `synoshare` and colon `synouser` "label [value]" formats).
- Managed fields: share/group Description, user FullName/Email. Setters:
  synoshare --setdesc, synogroup --descset, synouser --modify. expired is
  preserved (not modelled); empty/null spec fields are UNMANAGED (no clobber).
- ActionKind.Modify (+ "~ modify" render).
- 7 new reconciler tests (drift / no-drift / unmanaged / preserve-email).

Verified live, read-only (2026-05-31): plan showed `users` group in-sync and
`web` share desc drift with the exact --setdesc command — zero mutation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit 51c4395 into main May 31, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the feat/field-level-drift branch May 31, 2026 10:32
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