mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-25 17:04:54 +00:00
[Fix] Add Regex for Entity FQn matches (#14946)
* Add Regex for Entity FQn matches * Removing Reports app to be installed by default
This commit is contained in:
parent
78c33317b2
commit
5940d7219a
@ -190,9 +190,9 @@ public final class AlertUtil {
|
||||
List<String> resource,
|
||||
CreateEventSubscription.AlertType alertType,
|
||||
AlertFilteringInput input) {
|
||||
if (resource.size() > 1) {
|
||||
if (resource.size() != 1) {
|
||||
throw new BadRequestException(
|
||||
"Only one resource can be specified. Multiple resources are not supported.");
|
||||
"One resource can be specified. Zero or Multiple resources are not supported.");
|
||||
}
|
||||
|
||||
if (alertType.equals(CreateEventSubscription.AlertType.NOTIFICATION)) {
|
||||
|
@ -15,6 +15,8 @@ import static org.openmetadata.service.Entity.USER;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.openmetadata.schema.EntityInterface;
|
||||
import org.openmetadata.schema.Function;
|
||||
@ -134,7 +136,9 @@ public class AlertsRuleEvaluator {
|
||||
|
||||
EntityInterface entity = getEntity(changeEvent);
|
||||
for (String name : entityNames) {
|
||||
if (entity.getFullyQualifiedName().equals(name)) {
|
||||
Pattern pattern = Pattern.compile(name);
|
||||
Matcher matcher = pattern.matcher(entity.getFullyQualifiedName());
|
||||
if (matcher.find()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -249,7 +253,9 @@ public class AlertsRuleEvaluator {
|
||||
|
||||
EntityInterface entity = getEntity(changeEvent);
|
||||
for (String name : tableNameList) {
|
||||
if (entity.getFullyQualifiedName().contains(name)) {
|
||||
Pattern pattern = Pattern.compile(name);
|
||||
Matcher matcher = pattern.matcher(entity.getFullyQualifiedName());
|
||||
if (matcher.find()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "DataInsightsReportApplication",
|
||||
"displayName": "Data Insights Report",
|
||||
"appConfiguration": {
|
||||
"sendToAdmins": true,
|
||||
"sendToTeams": true
|
||||
},
|
||||
"appSchedule": {
|
||||
"scheduleType": "Weekly"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user