Skip to content

Commit

Permalink
1. Resolve merge conflict
Browse files Browse the repository at this point in the history
2. Fix the existing golden files
  • Loading branch information
sid-acryl committed Jul 2, 2024
2 parents b9f8b08 + 8d5f0f3 commit cf0f45b
Show file tree
Hide file tree
Showing 87 changed files with 3,232 additions and 562 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,29 @@ jobs:
echo signingKey=$SIGNING_KEY >> gradle.properties
./gradlew -PreleaseVersion=${{ needs.setup.outputs.tag }} :metadata-auth:auth-api:publish
./gradlew :metadata-auth:auth-api:closeAndReleaseRepository --info
- name: publish datahub-custom-plugin-lib snapshot jar
if: ${{ github.event_name != 'release' }}
env:
RELEASE_USERNAME: ${{ secrets.RELEASE_USERNAME }}
RELEASE_PASSWORD: ${{ secrets.RELEASE_PASSWORD }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
echo signingKey=$SIGNING_KEY >> gradle.properties
./gradlew :metadata-integration:java:custom-plugin-lib:printVersion
./gradlew :metadata-integration:java:custom-plugin-lib:publish
- name: release datahub-custom-plugin-lib jar
if: ${{ github.event_name == 'release' }}
env:
RELEASE_USERNAME: ${{ secrets.RELEASE_USERNAME }}
RELEASE_PASSWORD: ${{ secrets.RELEASE_PASSWORD }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
echo signingKey=$SIGNING_KEY >> gradle.properties
./gradlew -PreleaseVersion=${{ needs.setup.outputs.tag }} :metadata-integration:java:custom-plugin-lib:publish
./gradlew :metadata-integration:java:custom-plugin-lib:closeAndReleaseRepository --info
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ public CompletableFuture<Boolean> get(DataFetchingEnvironment environment) throw
context.getOperationContext(),
assertionUrn,
asserteeUrn,
input.getTimestampMillis(),
assertionResult,
mapContextParameters(input.getProperties()));
input.getTimestampMillis() != null
? input.getTimestampMillis()
: System.currentTimeMillis(),
assertionResult);
return true;
}
throw new AuthorizationException(
Expand All @@ -99,6 +100,9 @@ private AssertionResult mapAssertionResult(AssertionResultInput input) {
if (assertionResult.getType() == AssertionResultType.ERROR && input.getError() != null) {
assertionResult.setError(mapAssertionResultError(input));
}
if (input.getProperties() != null) {
assertionResult.setNativeResults(mapContextParameters(input.getProperties()));
}
return assertionResult;
}

Expand Down
4 changes: 3 additions & 1 deletion datahub-graphql-core/src/main/resources/assertions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ input AssertionResultInput {
type: AssertionResultType!

"""
Additional key-value pairs representing runtime context
Additional metadata representing about the native results of the assertion.
These will be displayed alongside the result.
It should be used to capture additional context that is useful for the user.
"""
properties: [StringMapEntryInput!]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public class ReportAssertionResultResolverTest {
.setType(com.linkedin.assertion.AssertionResultErrorType.UNKNOWN_ERROR)
.setProperties(
new StringMap(Map.of("message", "an unknown error occurred"))))
.setExternalUrl(customAssertionUrl))
.setRuntimeContext(new StringMap(Map.of("prop1", "value1")));
.setExternalUrl(customAssertionUrl)
.setNativeResults(new StringMap(Map.of("prop1", "value1"))));

@Test
public void testGetSuccessReportAssertionRunEvent() throws Exception {
Expand Down Expand Up @@ -91,8 +91,7 @@ public void testGetSuccessReportAssertionRunEvent() throws Exception {
Mockito.eq(TEST_ASSERTION_URN),
Mockito.eq(TEST_DATASET_URN),
Mockito.eq(TEST_ASSERTION_RUN_EVENT.getTimestampMillis()),
Mockito.eq(TEST_ASSERTION_RUN_EVENT.getResult()),
Mockito.eq(TEST_ASSERTION_RUN_EVENT.getRuntimeContext()));
Mockito.eq(TEST_ASSERTION_RUN_EVENT.getResult()));
}

@Test
Expand Down Expand Up @@ -126,7 +125,6 @@ public void testGetUpdateAssertionUnauthorized() throws Exception {
Mockito.any(),
Mockito.any(),
Mockito.any(),
Mockito.any(),
Mockito.any());
}

Expand All @@ -146,7 +144,6 @@ public void testGetAssertionServiceException() {
Mockito.any(),
Mockito.any(),
Mockito.any(),
Mockito.any(),
Mockito.any());

ReportAssertionResultResolver resolver = new ReportAssertionResultResolver(mockService);
Expand Down
4 changes: 2 additions & 2 deletions datahub-web-react/src/app/ingest/ManageIngestionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export const ManageIngestionPage = () => {
<PageContainer>
<OnboardingTour stepIds={[INGESTION_CREATE_SOURCE_ID, INGESTION_REFRESH_SOURCES_ID]} />
<PageHeaderContainer>
<PageTitle level={3}>Manage Ingestion</PageTitle>
<PageTitle level={3}>Manage Data Sources</PageTitle>
<Typography.Paragraph type="secondary">
Create, schedule, and run DataHub ingestion sources.
Configure and schedule syncs to import data from your data sources
</Typography.Paragraph>
</PageHeaderContainer>
<StyledTabs activeKey={selectedTab} size="large" onTabClick={(tab: string) => onClickTab(tab)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import styled from 'styled-components/macro';
import { StyledTable } from '../../entity/shared/components/styled/StyledTable';
import { ANTD_GRAY } from '../../entity/shared/constants';
import { CLI_EXECUTOR_ID } from './utils';
import { CLI_EXECUTOR_ID, getIngestionSourceStatus } from './utils';
import {
LastStatusColumn,
TypeColumn,
Expand Down Expand Up @@ -123,7 +123,7 @@ function IngestionSourceTable({
lastExecStatus:
source.executions &&
source.executions?.executionRequests.length > 0 &&
source.executions?.executionRequests[0].result?.status,
getIngestionSourceStatus(source.executions?.executionRequests[0].result),
cliIngestion: source.config?.executorId === CLI_EXECUTOR_ID,
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TimezoneSelect } from './TimezoneSelect';
import { ANTD_GRAY, REDESIGN_COLORS } from '../../../entity/shared/constants';
import { lowerFirstLetter } from '../../../shared/textUtil';
import { IngestionSourceBuilderStep } from './steps';
import { RequiredFieldForm } from '../../../shared/form/RequiredFieldForm';

const Section = styled.div`
display: flex;
Expand All @@ -31,10 +32,25 @@ const CronText = styled(Typography.Paragraph)`
color: ${ANTD_GRAY[7]};
`;

const CronInput = styled(Input)`
margin-bottom: 8px;
max-width: 200px;
`;

const Schedule = styled.div`
display: flex;
align-items: center;
justify-content: start;
`;

const AdvancedSchedule = styled.div`
margin-left: 20px;
`;

const AdvancedCheckBox = styled(Typography.Text)`
margin-right: 10px;
margin-bottom: 8px;
`;

const CronSuccessCheck = styled(CheckCircleOutlined)`
color: ${REDESIGN_COLORS.BLUE};
margin-right: 4px;
Expand Down Expand Up @@ -123,9 +139,9 @@ export const CreateScheduleStep = ({ state, updateState, goTo, prev }: StepProps
<Section>
<SelectTemplateHeader level={5}>Configure an Ingestion Schedule</SelectTemplateHeader>
</Section>
<Form layout="vertical">
<RequiredFieldForm layout="vertical">
<Form.Item
tooltip="Enable to run ingestion on a schedule. Running ingestion on a schedule helps to keep the information inside of DataHub up to date."
tooltip="Enable to run ingestion syncs on a schedule. Running syncs on a schedule helps to keep information up to date."
label={
<Typography.Text strong>
Run on a schedule <Typography.Text type="secondary">(Recommended)</Typography.Text>
Expand All @@ -141,29 +157,31 @@ export const CreateScheduleStep = ({ state, updateState, goTo, prev }: StepProps
)}
</Form.Item>
<StyledFormItem required label={<Typography.Text strong>Schedule</Typography.Text>}>
<div style={{ paddingBottom: 10, paddingLeft: 10 }}>
<AdvancedCheckBox type="secondary">Advanced</AdvancedCheckBox>
<Checkbox
checked={advancedCronCheck}
onChange={(event) => setAdvancedCronCheck(event.target.checked)}
/>
</div>
{advancedCronCheck ? (
<Input
placeholder={DAILY_MIDNIGHT_CRON_INTERVAL}
autoFocus
value={scheduleCronInterval}
onChange={(e) => setScheduleCronInterval(e.target.value)}
/>
) : (
<Cron
value={scheduleCronInterval}
setValue={setScheduleCronInterval}
clearButton={false}
className="cron-builder"
leadingZero
/>
)}
<Schedule>
{advancedCronCheck ? (
<CronInput
placeholder={DAILY_MIDNIGHT_CRON_INTERVAL}
autoFocus
value={scheduleCronInterval}
onChange={(e) => setScheduleCronInterval(e.target.value)}
/>
) : (
<Cron
value={scheduleCronInterval}
setValue={setScheduleCronInterval}
clearButton={false}
className="cron-builder"
leadingZero
/>
)}
<AdvancedSchedule>
<AdvancedCheckBox type="secondary">Show Advanced</AdvancedCheckBox>
<Checkbox
checked={advancedCronCheck}
onChange={(event) => setAdvancedCronCheck(event.target.checked)}
/>
</AdvancedSchedule>
</Schedule>
<CronText>
{cronAsText.error && <>Invalid cron schedule. Cron must be of UNIX form:</>}
{!cronAsText.text && (
Expand All @@ -183,14 +201,15 @@ export const CreateScheduleStep = ({ state, updateState, goTo, prev }: StepProps
<ItemDescriptionText>Choose a timezone for the schedule.</ItemDescriptionText>
<TimezoneSelect value={scheduleTimezone} onChange={setScheduleTimezone} />
</Form.Item>
</Form>
</RequiredFieldForm>
<ControlsContainer>
<Button onClick={prev}>Previous</Button>
<div>
<Button
data-testid="ingestion-schedule-next-button"
disabled={!interval || interval.length === 0 || cronAsText.error}
onClick={onClickNext}
type="primary"
>
Next
</Button>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import React from 'react';
import { Button, Image } from 'antd';
import styled from 'styled-components';

import { REDESIGN_COLORS } from '../../../entity/shared/constants';

const Container = styled(Button)`
padding: 32px;
height: 200px;
display: flex;
justify-content: center;
border-radius: 8px;
align-items: start;
flex-direction: column;
border: 1px solid #e0e0e0;
background-color: #ffffff;
&&:hover {
border: 1px solid ${REDESIGN_COLORS.BLUE};
background-color: #ffffff;
}
white-space: unset;
`;

const PlatformLogo = styled(Image)`
max-height: 32px;
height: 32px;
width: auto;
object-fit: contain;
background-color: transparent;
`;

const LogoContainer = styled.div`
margin-bottom: 14px;
`;

const Title = styled.div`
word-break: break-word;
color: #464646;
font-weight: bold;
font-size: 16px;
margin-bottom: 8px;
`;

const Description = styled.div`
word-break: break-word;
text-align: left;
color: #7c7c7c;
`;

type Props = {
logoUrl?: string;
logoComponent?: React.ReactNode;
name: string;
description?: string;
onClick?: () => void;
};

export const DataPlatformCard = ({ logoUrl, logoComponent, name, description, onClick }: Props) => {
return (
<Container type="link" onClick={onClick}>
<LogoContainer>
{(logoUrl && <PlatformLogo preview={false} src={logoUrl} alt={name} />) || logoComponent}
</LogoContainer>
<Title>{name}</Title>
<Description>{description}</Description>
</Container>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const DefineRecipeStep = ({ state, updateState, goTo, prev, ingestionSour
<Button disabled={isEditing} onClick={prev}>
Previous
</Button>
<Button disabled={!stepComplete} onClick={onClickNext}>
<Button type="primary" disabled={!stepComplete} onClick={onClickNext}>
Next
</Button>
</ControlsContainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import React from 'react';
import styled from 'styled-components';
import { Button, Tooltip } from 'antd';
import { CloseOutlined } from '@ant-design/icons';

import { SourceConfig } from './types';
import { ANTD_GRAY } from '../../../entity/shared/constants';

const Container = styled.div`
background-color: #ffffff;
border-radius: 8px;
padding: 12px 12px 16px 24px;
border: 1px solid #e0e0e0;
margin-bottom: 20px;
`;

const Header = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
`;

const Title = styled.div`
font-size: 16px;
font-weight: bold;
`;

const Description = styled.div`
font-size: 14px;
max-width: 90%;
`;

const StyledCloseOutlined = styled(CloseOutlined)`
color: ${ANTD_GRAY[6]};
`;

interface Props {
sourceConfigs: SourceConfig;
onHide: () => void;
}

export const IngestionDocumentationHint = ({ sourceConfigs, onHide }: Props) => {
const { displayName, docsUrl } = sourceConfigs;
return (
<Container>
<Header>
<Title>Let&apos;s get connected! 🎉</Title>
<Tooltip showArrow={false} title="Hide">
<Button type="text" icon={<StyledCloseOutlined />} onClick={onHide} />
</Tooltip>
</Header>
<Description>
<div style={{ marginBottom: 8 }}>
To import from {displayName}, we&apos;ll need some more information to connect to your instance.
</div>
<div>
Check out the{' '}
<a href={docsUrl} target="_blank" rel="noopener noreferrer">
{displayName} Guide
</a>{' '}
to understand the prerequisites, learn about available settings, and view examples to help connect
to the data source.
</div>
</Description>
</Container>
);
};
Loading

0 comments on commit cf0f45b

Please sign in to comment.