Commit 8ce4c9a
authored
Refactor config loaders (#978)
## Changes
This changes the `*ConfigReaderWriter` classes into `*ConfigModel`
classes. We introduce the following architecture:
* Configs storage is handled by "Storage Medium" such as `BundleFileSet`
and `StateStorage`. They emit event if there is a change. If we can't
monitor the underlying medium for changes, we must emit event from the
"set" method (see `StateStorage`).
* Models are responsible for extracting their respective domain of
configs from whatever storage medium they choose. They are also
responsible for emitting and event if there is a change in any of the
configs in their domain.
* Models might need some information such as target and auth params, to
automatically refresh the configs in their domain. There are multiple
setters which are exposed by each loader for taking this information. We
want to have multiple setters and not a single one because multiple
pieces of information can come at different times. Eg target -> load
auth info and login -> pass auth params to loader
* Models are responsible for correctly writing data to the storage
medium.
## Tests
<!-- How is this tested? -->1 parent 837d3f2 commit 8ce4c9a
File tree
19 files changed
+415
-457
lines changed- packages/databricks-vscode/src
- cluster
- configuration
- models
- ui
- locking
- utils
- vscode-objs
19 files changed
+415
-457
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
| |||
Lines changed: 0 additions & 213 deletions
This file was deleted.
Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
124 | | - | |
125 | | - | |
| 123 | + | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
129 | | - | |
130 | | - | |
| 127 | + | |
131 | 128 | | |
132 | 129 | | |
133 | 130 | | |
134 | | - | |
| 131 | + | |
135 | 132 | | |
136 | 133 | | |
137 | 134 | | |
| |||
271 | 268 | | |
272 | 269 | | |
273 | 270 | | |
274 | | - | |
| 271 | + | |
275 | 272 | | |
276 | 273 | | |
277 | 274 | | |
278 | 275 | | |
279 | 276 | | |
280 | 277 | | |
281 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
282 | 281 | | |
283 | 282 | | |
284 | 283 | | |
| |||
0 commit comments