Skip to content

Commit 174fb12

Browse files
authored
Merge branch 'datahub-project:master' into master
2 parents bfe765e + ac6bca7 commit 174fb12

File tree

30 files changed

+822
-309
lines changed

30 files changed

+822
-309
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
**/.tox/
66
**/.mypy_cache/
77
**/.pytest_cache/
8+
**/.ruff_cache/
89
**/__pycache__/
910
out
1011
**/*.class
@@ -16,3 +17,6 @@ out
1617
.git/COMMIT_*
1718
.git/index
1819
.gradle
20+
21+
/metadata-ingestion/tests
22+
/metadata-ingestion/examples

.github/workflows/docker-unified.yml

+3-21
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ jobs:
753753
if: ${{ needs.setup.outputs.ingestion_base_change == 'true' }}
754754
uses: ./.github/actions/docker-custom-build-and-push
755755
with:
756-
target: base
756+
target: base-empty
757757
images: |
758758
${{ env.DATAHUB_INGESTION_BASE_IMAGE }}
759759
image_tag: ${{ needs.setup.outputs.tag }}
@@ -797,7 +797,6 @@ jobs:
797797
if: ${{ needs.setup.outputs.ingestion_base_change == 'true' }}
798798
uses: ./.github/actions/docker-custom-build-and-push
799799
with:
800-
target: slim-install
801800
images: |
802801
${{ env.DATAHUB_INGESTION_BASE_IMAGE }}
803802
image_tag: ${{ needs.setup.outputs.slim_tag }}
@@ -840,7 +839,6 @@ jobs:
840839
if: ${{ needs.setup.outputs.ingestion_base_change == 'true' }}
841840
uses: ./.github/actions/docker-custom-build-and-push
842841
with:
843-
target: full-install
844842
images: |
845843
${{ env.DATAHUB_INGESTION_BASE_IMAGE }}
846844
image_tag: ${{ needs.setup.outputs.full_tag }}
@@ -863,7 +861,7 @@ jobs:
863861
outputs:
864862
tag: ${{ steps.tag.outputs.tag }}
865863
needs_artifact_download: ${{ needs.setup.outputs.ingestion_change == 'true' && ( needs.setup.outputs.publish != 'true' && needs.setup.outputs.pr-publish != 'true') }}
866-
needs: [setup, smoke_test_lint,datahub_ingestion_base_slim_build]
864+
needs: [setup, smoke_test_lint]
867865
if: ${{ needs.setup.outputs.ingestion_change == 'true' || needs.setup.outputs.publish == 'true' || needs.setup.outputs.pr-publish == 'true' }}
868866
steps:
869867
- name: Check out the repo
@@ -880,11 +878,6 @@ jobs:
880878
- name: Build codegen
881879
if: ${{ needs.setup.outputs.ingestion_change == 'true' || needs.setup.outputs.publish == 'true' || needs.setup.outputs.pr-publish =='true' }}
882880
run: ./gradlew :metadata-ingestion:codegen
883-
- name: Download Base Image
884-
uses: ishworkh/[email protected]
885-
if: ${{ needs.setup.outputs.publish != 'true' && needs.setup.outputs.pr-publish != 'true' && needs.setup.outputs.ingestion_base_change == 'true' }}
886-
with:
887-
image: ${{ env.DATAHUB_INGESTION_BASE_IMAGE }}:${{ needs.setup.outputs.ingestion_base_change == 'true' && needs.setup.outputs.unique_slim_tag || 'head-slim' }}
888881
- name: Login to DockerHub
889882
uses: docker/login-action@v3
890883
if: ${{ needs.setup.outputs.docker-login == 'true' && needs.setup.outputs.publish == 'false' && needs.setup.outputs.pr-publish == 'false' && needs.setup.outputs.ingestion_base_change == 'false' }}
@@ -895,12 +888,9 @@ jobs:
895888
if: ${{ needs.setup.outputs.ingestion_change == 'true' || needs.setup.outputs.publish == 'true' || needs.setup.outputs.pr-publish == 'true' }}
896889
uses: ./.github/actions/docker-custom-build-and-push
897890
with:
898-
target: final
899891
images: |
900892
${{ env.DATAHUB_INGESTION_IMAGE }}
901893
build-args: |
902-
BASE_IMAGE=${{ env.DATAHUB_INGESTION_BASE_IMAGE }}
903-
DOCKER_VERSION=${{ needs.setup.outputs.ingestion_base_change == 'true' && needs.setup.outputs.unique_slim_tag || 'head-slim' }}
904894
RELEASE_VERSION=${{ needs.setup.outputs.python_release_version }}
905895
APP_ENV=slim
906896
image_tag: ${{ needs.setup.outputs.slim_tag }}
@@ -959,7 +949,7 @@ jobs:
959949
outputs:
960950
tag: ${{ steps.tag.outputs.tag }}
961951
needs_artifact_download: ${{ needs.setup.outputs.ingestion_change == 'true' && ( needs.setup.outputs.publish != 'true' && needs.setup.outputs.pr-publish != 'true' ) }}
962-
needs: [setup, smoke_test_lint,datahub_ingestion_base_full_build]
952+
needs: [setup, smoke_test_lint]
963953
if: ${{ needs.setup.outputs.ingestion_change == 'true' || needs.setup.outputs.publish == 'true' || needs.setup.outputs.pr-publish == 'true' }}
964954
steps:
965955
- name: Check out the repo
@@ -977,11 +967,6 @@ jobs:
977967
- name: Build codegen
978968
if: ${{ needs.setup.outputs.ingestion_change == 'true' || needs.setup.outputs.publish == 'true' || needs.setup.outputs.pr-publish == 'true' }}
979969
run: ./gradlew :metadata-ingestion:codegen
980-
- name: Download Base Image
981-
uses: ishworkh/[email protected]
982-
if: ${{ needs.setup.outputs.publish != 'true' && needs.setup.outputs.pr-publish != 'true' && needs.setup.outputs.ingestion_base_change == 'true' }}
983-
with:
984-
image: ${{ env.DATAHUB_INGESTION_BASE_IMAGE }}:${{ needs.setup.outputs.ingestion_base_change == 'true' && needs.setup.outputs.unique_tag || 'head' }}
985970
- name: Login to DockerHub
986971
uses: docker/login-action@v3
987972
if: ${{ needs.setup.outputs.docker-login == 'true' && needs.setup.outputs.publish == 'false' && needs.setup.outputs.pr-publish == 'false' && needs.setup.outputs.ingestion_base_change == 'false' }}
@@ -992,12 +977,9 @@ jobs:
992977
if: ${{ needs.setup.outputs.ingestion_change == 'true' || needs.setup.outputs.publish == 'true' || needs.setup.outputs.pr-publish == 'true' }}
993978
uses: ./.github/actions/docker-custom-build-and-push
994979
with:
995-
target: final
996980
images: |
997981
${{ env.DATAHUB_INGESTION_IMAGE }}
998982
build-args: |
999-
BASE_IMAGE=${{ env.DATAHUB_INGESTION_BASE_IMAGE }}
1000-
DOCKER_VERSION=${{ needs.setup.outputs.ingestion_base_change == 'true' && needs.setup.outputs.unique_tag || 'head' }}
1001983
RELEASE_VERSION=${{ needs.setup.outputs.python_release_version }}
1002984
image_tag: ${{ needs.setup.outputs.tag }}
1003985
username: ${{ secrets.ACRYL_DOCKER_USERNAME }}

.github/workflows/pr-labeler.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ jobs:
5555
"jayacryl",
5656
"v-tarasevich-blitz-brain",
5757
"ryota-cloud",
58-
"annadoesdesign"
58+
"annadoesdesign",
59+
"jmacryl"
5960
]'),
6061
github.actor
6162
)

datahub-web-react/src/app/entityV2/shared/EntityDropdown/EntityDropdown.tsx

+15-9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import CreateEntityAnnouncementModal from '../announce/CreateEntityAnnouncementM
3131
import { MarkAsDeprecatedButtonContents } from '../components/styled/MarkAsDeprecatedButton';
3232
import { ANTD_GRAY, REDESIGN_COLORS } from '../constants';
3333
import { getEntityPath } from '../containers/profile/utils';
34-
import { AddIncidentModal } from '../tabs/Incident/components/AddIncidentModal';
3534
import { useIsSeparateSiblingsMode } from '../useIsSeparateSiblingsMode';
3635
import CreateGlossaryEntityModal from './CreateGlossaryEntityModal';
3736
import { EntityMenuItems } from './EntityMenuActions';
@@ -42,6 +41,8 @@ import useDeleteEntity from './useDeleteEntity';
4241
import { isDeleteDisabled, isMoveDisabled, shouldDisplayChildDeletionWarning } from './utils';
4342
import LinkAssetVersionModal from './versioning/LinkAssetVersionModal';
4443
import UnlinkAssetVersionModal from './versioning/UnlinkAssetVersionModal';
44+
import { IncidentDetailDrawer } from '../tabs/Incident/AcrylComponents/IncidentDetailDrawer';
45+
import { IncidentAction } from '../tabs/Incident/constant';
4546

4647
const MenuItem = styled.div`
4748
font-size: 13px;
@@ -396,13 +397,12 @@ const EntityDropdown = (props: Props) => {
396397
{isMoveModalVisible && isDomainEntity && <MoveDomainModal onClose={() => setIsMoveModalVisible(false)} />}
397398
{hasBeenDeleted && !onDelete && deleteRedirectPath && <Redirect to={deleteRedirectPath} />}
398399
{isRaiseIncidentModalVisible && (
399-
<AddIncidentModal
400+
<IncidentDetailDrawer
400401
urn={urn}
401-
entityType={entityType}
402-
visible={isRaiseIncidentModalVisible}
403-
onClose={() => setIsRaiseIncidentModalVisible(false)}
404-
refetch={
405-
(() => {
402+
mode={IncidentAction.CREATE}
403+
onSubmit={() => {
404+
setIsRaiseIncidentModalVisible(false);
405+
setTimeout(() => {
406406
refetchForEntity?.();
407407
history.push(
408408
`${getEntityPath(
@@ -414,8 +414,14 @@ const EntityDropdown = (props: Props) => {
414414
'Incidents',
415415
)}`,
416416
);
417-
}) as any
418-
}
417+
}, 3000);
418+
}}
419+
onCancel={() => setIsRaiseIncidentModalVisible(false)}
420+
entity={{
421+
urn,
422+
entityType,
423+
platform: entityData?.platform ?? entityData?.dataPlatformInstance?.platform,
424+
}}
419425
/>
420426
)}
421427
{isLinkAssetVersionModalVisible && (

datahub-web-react/src/app/entityV2/shared/tabs/Documentation/components/CompactMarkdownViewer.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ const MarkdownViewContainer = styled.div<{ scrollableY: boolean }>`
4444
`;
4545

4646
const CompactEditor = styled(Editor)<{ limit: number | null; customStyle?: React.CSSProperties }>`
47+
.remirror-theme {
48+
max-width: 100%;
49+
}
4750
.remirror-editor.ProseMirror {
4851
${({ limit }) => limit && `max-height: ${limit * LINE_HEIGHT}em;`}
4952
h1 {

datahub-web-react/src/app/entityV2/shared/tabs/Incident/AcrylComponents/IncidentDetailDrawer.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type IncidentDetailDrawerProps = {
2222
};
2323

2424
export const IncidentDetailDrawer = ({
25+
urn,
2526
mode,
2627
onCancel,
2728
onSubmit,
@@ -82,6 +83,7 @@ export const IncidentDetailDrawer = ({
8283
incidentUrn={incident?.urn}
8384
entity={entity}
8485
onSubmit={handleSubmit}
86+
urn={urn}
8587
/>
8688
) : (
8789
<IncidentView incident={incident as IncidentTableRow} />

datahub-web-react/src/app/entityV2/shared/tabs/Incident/AcrylComponents/IncidentEditor.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const IncidentEditor = ({
4141
data,
4242
mode = IncidentAction.CREATE,
4343
entity,
44+
urn,
4445
}: IncidentEditorProps) => {
4546
const assigneeValues = data?.assignees && getAssigneeWithURN(data.assignees);
4647
const isFormValid = Boolean(
@@ -69,6 +70,7 @@ export const IncidentEditor = ({
6970
linkedAssets: cachedLinkedAssets,
7071
entity,
7172
currentIncident: data,
73+
urn,
7274
});
7375
const formValues = Form.useWatch([], form);
7476

@@ -212,6 +214,7 @@ export const IncidentEditor = ({
212214
mode={mode}
213215
setCachedLinkedAssets={setCachedLinkedAssets}
214216
setIsLinkedAssetsLoading={setIsLoadingAssigneeOrAssets}
217+
urn={urn}
215218
/>
216219
</SelectFormItem>
217220
{mode === IncidentAction.EDIT && (

datahub-web-react/src/app/entityV2/shared/tabs/Incident/AcrylComponents/IncidentLinkedAssetsList.tsx

+11-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import styled from 'styled-components';
66
import { useGetEntitiesLazyQuery } from '@src/graphql/entity.generated';
77
import { EntityCapabilityType } from '@src/app/entityV2/Entity';
88
import { useEntityRegistryV2 } from '@src/app/useEntityRegistry';
9-
import { useEntityData } from '@src/app/entity/shared/EntityContext';
109
import { IncidentLinkedAssetsListProps } from '../types';
1110
import { AssetWrapper, LinkedAssets, LoadingWrapper } from './styledComponents';
1211
import { LinkedAssetsContainer } from '../styledComponents';
@@ -26,8 +25,8 @@ export const IncidentLinkedAssetsList = ({
2625
mode,
2726
setCachedLinkedAssets,
2827
setIsLinkedAssetsLoading,
28+
urn,
2929
}: IncidentLinkedAssetsListProps) => {
30-
const { urn } = useEntityData();
3130
const [getEntities, { data: resolvedLinkedAssets, loading: entitiesLoading }] = useGetEntitiesLazyQuery();
3231
const entityRegistry = useEntityRegistryV2();
3332

@@ -52,22 +51,25 @@ export const IncidentLinkedAssetsList = ({
5251
};
5352

5453
const batchAddAssets = (entityUrns: Array<string>) => {
55-
const updatedUrns = [...form.getFieldValue(RESOURCE_URN_FIELD_NAME), ...entityUrns];
54+
const existingUrns = form.getFieldValue(RESOURCE_URN_FIELD_NAME) || [];
55+
const updatedUrns = [...existingUrns, ...entityUrns];
5656
const uniqueUrns = [...new Set(updatedUrns)];
5757
form.setFieldValue(RESOURCE_URN_FIELD_NAME, uniqueUrns);
58-
setIsBatchAddAssetListModalVisible(false);
5958
getEntities({
6059
variables: { urns: form.getFieldValue(RESOURCE_URN_FIELD_NAME) },
6160
});
61+
setIsBatchAddAssetListModalVisible(false);
6262
};
6363

6464
useEffect(() => {
6565
if (mode === IncidentAction.CREATE) {
66-
getEntities({
67-
variables: {
68-
urns: [urn],
69-
},
70-
});
66+
if (urn) {
67+
getEntities({
68+
variables: {
69+
urns: [urn],
70+
},
71+
});
72+
}
7173
}
7274
// eslint-disable-next-line react-hooks/exhaustive-deps
7375
}, []);

datahub-web-react/src/app/entityV2/shared/tabs/Incident/AcrylComponents/hooks/useIncidentHandler.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useState } from 'react';
2-
import { useEntityData } from '@src/app/entity/shared/EntityContext';
32
import { useRaiseIncidentMutation, useUpdateIncidentMutation } from '@src/graphql/mutations.generated';
43
import { EntityType, IncidentSourceType, IncidentState } from '@src/types.generated';
54
import analytics, { EntityActionType, EventType } from '@src/app/analytics';
@@ -62,7 +61,7 @@ export const getCacheIncident = ({
6261

6362
priority: values.priority,
6463
created: {
65-
time: values.created || new Date(),
64+
time: values.created || Date.now(),
6665
actor: user?.urn,
6766
},
6867
assignees: values.assignees,
@@ -79,11 +78,11 @@ export const useIncidentHandler = ({
7978
linkedAssets,
8079
entity,
8180
currentIncident,
81+
urn,
8282
}) => {
8383
const [raiseIncidentMutation] = useRaiseIncidentMutation();
8484
const [updateIncidentMutation] = useUpdateIncidentMutation();
8585
const [form] = Form.useForm();
86-
const { urn, entityType } = useEntityData();
8786
const client = useApolloClient();
8887
const isAddIncidentMode = mode === IncidentAction.CREATE;
8988

@@ -166,8 +165,9 @@ export const useIncidentHandler = ({
166165
values: {
167166
...values,
168167
state: baseInput.status.state,
169-
stage: baseInput.status.stage,
168+
stage: baseInput.status.stage || '',
170169
message: baseInput.status.message,
170+
priority: values.priority || null,
171171
assignees,
172172
linkedAssets,
173173
},
@@ -177,7 +177,7 @@ export const useIncidentHandler = ({
177177
updateActiveIncidentInCache(client, urn, newIncident, PAGE_SIZE);
178178
analytics.event({
179179
type: EventType.EntityActionEvent,
180-
entityType,
180+
entityType: entity?.entityType,
181181
entityUrn: urn,
182182
actionType: EntityActionType.AddIncident,
183183
});

datahub-web-react/src/app/entityV2/shared/tabs/Incident/types.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export type IncidentEditorProps = {
101101
data?: IncidentTableRow;
102102
mode?: IncidentAction;
103103
entity?: EntityStagedForIncident;
104+
urn?: string;
104105
};
105106

106107
export type IncidentLinkedAssetsListProps = {
@@ -109,6 +110,7 @@ export type IncidentLinkedAssetsListProps = {
109110
mode: IncidentAction;
110111
setCachedLinkedAssets: React.Dispatch<React.SetStateAction<any[]>>;
111112
setIsLinkedAssetsLoading: React.Dispatch<React.SetStateAction<boolean>>;
113+
urn?: string;
112114
};
113115

114116
export interface TimelineContentDetails extends BaseItemType {
@@ -127,7 +129,7 @@ export enum IncidentConstant {
127129

128130
export type EntityStagedForIncident = {
129131
urn: string;
130-
platform: DataPlatform;
132+
platform?: DataPlatform;
131133
entityType: EntityType;
132134
};
133135

datahub-web-react/src/app/entityV2/shared/tabs/Properties/ValuesColumn.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ const ValuesContainerFlex = styled.div<{ renderType: TabRenderType }>`
2020
justify-content: flex-start;
2121
align-items: flex-start; /* Ensure items are aligned at the start */
2222
flex-wrap: wrap;
23+
width: 100%;
2324
`;
2425

2526
const ValueContainer = styled.div`
26-
flex: 0 1 auto;
27+
width: 100%;
28+
max-width: 100%;
2729
`;
2830

2931
export default function ValuesColumn({ propertyRow, filterText, hydratedEntityMap, renderType }: Props) {

datahub-web-react/src/app/searchV2/filters/__tests__/utils.test.tsx

+22
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ import {
2121
canCreateViewFromFilters,
2222
isAnyOptionSelected,
2323
getStructuredPropFilterDisplayName,
24+
getFilterDisplayName,
2425
} from '../utils';
2526
import { ENTITY_SUB_TYPE_FILTER_NAME } from '../../utils/constants';
27+
import { FieldType, FilterField } from '../types';
2628

2729
describe('filter utils - getNewFilters', () => {
2830
it('should get the correct list of filters when adding filters where the filter field did not already exist', () => {
@@ -467,3 +469,23 @@ describe('filter utils - getStructuredPropFilterDisplayName', () => {
467469
).toBe('test value for a rich text situation right here!');
468470
});
469471
});
472+
473+
describe('filter utils - getFilterDisplayName', () => {
474+
it('should return the displayName for an option if it exists', () => {
475+
const option = { value: 'testValue', displayName: 'test name' };
476+
const field: FilterField = { type: FieldType.ENUM, field: 'test', displayName: 'test' };
477+
expect(getFilterDisplayName(option, field)).toBe('test name');
478+
});
479+
480+
it('should return undefined if no display name and field is not a structured property filter', () => {
481+
const option = { value: 'testValue' };
482+
const field: FilterField = { type: FieldType.ENUM, field: 'structuredProperties.test', displayName: 'test' };
483+
expect(getFilterDisplayName(option, field)).toBe('testValue');
484+
});
485+
486+
it('should return the structured property value properly if this is a structured property filter (structured prop value is tested above)', () => {
487+
const option = { value: 'testValue' };
488+
const field: FilterField = { type: FieldType.ENUM, field: 'test', displayName: 'test' };
489+
expect(getFilterDisplayName(option, field)).toBe(undefined);
490+
});
491+
});

0 commit comments

Comments
 (0)