Skip to content

Conversation

@jcscottiii
Copy link
Collaborator

@jcscottiii jcscottiii commented Dec 22, 2025

Moves the reconciliation logic from the old event_producer into the new lib/blobtypes/featurelistdiff/v1 package.

The ReconcileHistory function enriches a simple diff by detecting when a "removed" feature was actually moved or split into other features. It does this by querying the database for the history of the removed feature ID. This makes the final diff notifications much more semantic and user-friendly.

This logic already exists in https://github.com/GoogleChrome/webstatus.dev/blob/29de49913acfeefef7ce28ae95d3801ccb605253/workers/event_producer/pkg/differ/reconciler.go. But to prevent too many changes at once, it will be removed in the future. (And if we do a simple move, things would not compile)

Part of #2107

Split up of #2106

jcscottiii added a commit that referenced this pull request Dec 22, 2025
Architecturally refactors the event producer's diffing component.
The new `FeatureDiffer` is now a generic orchestrator that is decoupled
from any specific diff version via a set of interfaces:

- `StateCompareWorkflow`: Encapsulates the business logic of diffing.
- `StateAdapter`: Handles loading/saving versioned state snapshots.
- `DiffSerializer`: Handles serializing the final diff result.

This new design is more testable, maintainable, and makes it much
easier to introduce new diff versions in the future. It also includes
updates to the worker types to support the new event summary generation.

Also deletes the old, now-redundant comparator and reconciler logic. (will now use the updated versions in #2111 and #2112)
@jcscottiii jcscottiii requested a review from jrobbins December 22, 2025 22:06
jcscottiii added a commit that referenced this pull request Dec 23, 2025
Architecturally refactors the event producer's diffing component.
The new `FeatureDiffer` is now a generic orchestrator that is decoupled
from any specific diff version via a set of interfaces:

- `StateCompareWorkflow`: Encapsulates the business logic of diffing.
- `StateAdapter`: Handles loading/saving versioned state snapshots.
- `DiffSerializer`: Handles serializing the final diff result.

This new design is more testable, maintainable, and makes it much
easier to introduce new diff versions in the future. It also includes
updates to the worker types to support the new event summary generation.

Also deletes the old, now-redundant comparator and reconciler logic. (will now use the updated versions in #2111 and #2112)
@jcscottiii jcscottiii force-pushed the jcscottiii/v1-types-comparator branch from 98479b0 to 37f68dc Compare December 28, 2025 16:15
Base automatically changed from jcscottiii/v1-types-comparator to main December 28, 2025 17:10
Moves the reconciliation logic from the old `event_producer` into the
new `lib/blobtypes/featurelistdiff/v1` package.

The `ReconcileHistory` function enriches a simple diff by detecting when
a "removed" feature was actually moved or split into other features. It
does this by querying the database for the history of the removed
feature ID. This makes the final diff notifications much more semantic
and user-friendly.

This logic already exists in https://github.com/GoogleChrome/webstatus.dev/blob/29de49913acfeefef7ce28ae95d3801ccb605253/workers/event_producer/pkg/differ/reconciler.go. But to prevent too many changes at once, it will be removed in the future.

Part of #2107

Split up of #2106
@jcscottiii jcscottiii force-pushed the jcscottiii/v1-types-reconciler branch from 5a4fe62 to 4e635e3 Compare December 28, 2025 17:11
@jcscottiii jcscottiii enabled auto-merge December 28, 2025 17:11
@jcscottiii jcscottiii added this pull request to the merge queue Dec 28, 2025
Merged via the queue into main with commit 348781b Dec 28, 2025
7 checks passed
@jcscottiii jcscottiii deleted the jcscottiii/v1-types-reconciler branch December 28, 2025 18:02
jcscottiii added a commit that referenced this pull request Dec 28, 2025
Architecturally refactors the event producer's diffing component.
The new `FeatureDiffer` is now a generic orchestrator that is decoupled
from any specific diff version via a set of interfaces:

- `StateCompareWorkflow`: Encapsulates the business logic of diffing.
- `StateAdapter`: Handles loading/saving versioned state snapshots.
- `DiffSerializer`: Handles serializing the final diff result.

This new design is more testable, maintainable, and makes it much
easier to introduce new diff versions in the future. It also includes
updates to the worker types to support the new event summary generation.

Also deletes the old, now-redundant comparator and reconciler logic. (will now use the updated versions in #2111 and #2112)
github-merge-queue bot pushed a commit that referenced this pull request Dec 28, 2025
)

Architecturally refactors the event producer's diffing component.
The new `FeatureDiffer` is now a generic orchestrator that is decoupled
from any specific diff version via a set of interfaces:

- `StateCompareWorkflow`: Encapsulates the business logic of diffing.
- `StateAdapter`: Handles loading/saving versioned state snapshots.
- `DiffSerializer`: Handles serializing the final diff result.

This new design is more testable, maintainable, and makes it much
easier to introduce new diff versions in the future. It also includes
updates to the worker types to support the new event summary generation.

Also deletes the old, now-redundant comparator and reconciler logic. (will now use the updated versions in #2111 and #2112)
@jcscottiii jcscottiii linked an issue Jan 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Decouple storage types from generated backend enums

2 participants