Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic: Day 1 service #19914

Merged
merged 64 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d8fbdff
Add the Platform Insights for the service details page
aniketkatkar97 Feb 21, 2025
3561edd
Add new localization translations
aniketkatkar97 Feb 21, 2025
f8bbf51
Merge branch 'main' into day-1-services
aniketkatkar97 Feb 22, 2025
e1594c4
Merge branch 'main' into day-1-services
aniketkatkar97 Feb 24, 2025
dd739db
Merge branch 'main' into day-1-services
aniketkatkar97 Feb 24, 2025
5c8bec1
Fix the styling
aniketkatkar97 Feb 24, 2025
1230f69
Add Data Quality widget in the service details page insights tab
aniketkatkar97 Feb 24, 2025
715cdc5
Remove the unused localization keys
aniketkatkar97 Feb 24, 2025
30e41a0
Merge remote-tracking branch 'origin/main' into day-1-services
aniketkatkar97 Feb 25, 2025
96bf11e
Fix the border radius
aniketkatkar97 Feb 25, 2025
e396a82
Update the border color
aniketkatkar97 Feb 25, 2025
76d3877
Merge branch 'main' into day-1-services
aniketkatkar97 Feb 25, 2025
bdbacc2
Merge branch 'main' into day-1-services
aniketkatkar97 Feb 26, 2025
563d249
Merge branch 'main' into day-1-services
aniketkatkar97 Feb 26, 2025
2cbcea5
Add Total Data Assets widget
aniketkatkar97 Feb 26, 2025
1657c03
localization changes
aniketkatkar97 Feb 26, 2025
2b2c5da
Fix the Tier insights chart
aniketkatkar97 Feb 27, 2025
34e6991
Add Tier and PII Distribution charts
aniketkatkar97 Feb 27, 2025
cf8d541
Localization changes
aniketkatkar97 Feb 27, 2025
d82b9da
Fix the calls for special fqn
aniketkatkar97 Feb 27, 2025
d242da5
Merge remote-tracking branch 'origin/main' into day-1-services
aniketkatkar97 Feb 27, 2025
a09702c
Merge branch 'main' into day-1-services
aniketkatkar97 Feb 28, 2025
6f7c886
Limit the DataQualityWidget only to the DB services
aniketkatkar97 Feb 28, 2025
224cf3d
Add the MostUsedAssetsWidget
aniketkatkar97 Feb 28, 2025
4479b37
Add missing loaders to the widgets
aniketkatkar97 Feb 28, 2025
efbc344
Localization changes
aniketkatkar97 Feb 28, 2025
cfcd2da
Merge remote-tracking branch 'origin/main' into day-1-services
aniketkatkar97 Feb 28, 2025
e7e5c12
Update the API call for most used assets
aniketkatkar97 Feb 28, 2025
6a416b0
Add most expensive queries widget
aniketkatkar97 Mar 1, 2025
5a92420
Localization changes
aniketkatkar97 Mar 1, 2025
88a0b20
Merge branch 'main' into day-1-services
aniketkatkar97 Mar 1, 2025
993d929
Move the widgets logic to classBase for better customization
aniketkatkar97 Mar 2, 2025
a385c45
Fix the font size
aniketkatkar97 Mar 2, 2025
d246ae7
add charts backend
ulixius9 Mar 3, 2025
5db1193
fix initialisation
ulixius9 Mar 3, 2025
1c81ab0
fix migration
ulixius9 Mar 3, 2025
15c5343
pii chart
ulixius9 Mar 4, 2025
692a582
Merge remote-tracking branch 'origin/main' into day-1-services
aniketkatkar97 Mar 4, 2025
c4828e1
Add assets_with_tier DI system chart
aniketkatkar97 Mar 4, 2025
151bf42
Fix the service insights charts
aniketkatkar97 Mar 4, 2025
5b09a9c
localization changes
aniketkatkar97 Mar 4, 2025
7356c91
Merge branch 'main' into day-1-services
aniketkatkar97 Mar 4, 2025
41cc6b9
spotless
aniketkatkar97 Mar 4, 2025
fce9d42
filter to be regex instead of literal compare
ulixius9 Mar 4, 2025
5727d58
Fix stylings for Most Used Assets widget
aniketkatkar97 Mar 4, 2025
2ef274c
Fix Unit tests
aniketkatkar97 Mar 5, 2025
9bb2445
Remove the New widgets
aniketkatkar97 Mar 5, 2025
d2e5f3d
Merge branch 'main' into day-1-services
aniketkatkar97 Mar 5, 2025
794e803
Delete unused utils
aniketkatkar97 Mar 5, 2025
aba7d85
Fix the ServiceEntity tests
aniketkatkar97 Mar 5, 2025
b27f800
Move SystemChartType to enum file
aniketkatkar97 Mar 5, 2025
35ce846
Merge branch 'main' into day-1-services
aniketkatkar97 Mar 5, 2025
b0eea6b
Worked on comments
aniketkatkar97 Mar 6, 2025
cc475db
Refactor ServiceInsightsTab and TotalDataAssetsWidget for improved co…
aniketkatkar97 Mar 6, 2025
1ec605a
Refactor PlatformInsightsWidget and improve type safety
aniketkatkar97 Mar 6, 2025
6f8e711
Merge branch 'main' into day-1-services
aniketkatkar97 Mar 6, 2025
8556ad8
Refactor ServiceInsightsTab to use serviceDetails prop and remove Fqn…
aniketkatkar97 Mar 6, 2025
66eb5e7
Refactor ServiceInsightsTabUtils to use local i18n import
aniketkatkar97 Mar 6, 2025
bfa6b9a
Improve type safety in TotalDataAssetsWidget component
aniketkatkar97 Mar 6, 2025
e513861
Merge branch 'main' into day-1-services
aniketkatkar97 Mar 6, 2025
979aff7
add postgres migrations
ulixius9 Mar 6, 2025
fc04871
Merge branch 'main' into day-1-services
aniketkatkar97 Mar 6, 2025
8b53bf8
Merge remote-tracking branch 'origin/main' into day-1-services
aniketkatkar97 Mar 7, 2025
cd66ca9
Merge branch 'main' into day-1-services
aniketkatkar97 Mar 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, missed that

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.openmetadata.service.migration.mysql.v170;

import static org.openmetadata.service.migration.utils.v170.MigrationUtil.createServiceCharts;
import static org.openmetadata.service.migration.utils.v170.MigrationUtil.updateDataInsightsApplication;
import static org.openmetadata.service.migration.utils.v170.MigrationUtil.updateGovernanceWorkflowDefinitions;

Expand All @@ -19,5 +20,6 @@ public void runDataMigration() {
initializeWorkflowHandler();
updateGovernanceWorkflowDefinitions();
updateDataInsightsApplication();
createServiceCharts();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.jdbi.v3.core.statement.UnableToExecuteStatementException;
import org.openmetadata.schema.dataInsight.custom.DataInsightCustomChart;
import org.openmetadata.schema.dataInsight.custom.LineChart;
import org.openmetadata.schema.dataInsight.custom.LineChartMetric;
import org.openmetadata.schema.governance.workflows.WorkflowDefinition;
import org.openmetadata.schema.governance.workflows.elements.WorkflowNodeDefinitionInterface;
import org.openmetadata.service.Entity;
import org.openmetadata.service.exception.EntityNotFoundException;
import org.openmetadata.service.governance.workflows.flowable.MainWorkflow;
import org.openmetadata.service.jdbi3.AppMarketPlaceRepository;
import org.openmetadata.service.jdbi3.AppRepository;
import org.openmetadata.service.jdbi3.DataInsightSystemChartRepository;
import org.openmetadata.service.jdbi3.ListFilter;
import org.openmetadata.service.jdbi3.WorkflowDefinitionRepository;
import org.openmetadata.service.util.EntityUtil;
Expand Down Expand Up @@ -137,4 +142,82 @@ public static void updateGovernanceWorkflowDefinitions() {
repository.createOrUpdate(null, workflowDefinition);
}
}

static DataInsightSystemChartRepository dataInsightSystemChartRepository;

public static void createChart(String chartName, Object chartObject) {
createChart(chartName, chartObject, DataInsightCustomChart.ChartType.LINE_CHART);
}

public static void createChart(
String chartName, Object chartObject, DataInsightCustomChart.ChartType chartType) {
DataInsightCustomChart chart =
new DataInsightCustomChart()
.withId(UUID.randomUUID())
.withName(chartName)
.withChartDetails(chartObject)
.withUpdatedAt(System.currentTimeMillis())
.withUpdatedBy("ingestion-bot")
.withDeleted(false)
.withChartType(chartType)
.withIsSystemChart(true);
dataInsightSystemChartRepository.prepareInternal(chart, false);
try {
dataInsightSystemChartRepository
.getDao()
.insert("fqnHash", chart, chart.getFullyQualifiedName());
} catch (Exception ex) {
LOG.warn(ex.toString());
LOG.warn(String.format("Chart %s exists", chart));
}
}

public static void createServiceCharts() {
dataInsightSystemChartRepository = new DataInsightSystemChartRepository();
createChart(
"assets_with_pii_bar",
new LineChart()
.withMetrics(List.of(new LineChartMetric().withFormula("count(k='id.keyword')")))
.withxAxisField("tags.tagFQN")
.withIncludeXAxisFiled("pii.*"),
DataInsightCustomChart.ChartType.BAR_CHART);

createChart(
"assets_with_tier_bar",
new LineChart()
.withMetrics(List.of(new LineChartMetric().withFormula("count(k='id.keyword')")))
.withxAxisField("tags.tagFQN")
.withIncludeXAxisFiled("tier.*"),
DataInsightCustomChart.ChartType.BAR_CHART);

createChart(
"assets_with_description",
new LineChart()
.withMetrics(
List.of(
new LineChartMetric()
.withFormula("count(k='id.keyword',q='hasDescription: 1')"))));

createChart(
"assets_with_owners",
new LineChart()
.withMetrics(
List.of(new LineChartMetric().withFormula("count(k='id.keyword',q='owners: *')"))));

createChart(
"assets_with_pii",
new LineChart()
.withMetrics(
List.of(
new LineChartMetric()
.withFormula(
"count(q='tags.tagFQN: pii.sensitive OR tags.tagFQN:"
+ " pii.nonsensitive OR tags.tagFQN: pii.none')"))));

createChart(
"assets_with_tier",
new LineChart()
.withMetrics(
List.of(new LineChartMetric().withFormula("count(q='tags.tagFQN: tier.*')"))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,18 @@ public SearchRequest prepareSearchRequest(
String metricName = metric.getName() == null ? "metric_" + ++i : metric.getName();
if (lineChart.getxAxisField() != null
&& !lineChart.getxAxisField().equals(DataInsightSystemChartRepository.TIMESTAMP_FIELD)) {
IncludeExclude includeExclude = null;
if (!CommonUtil.nullOrEmpty(lineChart.getIncludeXAxisFiled())
|| !CommonUtil.nullOrEmpty(lineChart.getExcludeXAxisField())) {
includeExclude =
new IncludeExclude(
lineChart.getIncludeXAxisFiled(), lineChart.getExcludeXAxisField());
}
aggregationBuilder =
AggregationBuilders.terms(metricName).field(lineChart.getxAxisField()).size(1000);
AggregationBuilders.terms(metricName)
.field(lineChart.getxAxisField())
.includeExclude(includeExclude)
.size(1000);

// in case of horizontal axis only process data of 24 hr prior to end time
start = end - MILLISECONDS_IN_DAY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,18 @@ public SearchRequest prepareSearchRequest(
String metricName = metric.getName() == null ? "metric_" + ++i : metric.getName();
if (lineChart.getxAxisField() != null
&& !lineChart.getxAxisField().equals(DataInsightSystemChartRepository.TIMESTAMP_FIELD)) {
IncludeExclude includeExclude = null;
if (!CommonUtil.nullOrEmpty(lineChart.getIncludeXAxisFiled())
|| !CommonUtil.nullOrEmpty(lineChart.getExcludeXAxisField())) {
includeExclude =
new IncludeExclude(
lineChart.getIncludeXAxisFiled(), lineChart.getExcludeXAxisField());
}
aggregationBuilder =
AggregationBuilders.terms(metricName).field(lineChart.getxAxisField()).size(1000);
AggregationBuilders.terms(metricName)
.field(lineChart.getxAxisField())
.includeExclude(includeExclude)
.size(1000);

// in case of horizontal axis only process data of 24 hr prior to end time
start = end - MILLISECONDS_IN_DAY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
"description": "X-axis field for the data insight chart.",
"type": "string",
"default": "@timestamp"
},
"includeXAxisFiled": {
"description": "Regex to include fields in the data insight chart when xAxisField is specified.",
"type": "string"
},
"excludeXAxisField": {
"description": "Regex to exclude fields from the data insight chart when xAxisField is specified.",
"type": "string"
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,9 +1099,6 @@ export const deletedEntityCommonChecks = async ({
}) => {
const isTableEntity = endPoint === EntityTypeEndpoint.Table;

// Go to first tab before starts validating
await page.click('.ant-tabs-tab:nth-child(1)');

// Check if all the edit actions are available for the entity
await checkForEditActions({
page,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import { Col, Row } from 'antd';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { SystemChartType } from '../../../enums/DataInsight.enum';
import { useDataInsightProvider } from '../../../pages/DataInsightPage/DataInsightProvider';
import { SystemChartType } from '../../../rest/DataInsightAPI';
import Loader from '../../common/Loader/Loader';
import { DataInsightChartCard } from '../DataInsightChartCard';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ import {
NO_OWNER_ADVANCE_SEARCH_FILTER,
} from '../../constants/explore.constants';

import { SystemChartType } from '../../enums/DataInsight.enum';
import { SearchIndex } from '../../enums/search.enum';
import { DataInsightChart } from '../../generated/api/dataInsight/kpi/createKpiRequest';
import { useDataInsightProvider } from '../../pages/DataInsightPage/DataInsightProvider';
import {
DataInsightCustomChartResult,
getChartPreviewByName,
SystemChartType,
} from '../../rest/DataInsightAPI';
import { updateActiveChartFilter } from '../../utils/ChartUtils';
import { entityChartColor } from '../../utils/CommonUtils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import React, { FC, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router-dom';
import { WEB_CHARTS } from '../../constants/DataInsight.constants';
import { SystemChartType } from '../../enums/DataInsight.enum';
import { DataReportIndex } from '../../generated/dataInsight/dataInsightChart';
import {
DataInsightChartResult,
Expand All @@ -32,7 +33,6 @@ import { useDataInsightProvider } from '../../pages/DataInsightPage/DataInsightP
import {
getAggregateChartData,
getMultiChartsPreviewByName,
SystemChartType,
} from '../../rest/DataInsightAPI';
import { getTeamByName } from '../../rest/teamsAPI';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import CustomPieChart from '../../../Visualisations/Chart/CustomPieChart.compone
import { PieChartWidgetCommonProps } from '../../DataQuality.interface';

const DataAssetsCoveragePieChartWidget = ({
className = '',
chartFilter,
}: PieChartWidgetCommonProps) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -116,7 +117,7 @@ const DataAssetsCoveragePieChartWidget = ({
}, [chartFilter]);

return (
<Card loading={isLoading}>
<Card className={className} loading={isLoading}>
<div className="d-flex flex-column items-center">
<div className="d-flex items-center gap-2">
<DataAssetsCoverageIcon height={20} width={20} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import CustomPieChart from '../../../Visualisations/Chart/CustomPieChart.compone
import { PieChartWidgetCommonProps } from '../../DataQuality.interface';

const EntityHealthStatusPieChartWidget = ({
className = '',
chartFilter,
}: PieChartWidgetCommonProps) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -107,7 +108,7 @@ const EntityHealthStatusPieChartWidget = ({
}, [chartFilter]);

return (
<Card loading={isLoading}>
<Card className={className} loading={isLoading}>
<div className="d-flex flex-column items-center">
<div className="d-flex items-center gap-2">
<HealthCheckIcon height={20} width={20} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import CustomPieChart from '../../../Visualisations/Chart/CustomPieChart.compone
import { PieChartWidgetCommonProps } from '../../DataQuality.interface';

const TestCaseStatusPieChartWidget = ({
className = '',
chartFilter,
}: PieChartWidgetCommonProps) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -100,6 +101,7 @@ const TestCaseStatusPieChartWidget = ({

return (
<Card
className={className}
data-testid="test-case-status-pie-chart-widget"
loading={isTestCaseSummaryLoading}>
<div className="d-flex flex-column items-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface TestCaseStatusAreaChartWidgetProps {
}

export interface PieChartWidgetCommonProps {
className?: string;
chartFilter?: DataQualityDashboardChartFilters;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
import { ExclamationCircleFilled } from '@ant-design/icons';
import { Badge, Col, Divider, Row, Typography } from 'antd';
import classNames from 'classnames';
import { isEmpty } from 'lodash';
import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -39,6 +40,8 @@ const EntityHeaderTitle = ({
color,
showName = true,
certification,
nameClassName = '',
displayNameClassName = '',
}: EntityHeaderTitleProps) => {
const { t } = useTranslation();
const location = useCustomLocation();
Expand All @@ -63,15 +66,19 @@ const EntityHeaderTitle = ({
{/* If we do not have displayName name only be shown in the bold from the below code */}
{!isEmpty(displayName) && showName ? (
<Typography.Text
className="m-b-0 d-block text-grey-muted"
data-testid="entity-header-name">
className={classNames('entity-header-name', nameClassName)}
data-testid="entity-header-name"
ellipsis={{ tooltip: true }}>
{stringToHTML(name)}
</Typography.Text>
) : null}

{/* It will render displayName fallback to name */}
<Typography.Text
className="m-b-0 d-block entity-header-display-name text-lg font-semibold"
className={classNames(
'entity-header-display-name',
displayNameClassName
)}
data-testid="entity-header-display-name"
ellipsis={{ tooltip: true }}
style={{ color: color ?? TEXT_COLOR }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ export interface EntityHeaderTitleProps {
isDisabled?: boolean;
showName?: boolean;
certification?: AssetCertification;
nameClassName?: string;
displayNameClassName?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@import (reference) url('../../../styles/variables.less');

.ant-col.entity-header-content {
max-width: calc(100% - 100px);
.ant-typography-ellipsis.entity-header-name {
margin-bottom: 0px;
display: block;
color: @text-grey-muted;
}
.ant-typography-ellipsis.entity-header-display-name {
font-weight: 600;
font-size: 16px;
}
}
Loading
Loading