datahub icon indicating copy to clipboard operation
datahub copied to clipboard

feat(structured-properties): soft delete

Open david-leifker opened this issue 1 year ago • 0 comments

At a high level this PR introduces soft delete for structured properties. Soft delete for structured properties involves soft deleting a structured property's entity while preserving all aspects on the structured property entity as well as all values of this structured property applied/attached to other entities (i.e. datasets). A soft delete of a structured property can be reversed and all written values will be restored.

Structured Property Soft Delete Effects:

  • Updates to a soft deleted structured property's definition are denied
  • Adding a soft deleted structured property's value to an entity is denied
  • Entities with a soft deleted structured property will not return the soft deleted properties
  • Search filters using a soft deleted structured property will be denied

Implementation Features:

Read mutation: The original concept of a write mutation has been extended to read mutations as well. This feature is used to remove soft deleted structured property values from entities at read time to allow preserving the values if the soft delete is reverted.

Mutation Hooks, Validators, Side-Effects: Converted to a batched interface for better efficiency.

Validators: Validators can now return multiple validation exceptions for multiple items in the batch.

Refactors: Interfaces around Mutation Hooks, Validators, and Side-Effects have been renamed to be more generic concepts. Introduced a ReadItem interface for read mutation.

Resolved Issues: One of the key issues resolved here is a circular dependency when using the Aspect Retriever. The resolution involves using a postConstruct() method to set the Aspect Retriever after initial construction by Spring.

Checklist

  • [ ] The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • [ ] Links to related issues (if applicable)
  • [ ] Tests for the changes have been added/updated (if applicable)
  • [ ] Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • [ ] For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

david-leifker avatar Feb 12 '24 16:02 david-leifker