Commit 96aeaaf
authored
feat: add lifecycle states for config-only resources (#2081)
* feat: add lifecycle status enums and deprecation RPCs to proto definitions
Add DataSourceStatus, ConnectionStatus, and RouteStatus enums with
ACTIVE/DEPRECATED states. Add DeprecateDataSource, DeprecateConnection,
and DeprecateRoute RPCs for config-only resource lifecycle management.
* feat: add database migrations for lifecycle status columns
Add status (VARCHAR DEFAULT 'ACTIVE') and deprecated_at columns to
data_source, provider_connections, and instruction_routes tables with
CHECK constraints and tenant-scoped indexes.
* feat: implement lifecycle states for market-information DataSource
Add ACTIVE/DEPRECATED status to DataSource domain model with Deprecate()
method, update persistence layer for status column, and add
DeprecateDataSource gRPC handler with idempotent deprecation semantics.
* feat: implement lifecycle states for operational-gateway resources
Add ACTIVE/DEPRECATED status to ProviderConnection and InstructionRoute
domain models with Deprecate() methods. Update persistence entities,
repositories, and gRPC handlers with DeprecateConnection and
DeprecateRoute endpoints. Update test DDL for new columns.
* chore: regenerate frontend TypeScript proto files
Update generated TypeScript protobuf files for new lifecycle status
enums and deprecation RPCs added to market-information and
operational-gateway protos.
* fix: add Deprecate method to mock SourceRepository in tests
The mock did not implement the new Deprecate interface method, causing
golangci-lint typecheck failures.
* fix: add DeprecateDataSource to event-router mock MDS client
The generated MarketInformationServiceClient interface gained the new
DeprecateDataSource RPC method, requiring mock implementations to match.
* fix: use domain constants in status parsers to satisfy goconst lint
Replace string literals with domain type constants in parseDataSetStatus
and parseDataSourceStatus to avoid repeated string occurrences.
* fix: add Deprecate to allowed repository method verbs
Lifecycle deprecation is a standard operation for config-only resources,
alongside Create/Find/Update/Delete.
* fix: add status and deprecated_at columns to test schema DDL
The market-information test helper schema.sql was missing the new
lifecycle columns, causing integration test failures.
* fix: add status columns to tenant-specific test schema DDL
The createSchemaDataSourceTable function for multi-tenant test schemas
was missing the new columns, causing column mismatch when copying data
sources from the public schema via SELECT *.
* fix: address review feedback - preserve lifecycle fields in builders
Critical fixes:
- Add deprecated_at to INSERT column list in Save (was missing, causing
EXCLUDED.deprecated_at to always be NULL)
- Preserve status and deprecated_at in UpdateDataSource and
DeactivateDataSource builders (zero-value status violated CHECK constraint)
- Add CHECK constraints to operational-gateway test DDL for parity
- Add idx_data_source_status to test schema to match production
- Update proto comment to document idempotent deprecation behavior
* fix: consolidate lifecycle field preservation in UpdateDataSource
Use WithDeprecatedAt directly in builder chain instead of conditional
block, reducing function size below 60-line threshold.
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent 5be73ec commit 96aeaaf
34 files changed
Lines changed: 3334 additions & 1628 deletions
File tree
- api/proto/meridian
- market_information/v1
- operational_gateway/v1
- frontend/src/api/gen/meridian
- market_information/v1
- operational_gateway/v1
- services
- event-router/adapters/mds
- market-information
- adapters/persistence
- testhelpers
- domain
- migrations
- service
- operational-gateway
- adapters/persistence
- domain
- migrations
- service
- tests/architecture
Lines changed: 1096 additions & 883 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
244 | 254 | | |
245 | 255 | | |
246 | 256 | | |
| |||
270 | 280 | | |
271 | 281 | | |
272 | 282 | | |
| 283 | + | |
| 284 | + | |
273 | 285 | | |
274 | 286 | | |
275 | 287 | | |
276 | 288 | | |
277 | 289 | | |
278 | 290 | | |
279 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
280 | 298 | | |
281 | 299 | | |
282 | 300 | | |
| |||
436 | 454 | | |
437 | 455 | | |
438 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
439 | 469 | | |
440 | 470 | | |
441 | 471 | | |
| |||
779 | 809 | | |
780 | 810 | | |
781 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
782 | 828 | | |
783 | 829 | | |
784 | 830 | | |
| |||
Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments