Commit 0e04217
authored
refactor: Remove platform_ref inheritance from saga definitions (#2141)
* refactor: Remove platform_ref inheritance from saga definitions
Delete the platform_ref inheritance system including override API,
platform sync, similarity matching, version pinning, and fallback
resolution. Simplify Definition struct by removing PlatformRef,
OverrideReason, PlatformVersionAtOverride, ResolvedScript, and
UsedPlatformFallback fields. Script is now required directly on
all saga definitions.
- Delete 12 files (override_api, similarity, migrate_platform_ref,
fallback_resolution, platform_sync, version_pinning + tests)
- Remove platform_ref columns from SQL queries and scan functions
- Simplify CreateDraft INSERT and activation validation
- Move ComputeScriptHash to registry.go, humanizeName/regex to seeder.go
- Update orchestrators to use Script instead of ResolvedScript
- Remove PlatformSagaVersionID from shared SagaInstance model
- Add migration to drop platform_ref columns and set script NOT NULL
- Update test DDL to match simplified schema
* fix: Address CodeRabbit review feedback
- Add NULL script backfill guard before SET NOT NULL in migration
- Add empty script guard in ValidateSagaDraft handler
- Add comment explaining why remove_platform_ref migration is excluded
from setupPlatformTestDB (targets tenant tables, not public schema)
* fix: Reject empty-script updates and include migration in test setup
- Add handler-level guard rejecting explicit empty-script updates in
UpdateSagaDefinition (InvalidArgument if script is set to "")
- Create saga_definition with old schema in setupPlatformTestDB so the
remove_platform_ref migration exercises the full migration chain
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent b3b0bd5 commit 0e04217
31 files changed
Lines changed: 250 additions & 4593 deletions
File tree
- services
- current-account/service
- reference-data
- migrations
- saga
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2026 | 2026 | | |
2027 | 2027 | | |
2028 | 2028 | | |
2029 | | - | |
2030 | | - | |
| 2029 | + | |
| 2030 | + | |
2031 | 2031 | | |
2032 | 2032 | | |
2033 | | - | |
2034 | | - | |
| 2033 | + | |
| 2034 | + | |
2035 | 2035 | | |
2036 | 2036 | | |
2037 | 2037 | | |
| |||
2061 | 2061 | | |
2062 | 2062 | | |
2063 | 2063 | | |
2064 | | - | |
| 2064 | + | |
2065 | 2065 | | |
2066 | 2066 | | |
2067 | | - | |
2068 | | - | |
| 2067 | + | |
| 2068 | + | |
2069 | 2069 | | |
2070 | 2070 | | |
2071 | 2071 | | |
| |||
2095 | 2095 | | |
2096 | 2096 | | |
2097 | 2097 | | |
2098 | | - | |
| 2098 | + | |
2099 | 2099 | | |
2100 | 2100 | | |
2101 | | - | |
2102 | | - | |
| 2101 | + | |
| 2102 | + | |
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
| |||
2128 | 2128 | | |
2129 | 2129 | | |
2130 | 2130 | | |
2131 | | - | |
| 2131 | + | |
2132 | 2132 | | |
2133 | 2133 | | |
2134 | | - | |
2135 | | - | |
| 2134 | + | |
| 2135 | + | |
2136 | 2136 | | |
2137 | 2137 | | |
2138 | 2138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
| 346 | + | |
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
354 | | - | |
| 353 | + | |
| 354 | + | |
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
327 | | - | |
| 326 | + | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
| 337 | + | |
338 | 338 | | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
0 commit comments