feat(rel2.0): default removal option to REMOVE_ALL_EDGES_FROM_SOURCE #478
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
Big PR with several major changes to relationship ingestion.
Major
Default relationship removal options to REMOVE_ALL_EDGES_FROM_SOURCE during ingestion.
One caveat is the case where relationships are removed when an aspect is soft-deleted. For now, we will only allow soft-deleting an aspect which has relationships when the DAO is in RelationshipSource.ASPECT_METADATA mode. By default, the DAO is in RelationshipSource.RELATIONSHIP_BUILDERS mode which does NOT allow soft deleting aspects that have relationships.
RelationshipV2 can be built and ingested using relationship builders. This is to bridge the gap for existing aspects with data currently ingested into the metadata graph but do not yet have any relationships. Since new relationship models can only be defined following the Relationship 2.0 spec, we need a way to support building relationshipV2s with relationship builders.
Removed the neo4j module since no one is using that anymore.
Minor
Remove destination field parameter from
checkSameUrn
. Now throws an exception if the removal option is not REMOVE_ALL_EDGES_FROM_SOURCE.Removed validateRelationshipSchema methods which don't specify v1 or v2. Now, relationship schema validation must include a boolean parameter indicating that the relationship is v1 or v2.
Testing Done
Added several unit tests covering multiple ingestion cases.
Update several other unit tests to expect IllegalArgumentExceptions when passing in removal options that are not REMOVE_ALL_EDGES_FROM_SOURCE.
Updated several unit tests with new checkSameUrn and validateRelationshipSchema method signatures.
Added a new aspect for testing (AspectFooBaz) so updated a few resource class unit tests.
Checklist