OpenMetadata/openmetadata-service
Mohit Yadav 89fcac6316
feat: enhance relationshipCleanup with service hierarchy cleanup and Data Retention App (#21904)
* Extended relationshipCleanup command to clean up broken entities across all
  OpenMetadata service hierarchies (Database, Dashboard, API, Messaging, Pipeline,
  Storage, ML Model, and Search services), not just database services.

  Key changes:
  - Added performServiceHierarchyCleanup() method in OpenMetadataOperations
  - Added --skip-hierarchy-cleanup option for backward compatibility
  - Added getBrokenRelationFromParentToChild() and deleteBrokenRelationFromParentToChild() methods in CollectionDAO
  - Support for detecting and cleaning orphaned entities across any parent-child relationship
  - Maintains dry-run and actual cleanup modes with detailed reporting

  Usage: relationshipCleanup [--delete] [--skip-hierarchy-cleanup] [--batch-size N

* refactor: extract reusable cleanup utilities and eliminate code duplication

 Changes:
  - Add ServiceHierarchyCleanup.java for reusable hierarchy cleanup
  - Add ComprehensiveCleanupUtil.java for combined cleanup operations
  - Refactor OpenMetadataOperations to use reusable utilities
  - Refactor DataRetention to use reusable utilities
  - Single source of truth for all service hierarchy definitions

* - missing commit

* - Data Retention App test
2025-06-25 14:19:22 +05:30
..