Fix Inherited Owner Not Updating in Data Product List After Removal from Domain in search (#20058)

This commit is contained in:
sonika-shah 2025-03-10 22:56:50 +05:30 committed by GitHub
parent d5e20efb8d
commit 7e92a459b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -106,9 +106,9 @@ public interface SearchClient {
String PROPAGATE_TEST_SUITES_SCRIPT = "ctx._source.testSuites = params.testSuites";
String REMOVE_OWNERS_SCRIPT =
"if (ctx._source.owners != null && !ctx._source.owners.isEmpty()) { "
+ "ctx._source.owners.removeIf(owner -> "
+ "params.deletedOwners.stream().anyMatch(deletedOwner -> deletedOwner.id == owner.id) && owner.inherited == true); "
"if (ctx._source.owners != null) { "
+ "ctx._source.owners.removeIf(owner -> owner.inherited == true); "
+ "ctx._source.owners.addAll(params.deletedOwners); "
+ "}";
String UPDATE_TAGS_FIELD_SCRIPT =