Repository navigation
feat(events): add event schema versioning with compatibility rules (#1805) - #1830
Open
nissinanlung wants to merge 1 commit into
Open
nissinanlung wants to merge 1 commit into
nissinanlung wants to merge 1 commit into
Conversation
…martdevs17#1805) Add a versioned schema registry that classifies payload-shape changes as backward / forward / full / none compatible and migrates payloads across versions, preventing silent consumer breakage when event producers evolve. Changes: - Create backend/shared/events/schemaVersioning.ts: SchemaVersionRegistry with multi-version registration, diffSchemas (structured FieldChange diff + compatibility classification), validateAgainstVersion, registerMigrator and migrate (auto default-filling + explicit migrator chains) - Create backend/shared/events/__tests__/schemaVersioning.test.ts: 20+ test cases covering every compatibility rule, validation, and migration chains - Create docs/EVENT_SCHEMA_VERSIONING.md: compatibility levels, rules, usage examples, integration with the existing event catalog Acceptance criteria: - [x] Versioned — SchemaVersionRegistry stores arbitrary versions per event type with getVersion/getLatestVersion/getVersions - [x] Compatibility tested — 20+ tests classify every change rule and exercise migration chains - [x] Documented — docs/EVENT_SCHEMA_VERSIONING.md with rules and examples
|
@nissinanlung Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1805.
Event consumers break when producers change payload shapes. This adds a versioned schema registry that classifies every change as backward / forward / full / none compatible and migrates payloads across versions, making breakage an explicit, reviewable decision.
Changes
backend/shared/events/schemaVersioning.ts—SchemaVersionRegistry(multi-version registration),diffSchemas(structuredFieldChangediff + compatibility classification),validateAgainstVersion,registerMigrator+migrate(auto default-filling + explicit migrator chains).backend/shared/events/__tests__/schemaVersioning.test.ts— 20+ tests covering every compatibility rule, validation, and migration chains.docs/EVENT_SCHEMA_VERSIONING.md— compatibility levels, rules, usage examples, integration with the existing event catalog.Compatibility rules
Acceptance criteria
SchemaVersionRegistrystores arbitrary versions per event type (getVersion/getLatestVersion/getVersions).docs/EVENT_SCHEMA_VERSIONING.mdwith rules and examples.Quality Gates