Skip to content

fix: Resolve moved features and refactor evolution handling#1772

Merged
jcscottiii merged 4 commits intomainfrom
jcscottiii/render-evolution
Aug 30, 2025
Merged

fix: Resolve moved features and refactor evolution handling#1772
jcscottiii merged 4 commits intomainfrom
jcscottiii/render-evolution

Conversation

@jcscottiii
Copy link
Collaborator

@jcscottiii jcscottiii commented Aug 28, 2025

This PR refactors the handling of web feature evolution, fixing a key bug and improving test data for future scenarios.

The main change is a fix to ensure that moved or renamed features are resolved correctly by their human-readable feature key, not an internal database ID.

To streamline this work, the evolution object has been removed from the public API for now. The test data generation, however, has been significantly improved to populate the MovedWebFeatures and SplitWebFeatures tables with realistic data. E2E tests and snapshots have been updated to match.

The primary changes are:
- The `GetMovedWebFeatureDetailsByOriginalFeatureKey` function has been fixed. It was previously returning the internal database ID of the new feature; it now correctly returns the human-readable feature key, as intended.
- The main feature query has been updated to join against a new `SplitWebFeatures` table. The `GET /v1/features` and `GET /v1/features/{feature_id}` endpoints now include an `evolution` object in the response. This object contains `split_off_info` which lists any features that have been split off from the primary feature.

To support this, the following changes were also made:
- The `openapi.yaml` specification has been updated to include the new `evolution` fields in the `Feature` schema.
- The fake data generation process in `util/cmd/load_fake_data` has been significantly enhanced to create more realistic test data for feature evolution, including scenarios for moved, fully split, and partially split features.
- End-to-end tests and snapshots have been updated to reflect the new data structures and the changes in the underlying test data.start

There needs to be some frontend changes. But that will come in a future PR.
@jcscottiii jcscottiii marked this pull request as ready for review August 28, 2025 23:51
@jcscottiii jcscottiii requested a review from jrobbins August 28, 2025 23:52
@jcscottiii jcscottiii marked this pull request as draft August 29, 2025 15:26
@jcscottiii
Copy link
Collaborator Author

Given the comment in web-platform-dx/web-features#3000 (comment), we can actually simplify things. I'm going to make those changes.

The data model does not currently have the ability to show that feature has been partially split out. I will update this implementation.

Currently, v3 cannot let us know if a feature has been partially split out.
This commit removes the split out info from the Regular Feature model.

See comment: web-platform-dx/web-features#3000 (comment)

This allows us to simplify this. We can revisit in v4.
@jcscottiii jcscottiii changed the title fix: Return correct feature evolution data for moved and split features fix: Resolve moved features and refactor evolution handling Aug 29, 2025
@jcscottiii jcscottiii marked this pull request as ready for review August 29, 2025 17:42
@jcscottiii
Copy link
Collaborator Author

I just fixed everything now.

Given the comment in web-platform-dx/web-features#3000 (comment), we can actually simplify things. I'm going to make those changes.

The data model does not currently have the ability to show that feature has been partially split out. I will update this implementation.

@jcscottiii jcscottiii added this pull request to the merge queue Aug 30, 2025
Merged via the queue into main with commit 3f004ad Aug 30, 2025
7 checks passed
@jcscottiii jcscottiii deleted the jcscottiii/render-evolution branch August 30, 2025 01:26
@jrobbins jrobbins mentioned this pull request Sep 3, 2025
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.

2 participants