Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: schemas should be created with lineage_id == id #5147

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

zacharyhamm
Copy link
Contributor

@zacharyhamm zacharyhamm commented Dec 17, 2024

On demand asset installation can produce identical Schema nodes by id, but they will have different lineage ids. Since the lineage ids are different, we will treat them as new nodes on the graph. The idempotency of our updates usually means this is fine. But the interaction with the code to ensure there is only one default edge caused an issue.

This fixes both, by ensuring new schemas are always created with the lineage id equal to the schema id. This will ensure we compare the nodes instead of treating the schema node as a new node.

It also ensures that if a new edge update comes in that sets a schema variant to the default, but that variant is already default, we preserve that default.

@github-actions github-actions bot added the A-dal label Dec 17, 2024
On demand asset installation can produce identical Schema nodes by id,
but they will have different lineage ids. Since the lineage ids are
different, we will treat them as new nodes on the graph. The idempotency
of our updates usually means this is fine. But the interaction with the
code to ensure there is only one default edge caused an issue.

This fixes both, by ensuring new schemas are always created with the
a lineage id equal to the schema id. This will ensure we compare the
nodes instead of treating the schema node as a new node.

It also ensures that if a new edge update comes in that sets a schema
variant to the default, but that variant is already default, we preserve
that default.
@zacharyhamm zacharyhamm force-pushed the zack/ensure-default-is-not-erased branch from 4f947d3 to 233c126 Compare December 17, 2024 21:36
@zacharyhamm zacharyhamm changed the title fix: ensure default edge is not removed ix: schemas should be created with lineage_id == id Dec 17, 2024
@zacharyhamm zacharyhamm changed the title ix: schemas should be created with lineage_id == id fix: schemas should be created with lineage_id == id Dec 17, 2024
@zacharyhamm
Copy link
Contributor Author

To test this:

Add a new kind of component to a change set (one that has never been installed).
Create a new change set, and repeat with the exact same schema variant kind.

Apply one of the two change sets.
Then apply the second one (it should have two of those components on it).

HEAD should be in a working state.

@zacharyhamm zacharyhamm added this pull request to the merge queue Dec 17, 2024
Merged via the queue into main with commit 7d3be6e Dec 17, 2024
8 checks passed
@zacharyhamm zacharyhamm deleted the zack/ensure-default-is-not-erased branch December 17, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants