fix: document apply ordering invariant; visible indeterminate checkbox + test

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwxdSt4reTm7Dj1oxRvpP3
This commit is contained in:
2026-07-05 15:26:46 +07:00
parent 2f1f5311ad
commit e283e5f22a
3 changed files with 29 additions and 1 deletions
+6
View File
@@ -25,6 +25,12 @@ type Provider interface {
Name() string
ListZones(ctx context.Context, creds Credentials) ([]Zone, error)
GetRecords(ctx context.Context, creds Credentials, zoneID string) ([]model.Record, error)
// ApplyChanges MUST apply cs.Diffs in the order they are given and must
// not reorder or group them by Kind. The caller (service.Apply)
// deliberately places Delete diffs before Add/Update diffs, because some
// providers (e.g. Selectel) reject creating a CNAME on a name where a
// conflicting A record still exists. Implementations should apply diffs
// sequentially in the given order rather than batching by kind.
ApplyChanges(ctx context.Context, creds Credentials, zoneID string, cs diff.Changeset) error
// Validate checks the credentials are usable (e.g. a trial auth), so a
// bad account is rejected at creation time rather than at first import.