You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8d573e4
Browse filesBrowse the repository at this point in the historyBrowse files
`ImportConfigAdapter` grew `GetOrphan` / `GetSensitivePaths` so cache backends could surface Intent metadata through the same type used for tree walk. JSON/XML forever stubbed those accessors; the import processor never reads them. Every new Intent-only field would force another stub on device/running importers — classic shallow widening.
8
+
9
+
**Decision:** narrow `ImportConfigAdapter` to tree walk plus import-needed metadata (name, priority, deletes, non-revertive). Introduce `IntentAdapter` (`ImportConfigAdapter` + `GetOrphan` / `GetSensitivePaths`) in `pkg/tree/importer`. Client Intent reads (`InstanceIntentGet` / `InstanceIntentGetAll`, and their bound equivalents) return `IntentAdapter`; Running reads (`InstanceRunningGet`) stay `ImportConfigAdapter`. `documentImporter` and `ProtoTreeImporter` implement `IntentAdapter`; JSON/XML do not.
10
+
11
+
## Considered options
12
+
13
+
-**Type-assert Orphan/SensitivePaths at Intent call sites.** Rejected: silent miss when a non-Intent adapter arrives; callers must remember to assert.
14
+
-**Separate Client methods for Intent metadata.** Rejected: extra hop for every Intent Get; metadata belongs with the adapter already in hand.
15
+
-**Keep a single return type; leave stubs on JSON/XML.** Rejected: fails the deletion test — every new Intent field forces another stub.
16
+
-**Name `IntentDescriptor`.** Rejected: clashes with northbound response vocabulary; `IntentAdapter` mirrors `ImportConfigAdapter` and stays distinct from `IntentResponseAdapter`.
17
+
-**House `IntentAdapter` under `pkg/cache`.** Rejected: would create a cache←tree reverse dependency or force a wrapper; it lives beside `ImportConfigAdapter` in `pkg/tree/importer`.
18
+
19
+
## Consequences
20
+
21
+
Intent-only metadata no longer pollutes device/running importers. `populateSensitivePathIndex` and GetIntent read Orphan/SensitivePaths through `IntentAdapter`. `configsnapshot.NewImportAdapter` returns `IntentAdapter`. Expanding GetIntentResponse / TransactionIntent / config-server wire is out of scope for this split.
0 commit comments