Repository navigation
Commit 80c75a3
feat(versioned): Roundtrip-track changed types (#1296)
* feat(versioned): Add support for from_docs attribute
* feat(versioned): Support conversion tracking through enums
With experimental_conversion_tracking enabled, versioned enums now implement
TrackingFrom instead of From, in line with structs. Variants marked with
as an additional path segment (eg. `$.connector.Iceberg.field`).
Also fix the generated From impls for variants with multiple unnamed fields,
which were missing separating commas.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(versioned): Roundtrip-track changed types
* fix(versioned): Track values as JSON
Tracked values were stored as serde_yaml::Value, which represents enum
variants as YAML tags. After a roundtrip through the JSON status, these could
not be deserialized again, which panicked during the upgrade. The status is
stored as JSON anyway, so values are now tracked as serde_json::Value.
Also fix restoring type changes whose downgraded value is null: it is
serialized as `downgradedValue: null` and deserialized as None, so the
comparison never matched. A missing downgraded value is now treated as null.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(versioned): Only apply tracked values matching the container
Multiple (nested) containers can track values for the same version. Each
tracking impl previously removed the whole list of tracked values for that
version and panicked on JSON paths it didn't know. This broke as soon as two
containers tracked values in the same version, eg. the type change of
`gender` and the added `Married::since` in v3 of the person test.
Each container now only applies the values matching its JSON paths and keeps
all others for the remaining containers. The entry for the version is only
removed once all values have been applied.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Remove test
* docs: Document edge-case
* fmt
* cargo update to fix RUSTSEC-2026-0418
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent a66da25 commit 80c75a3
21 files changed
Lines changed: 1043 additions & 82 deletions
File tree
- crates
- stackable-versioned-macros
- src
- codegen
- container/struct
- item
- utils
- tests
- inputs/pass
- snapshots
- stackable-versioned
- src
- tests
- inputs/conversions/pass
- snapshots
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
179 | 181 | | |
180 | 182 | | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
199 | 206 | | |
200 | 207 | | |
201 | 208 | | |
202 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
203 | 214 | | |
204 | 215 | | |
205 | 216 | | |
| |||
241 | 252 | | |
242 | 253 | | |
243 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
244 | 261 | | |
245 | 262 | | |
246 | 263 | | |
| |||
254 | 271 | | |
255 | 272 | | |
256 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
257 | 310 | | |
258 | 311 | | |
259 | 312 | | |
| |||
274 | 327 | | |
275 | 328 | | |
276 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
277 | 334 | | |
278 | 335 | | |
279 | 336 | | |
| |||
300 | 357 | | |
301 | 358 | | |
302 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
303 | 381 | | |
304 | 382 | | |
305 | 383 | | |
306 | 384 | | |
307 | | - | |
308 | | - | |
| 385 | + | |
| 386 | + | |
309 | 387 | | |
310 | 388 | | |
311 | | - | |
312 | | - | |
313 | | - | |
| 389 | + | |
| 390 | + | |
314 | 391 | | |
315 | 392 | | |
316 | 393 | | |
| |||
0 commit comments