Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

438 lines
13 KiB
TypeScript
Raw Normal View History

/*
* Copyright 2024 Collate.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import test, { expect } from '@playwright/test';
import { get } from 'lodash';
import { SidebarItem } from '../../constant/sidebar';
import { ApiEndpointClass } from '../../support/entity/ApiEndpointClass';
import { ContainerClass } from '../../support/entity/ContainerClass';
import { DashboardClass } from '../../support/entity/DashboardClass';
Issue-15768: Support Metric Entity (#17680) * Issue-15768: Support Metric Entity * Issue-15768: Support Metric Entity * Issue-15768: Support Metric Entity * Fix tests * Fix tests * Fix tests * Minor: Fix tests * ui: add metricsAPI rest utils * ui: metric list page part 1 * feat: Add metric translations for multiple languages * chore: Add "metric" field to SearchIndexingApplication schema * ui: add create metric page * ui: metric details page patch 1 * ui: add custom property and lineage support for metric entity * ui: add expression component * ui: add metric summary component * chore: Update tab labels in MetricDetails and MetricVersion components * ui: show other info like metric type, granularity, etc * feat: Add support for metric entity in search dropdown * feat: Rename custom property to Metric in MetricEntity.md * feat: Add OwnerLabel component to MetricListPage * Fix expression field in Metric * chore: update expression to metricExpression * ui: add metric header component with edit option * Add metric to SearchIndexApp * chore: Update expression to metricExpression * ui: allow metric expression edit * ui: update metric icon * minor improvements * Fix lineage indexing for Metric * Update GlobalSettingsClassBase.ts to use MetricIcon for metrics in the global settings menu * Fix error handling in MetricListPage component * add related metrics * minor improvements * Fix relatedTerms patch * Fix relatedTerms validation * Add Boolean for deleted * filter active entity from related metric list * playwrite e2e part 1 * Refactor MetricSummary component to include RelatedMetrics in the summary panel * test: add playwright test for metric special cases * Add 'Metrics' to Explore Tree * test: add e2e for add metric page * test: add test for metric listing page content * Add Boolean for deleted, remove deleted from suggests * Refactor LineageProvider to handle deleted flag properly * add playwright for metric listing * fix test * Add colored metric icon and update its usage in GlobalSettingsClassBase * Fixed py_test test_ometa_endpoint for metric --------- Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com> Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com> Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Co-authored-by: SumanMaharana <sumanmaharana786@gmail.com> Co-authored-by: Ashish Gupta <ashish@getcollate.io>
2024-09-15 23:06:31 -07:00
import { MetricClass } from '../../support/entity/MetricClass';
import { MlModelClass } from '../../support/entity/MlModelClass';
import { PipelineClass } from '../../support/entity/PipelineClass';
import { SearchIndexClass } from '../../support/entity/SearchIndexClass';
import { TableClass } from '../../support/entity/TableClass';
import { TopicClass } from '../../support/entity/TopicClass';
import {
createNewPage,
getApiContext,
redirectToHomePage,
} from '../../utils/common';
import {
activateColumnLayer,
addColumnLineage,
addPipelineBetweenNodes,
applyPipelineFromModal,
connectEdgeBetweenNodes,
deleteEdge,
deleteNode,
editLineage,
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
LineageEdge,
performZoomOut,
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
rearrangeNodes,
removeColumnLineage,
setupEntitiesForLineage,
verifyColumnLayerInactive,
verifyColumnLineageInCSV,
verifyExportLineageCSV,
verifyExportLineagePNG,
verifyNodePresent,
visitLineageTab,
} from '../../utils/lineage';
import { sidebarClick } from '../../utils/sidebar';
// use the admin user to login
test.use({
storageState: 'playwright/.auth/admin.json',
});
const entities = [
TableClass,
DashboardClass,
TopicClass,
MlModelClass,
ContainerClass,
SearchIndexClass,
ApiEndpointClass,
Issue-15768: Support Metric Entity (#17680) * Issue-15768: Support Metric Entity * Issue-15768: Support Metric Entity * Issue-15768: Support Metric Entity * Fix tests * Fix tests * Fix tests * Minor: Fix tests * ui: add metricsAPI rest utils * ui: metric list page part 1 * feat: Add metric translations for multiple languages * chore: Add "metric" field to SearchIndexingApplication schema * ui: add create metric page * ui: metric details page patch 1 * ui: add custom property and lineage support for metric entity * ui: add expression component * ui: add metric summary component * chore: Update tab labels in MetricDetails and MetricVersion components * ui: show other info like metric type, granularity, etc * feat: Add support for metric entity in search dropdown * feat: Rename custom property to Metric in MetricEntity.md * feat: Add OwnerLabel component to MetricListPage * Fix expression field in Metric * chore: update expression to metricExpression * ui: add metric header component with edit option * Add metric to SearchIndexApp * chore: Update expression to metricExpression * ui: allow metric expression edit * ui: update metric icon * minor improvements * Fix lineage indexing for Metric * Update GlobalSettingsClassBase.ts to use MetricIcon for metrics in the global settings menu * Fix error handling in MetricListPage component * add related metrics * minor improvements * Fix relatedTerms patch * Fix relatedTerms validation * Add Boolean for deleted * filter active entity from related metric list * playwrite e2e part 1 * Refactor MetricSummary component to include RelatedMetrics in the summary panel * test: add playwright test for metric special cases * Add 'Metrics' to Explore Tree * test: add e2e for add metric page * test: add test for metric listing page content * Add Boolean for deleted, remove deleted from suggests * Refactor LineageProvider to handle deleted flag properly * add playwright for metric listing * fix test * Add colored metric icon and update its usage in GlobalSettingsClassBase * Fixed py_test test_ometa_endpoint for metric --------- Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com> Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com> Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Co-authored-by: SumanMaharana <sumanmaharana786@gmail.com> Co-authored-by: Ashish Gupta <ashish@getcollate.io>
2024-09-15 23:06:31 -07:00
MetricClass,
] as const;
const pipeline = new PipelineClass();
test.beforeAll('Setup pre-requests', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
await pipeline.create(apiContext);
await afterAction();
});
test.afterAll('Cleanup', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
await pipeline.delete(apiContext);
await afterAction();
});
for (const EntityClass of entities) {
const defaultEntity = new EntityClass();
test(`Lineage creation from ${defaultEntity.getType()} entity`, async ({
browser,
}) => {
// 5 minutes to avoid test timeout happening some times in AUTs
test.setTimeout(300_000);
const { page } = await createNewPage(browser);
const { currentEntity, entities, cleanup } = await setupEntitiesForLineage(
page,
defaultEntity
);
try {
await test.step('Should create lineage for the entity', async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await verifyColumnLayerInactive(page);
await editLineage(page);
await performZoomOut(page);
for (const entity of entities) {
await connectEdgeBetweenNodes(page, currentEntity, entity);
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await rearrangeNodes(page);
}
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await page.click('[data-testid="edit-lineage"]');
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await page.getByTestId('fit-screen').click();
for (const entity of entities) {
await verifyNodePresent(page, entity);
}
await page.click('[data-testid="edit-lineage"]');
});
await test.step('Should create pipeline between entities', async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await editLineage(page);
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await page.getByTestId('fit-screen').click();
for (const entity of entities) {
await applyPipelineFromModal(page, currentEntity, entity, pipeline);
}
});
await test.step('Verify Lineage Export CSV', async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await verifyExportLineageCSV(page, currentEntity, entities, pipeline);
});
await test.step('Verify Lineage Export PNG', async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await verifyExportLineagePNG(page);
});
await test.step(
'Remove lineage between nodes for the entity',
async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await editLineage(page);
await performZoomOut(page);
for (const entity of entities) {
await deleteEdge(page, currentEntity, entity);
}
}
);
} finally {
await cleanup();
}
});
}
test('Verify column lineage between tables', async ({ browser }) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table1 = new TableClass();
const table2 = new TableClass();
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await Promise.all([table1.create(apiContext), table2.create(apiContext)]);
const sourceTableFqn = get(table1, 'entityResponseData.fullyQualifiedName');
const sourceCol = `${sourceTableFqn}.${get(
table1,
'entityResponseData.columns[0].name'
)}`;
const targetTableFqn = get(table2, 'entityResponseData.fullyQualifiedName');
const targetCol = `${targetTableFqn}.${get(
table2,
'entityResponseData.columns[0].name'
)}`;
await addPipelineBetweenNodes(page, table1, table2);
await activateColumnLayer(page);
// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await deleteNode(page, table2);
await table1.delete(apiContext);
await table2.delete(apiContext);
await afterAction();
});
test('Verify column lineage between table and topic', async ({ browser }) => {
test.slow();
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table = new TableClass();
const topic = new TopicClass();
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await Promise.all([table.create(apiContext), topic.create(apiContext)]);
const tableServiceFqn = get(
table,
'entityResponseData.service.fullyQualifiedName'
);
const topicServiceFqn = get(
topic,
'entityResponseData.service.fullyQualifiedName'
);
const sourceTableFqn = get(table, 'entityResponseData.fullyQualifiedName');
const sourceCol = `${sourceTableFqn}.${get(
table,
'entityResponseData.columns[0].name'
)}`;
const targetCol = get(
topic,
'entityResponseData.messageSchema.schemaFields[0].children[0].fullyQualifiedName'
);
await addPipelineBetweenNodes(page, table, topic);
await activateColumnLayer(page);
// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
// Verify column lineage
await redirectToHomePage(page);
await table.visitEntityPage(page);
await visitLineageTab(page);
await verifyColumnLineageInCSV(page, table, topic, sourceCol, targetCol);
// Verify relation in platform lineage
await sidebarClick(page, SidebarItem.LINEAGE);
const searchRes = page.waitForResponse('/api/v1/search/query?*');
await page.click('[data-testid="search-entity-select"]');
await page.keyboard.type(tableServiceFqn);
await searchRes;
await page.click(`[data-testid="node-suggestion-${tableServiceFqn}"]`);
await page.waitForLoadState('networkidle');
const tableServiceNode = page.locator(
`[data-testid="lineage-node-${tableServiceFqn}"]`
);
const topicServiceNode = page.locator(
`[data-testid="lineage-node-${topicServiceFqn}"]`
);
await expect(tableServiceNode).toBeVisible();
await expect(topicServiceNode).toBeVisible();
await table.visitEntityPage(page);
await visitLineageTab(page);
await page.click('[data-testid="edit-lineage"]');
await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await deleteNode(page, topic);
await table.delete(apiContext);
await topic.delete(apiContext);
await afterAction();
});
test('Verify column lineage between topic and api endpoint', async ({
browser,
}) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const topic = new TopicClass();
const apiEndpoint = new ApiEndpointClass();
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await Promise.all([topic.create(apiContext), apiEndpoint.create(apiContext)]);
const sourceCol = get(
topic,
'entityResponseData.messageSchema.schemaFields[0].children[0].fullyQualifiedName'
);
const targetCol = get(
apiEndpoint,
'entityResponseData.responseSchema.schemaFields[0].children[1].fullyQualifiedName'
);
await addPipelineBetweenNodes(page, topic, apiEndpoint);
await activateColumnLayer(page);
// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await deleteNode(page, apiEndpoint);
await topic.delete(apiContext);
await apiEndpoint.delete(apiContext);
await afterAction();
});
test('Verify column lineage between table and api endpoint', async ({
browser,
}) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table = new TableClass();
const apiEndpoint = new ApiEndpointClass();
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await Promise.all([table.create(apiContext), apiEndpoint.create(apiContext)]);
const sourceTableFqn = get(table, 'entityResponseData.fullyQualifiedName');
const sourceCol = `${sourceTableFqn}.${get(
table,
'entityResponseData.columns[0].name'
)}`;
const targetCol = get(
apiEndpoint,
'entityResponseData.responseSchema.schemaFields[0].children[0].fullyQualifiedName'
);
await addPipelineBetweenNodes(page, table, apiEndpoint);
await activateColumnLayer(page);
// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await deleteNode(page, apiEndpoint);
await table.delete(apiContext);
await apiEndpoint.delete(apiContext);
await afterAction();
});
test('Verify function data in edge drawer', async ({ browser }) => {
test.slow();
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table1 = new TableClass();
const table2 = new TableClass();
try {
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await Promise.all([table1.create(apiContext), table2.create(apiContext)]);
const sourceTableFqn = get(table1, 'entityResponseData.fullyQualifiedName');
const sourceColName = `${sourceTableFqn}.${get(
table1,
'entityResponseData.columns[0].name'
)}`;
const targetTableFqn = get(table2, 'entityResponseData.fullyQualifiedName');
const targetColName = `${targetTableFqn}.${get(
table2,
'entityResponseData.columns[0].name'
)}`;
await addPipelineBetweenNodes(page, table1, table2);
await activateColumnLayer(page);
await addColumnLineage(page, sourceColName, targetColName);
const lineageReq = page.waitForResponse('/api/v1/lineage/getLineage?*');
await page.reload();
const lineageRes = await lineageReq;
const jsonRes = await lineageRes.json();
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
const edge: LineageEdge = [...Object.values(jsonRes.downstreamEdges)][0];
const columnData = edge.columns[0];
const newEdge = {
edge: {
fromEntity: {
id: edge.fromEntity.id,
type: edge.fromEntity.type,
},
toEntity: {
id: edge.toEntity.id,
type: edge.toEntity.type,
},
lineageDetails: {
columnsLineage: [
{
fromColumns: [columnData.fromColumns[0]],
function: 'count',
toColumn: columnData.toColumn,
},
],
description: 'test',
},
},
};
await apiContext.put(`/api/v1/lineage`, {
data: newEdge,
});
const lineageReq1 = page.waitForResponse('/api/v1/lineage/getLineage?*');
await page.reload();
await lineageReq1;
await page.waitForLoadState('networkidle');
await activateColumnLayer(page);
await page
.locator(
`[data-testid="column-edge-${btoa(sourceColName)}-${btoa(
targetColName
)}"]`
)
.dispatchEvent('click');
await page.locator('.edge-info-drawer').isVisible();
2024-11-13 13:29:51 +05:30
await expect(page.locator('[data-testid="Function"]')).toContainText(
'count'
);
} finally {
Lineage Improvements (#19639) * - typo update * - Update lineage model and api (cherry picked from commit c5cce2b0c7c1be7ba654bfc2677da0d05215a895) * - Adding patch * - spotless fix * Add Migration For createdAt , createdBy, updatedAt and updatedBy * Moved classes from Elastic Client to Lineage Graph Builder * Update to use correct depth * remove toCondition * Fix Downstream Lineage * moved not so cool things here and there * spotless-failures * call with direction * add upstream depth with + 1 for 0th node * Fix Exports * Fix Exports from and size * parse lineage in ui * Add per entity pagination * Added per entity pagination * Fix Async Export * Fix Java Merges * Fix merge conflict * Fix missing upstream nodes * lineage ui initial commit * Fix Pagination for upstream * Fix Values * fix load more loading * cleanup * fix loading of nodes * fix load more * Fix Direction Values * update expand collapse logic * Fix Deletion Issue * Fix Pipeline Lineage * show pipeline as a node * Use Fqn Hash to find entities is es for lineage * update lineage * Add Lineage for Pipeline to look for as edge and node * Layer and size conditions for upstream and downstream * Add include source fields in lineage request * redesign controls component * add lineage fixes * fix tests * Fix node * Fix Some Failing Test on Lineage * Java Spotless Fix and added missing relation check on migration * Missing conflict changes * fix conflicts * added missing keys * update tests * Add Service Information in service indexes * Add Domain Lineage * Add domain lineages * fix tests * Fix Metric Entity Service Error * Maintain Asset Count for entities adding service and domain lineage * Update to Doc Id and add details to search * Cleanup Service and Domain automatically * fix types * Update review comments * fix icon sizes * Update Services Index wit upstream lineage * add service view * Fix Service Name missingFix Service Name resolution in LineageRepository Update the method to correctly retrieve the service name for the "fromEntity" by specifying the FIELD_SERVICE path. This resolves an issue where the service name was not properly populated. * - Add docUniqueId to lineage data and update related queries - Added lenient Object Mapper for search index to entities mapping * - Fix LineageResourceTest failing due to changes on Lineage Storage * - Update Lineage Details --------- Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
2025-03-10 10:09:29 +05:30
await Promise.all([table1.delete(apiContext), table2.delete(apiContext)]);
await afterAction();
}
});