Fix #3402: Inconsistency in activity feed for services activities (#3478)

This commit is contained in:
Vivek Ratnavel Subramanian 2022-03-18 13:42:03 -07:00 committed by GitHub
parent 4ad0d9f76c
commit a1941301af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 64 deletions

View File

@ -107,7 +107,19 @@ public final class Entity {
//
// List of entities whose changes should not be published to the Activity Feed
//
public static final List<String> ACTIVITY_FEED_EXCLUDED_ENTITIES = List.of(USER, TEAM, ROLE, POLICY, BOTS);
public static final List<String> ACTIVITY_FEED_EXCLUDED_ENTITIES =
List.of(
USER,
TEAM,
ROLE,
POLICY,
BOTS,
AIRFLOW_PIPELINE,
DATABASE_SERVICE,
PIPELINE_SERVICE,
DASHBOARD_SERVICE,
STORAGE_SERVICE,
MESSAGING_SERVICE);
private Entity() {}

View File

@ -257,15 +257,5 @@ public class AirflowPipelineRepository extends EntityRepository<AirflowPipeline>
public AirflowPipelineUpdater(AirflowPipeline original, AirflowPipeline updated, Operation operation) {
super(original, updated, operation);
}
@Override
public void entitySpecificUpdate() throws IOException {
AirflowPipeline origIngestion = original.getEntity();
AirflowPipeline updatedIngestion = updated.getEntity();
recordChange("scheduleInterval", origIngestion.getScheduleInterval(), updatedIngestion.getScheduleInterval());
recordChange("pipelineConfig", origIngestion.getPipelineConfig(), updatedIngestion.getPipelineConfig());
recordChange("startDate", origIngestion.getStartDate(), updatedIngestion.getStartDate());
recordChange("endDate", origIngestion.getEndDate(), updatedIngestion.getEndDate());
}
}
}

View File

@ -15,7 +15,6 @@ package org.openmetadata.catalog.jdbi3;
import static org.openmetadata.catalog.Entity.FIELD_OWNER;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import java.net.URI;
import java.text.ParseException;
@ -25,7 +24,6 @@ import org.openmetadata.catalog.entity.services.DashboardService;
import org.openmetadata.catalog.resources.services.dashboard.DashboardServiceResource;
import org.openmetadata.catalog.type.ChangeDescription;
import org.openmetadata.catalog.type.EntityReference;
import org.openmetadata.catalog.type.Schedule;
import org.openmetadata.catalog.util.EntityInterface;
import org.openmetadata.catalog.util.EntityUtil;
import org.openmetadata.catalog.util.EntityUtil.Fields;
@ -224,24 +222,5 @@ public class DashboardServiceRepository extends EntityRepository<DashboardServic
public DashboardServiceUpdater(DashboardService original, DashboardService updated, Operation operation) {
super(original, updated, operation);
}
@Override
public void entitySpecificUpdate() throws IOException {
updateDashboardUrl();
updateIngestionSchedule();
recordChange("userName", original.getEntity().getUsername(), updated.getEntity().getUsername());
// TODO change recorded for password
// recordChange("password", original.getEntity().getPassword(), updated.getEntity().getPassword());
}
private void updateDashboardUrl() throws JsonProcessingException {
recordChange("dashboardUrl", original.getEntity().getDashboardUrl(), updated.getEntity().getDashboardUrl());
}
private void updateIngestionSchedule() throws JsonProcessingException {
Schedule origSchedule = original.getEntity().getIngestionSchedule();
Schedule updatedSchedule = updated.getEntity().getIngestionSchedule();
recordChange("ingestionSchedule", origSchedule, updatedSchedule, true);
}
}
}

View File

@ -15,12 +15,9 @@ package org.openmetadata.catalog.jdbi3;
import static org.openmetadata.catalog.Entity.FIELD_OWNER;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import java.net.URI;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.openmetadata.catalog.Entity;
import org.openmetadata.catalog.entity.services.MessagingService;
@ -225,24 +222,5 @@ public class MessagingServiceRepository extends EntityRepository<MessagingServic
public MessagingServiceUpdater(MessagingService original, MessagingService updated, Operation operation) {
super(original, updated, operation);
}
@Override
public void entitySpecificUpdate() throws IOException {
MessagingService origService = original.getEntity();
MessagingService updatedService = updated.getEntity();
recordChange("schemaRegistry", origService.getSchemaRegistry(), updatedService.getSchemaRegistry());
recordChange(
"ingestionSchedule", origService.getIngestionSchedule(), updatedService.getIngestionSchedule(), true);
updateBrokers();
}
private void updateBrokers() throws JsonProcessingException {
List<String> origBrokers = original.getEntity().getBrokers();
List<String> updatedBrokers = updated.getEntity().getBrokers();
List<String> addedBrokers = new ArrayList<>();
List<String> deletedBrokers = new ArrayList<>();
recordListChange("brokers", origBrokers, updatedBrokers, addedBrokers, deletedBrokers, EntityUtil.stringMatch);
}
}
}

View File

@ -222,15 +222,5 @@ public class PipelineServiceRepository extends EntityRepository<PipelineService>
public PipelineServiceUpdater(PipelineService original, PipelineService updated, Operation operation) {
super(original, updated, operation);
}
@Override
public void entitySpecificUpdate() throws IOException {
recordChange("pipelineUrl", original.getEntity().getPipelineUrl(), updated.getEntity().getPipelineUrl());
recordChange(
"ingestionSchedule",
original.getEntity().getIngestionSchedule(),
updated.getEntity().getIngestionSchedule(),
true);
}
}
}