Skip to content

Commit 5444c2b

Browse files
feat(ingestion): fixes part 1
1 parent 353896c commit 5444c2b

File tree

29 files changed

+376
-366
lines changed

29 files changed

+376
-366
lines changed

datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,11 +1302,9 @@ private void configureMutationResolvers(final RuntimeWiring.Builder builder) {
13021302
"revokeAccessToken",
13031303
new RevokeAccessTokenResolver(this.entityClient, this.statefulTokenService))
13041304
.dataFetcher(
1305-
"createIngestionSource",
1306-
new UpsertIngestionSourceResolver(this.entityClient, this.entityService))
1305+
"createIngestionSource", new UpsertIngestionSourceResolver(this.entityClient))
13071306
.dataFetcher(
1308-
"updateIngestionSource",
1309-
new UpsertIngestionSourceResolver(this.entityClient, this.entityService))
1307+
"updateIngestionSource", new UpsertIngestionSourceResolver(this.entityClient))
13101308
.dataFetcher(
13111309
"deleteIngestionSource", new DeleteIngestionSourceResolver(this.entityClient))
13121310
.dataFetcher(

datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/resolvers/ingest/source/UpsertIngestionSourceResolver.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,17 @@
1111
import com.linkedin.datahub.graphql.exception.AuthorizationException;
1212
import com.linkedin.datahub.graphql.exception.DataHubGraphQLErrorCode;
1313
import com.linkedin.datahub.graphql.exception.DataHubGraphQLException;
14-
import com.linkedin.datahub.graphql.generated.OwnerEntityType;
1514
import com.linkedin.datahub.graphql.generated.StringMapEntryInput;
1615
import com.linkedin.datahub.graphql.generated.UpdateIngestionSourceConfigInput;
1716
import com.linkedin.datahub.graphql.generated.UpdateIngestionSourceInput;
1817
import com.linkedin.datahub.graphql.generated.UpdateIngestionSourceScheduleInput;
1918
import com.linkedin.datahub.graphql.resolvers.ingest.IngestionAuthUtils;
20-
import com.linkedin.datahub.graphql.resolvers.mutate.util.OwnerUtils;
2119
import com.linkedin.entity.client.EntityClient;
2220
import com.linkedin.ingestion.DataHubIngestionSourceConfig;
2321
import com.linkedin.ingestion.DataHubIngestionSourceInfo;
2422
import com.linkedin.ingestion.DataHubIngestionSourceSchedule;
2523
import com.linkedin.ingestion.DataHubIngestionSourceSource;
2624
import com.linkedin.ingestion.DataHubIngestionSourceSourceType;
27-
import com.linkedin.metadata.entity.EntityService;
2825
import com.linkedin.metadata.key.DataHubIngestionSourceKey;
2926
import com.linkedin.mxe.MetadataChangeProposal;
3027
import graphql.schema.DataFetcher;
@@ -46,12 +43,9 @@
4643
public class UpsertIngestionSourceResolver implements DataFetcher<CompletableFuture<String>> {
4744

4845
private final EntityClient _entityClient;
49-
private final EntityService<?> _entityService;
5046

51-
public UpsertIngestionSourceResolver(
52-
final EntityClient entityClient, final EntityService<?> entityService) {
47+
public UpsertIngestionSourceResolver(final EntityClient entityClient) {
5348
_entityClient = entityClient;
54-
_entityService = entityService;
5549
}
5650

5751
@Override
@@ -95,15 +89,7 @@ public CompletableFuture<String> get(final DataFetchingEnvironment environment)
9589
return GraphQLConcurrencyUtils.supplyAsync(
9690
() -> {
9791
try {
98-
String urn =
99-
_entityClient.ingestProposal(context.getOperationContext(), proposal, false);
100-
101-
if (!ingestionSourceUrn.isPresent()) {
102-
OwnerUtils.addCreatorAsOwner(context, urn, OwnerEntityType.CORP_USER, _entityService);
103-
}
104-
105-
return urn;
106-
92+
return _entityClient.ingestProposal(context.getOperationContext(), proposal, false);
10793
} catch (Exception e) {
10894
throw new RuntimeException(
10995
String.format(

datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/ingest/secret/CreateSecretResolverTest.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.linkedin.datahub.graphql.resolvers.ingest.secret;
22

3-
import static com.linkedin.datahub.graphql.TestUtils.getMockEntityService;
43
import static com.linkedin.datahub.graphql.resolvers.ingest.IngestTestUtils.*;
54
import static org.mockito.ArgumentMatchers.any;
65
import static org.mockito.ArgumentMatchers.anyBoolean;
@@ -14,7 +13,6 @@
1413
import com.linkedin.entity.client.EntityClient;
1514
import com.linkedin.events.metadata.ChangeType;
1615
import com.linkedin.metadata.Constants;
17-
import com.linkedin.metadata.entity.EntityService;
1816
import com.linkedin.metadata.key.DataHubSecretKey;
1917
import com.linkedin.metadata.utils.GenericRecordUtils;
2018
import com.linkedin.mxe.MetadataChangeProposal;
@@ -77,9 +75,7 @@ public void testGetSuccess() throws Exception {
7775
public void testGetUnauthorized() throws Exception {
7876
// Create resolver
7977
EntityClient mockClient = Mockito.mock(EntityClient.class);
80-
EntityService<?> mockService = getMockEntityService();
81-
UpsertIngestionSourceResolver resolver =
82-
new UpsertIngestionSourceResolver(mockClient, mockService);
78+
UpsertIngestionSourceResolver resolver = new UpsertIngestionSourceResolver(mockClient);
8379

8480
// Execute resolver
8581
DataFetchingEnvironment mockEnv = Mockito.mock(DataFetchingEnvironment.class);
@@ -95,12 +91,10 @@ public void testGetUnauthorized() throws Exception {
9591
public void testGetEntityClientException() throws Exception {
9692
// Create resolver
9793
EntityClient mockClient = Mockito.mock(EntityClient.class);
98-
EntityService<?> mockService = getMockEntityService();
9994
Mockito.doThrow(RemoteInvocationException.class)
10095
.when(mockClient)
10196
.ingestProposal(any(), Mockito.any(), anyBoolean());
102-
UpsertIngestionSourceResolver resolver =
103-
new UpsertIngestionSourceResolver(mockClient, mockService);
97+
UpsertIngestionSourceResolver resolver = new UpsertIngestionSourceResolver(mockClient);
10498

10599
// Execute resolver
106100
DataFetchingEnvironment mockEnv = Mockito.mock(DataFetchingEnvironment.class);

datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/ingest/source/UpsertIngestionSourceResolverTest.java

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.linkedin.datahub.graphql.resolvers.ingest.source;
22

3-
import static com.linkedin.datahub.graphql.TestUtils.getMockEntityService;
43
import static com.linkedin.datahub.graphql.TestUtils.verifyIngestProposal;
54
import static com.linkedin.datahub.graphql.resolvers.ingest.IngestTestUtils.*;
65
import static com.linkedin.metadata.Constants.*;
@@ -18,7 +17,6 @@
1817
import com.linkedin.ingestion.DataHubIngestionSourceConfig;
1918
import com.linkedin.ingestion.DataHubIngestionSourceInfo;
2019
import com.linkedin.ingestion.DataHubIngestionSourceSchedule;
21-
import com.linkedin.metadata.entity.EntityService;
2220
import com.linkedin.r2.RemoteInvocationException;
2321
import graphql.schema.DataFetchingEnvironment;
2422
import org.mockito.Mockito;
@@ -43,9 +41,7 @@ private static UpdateIngestionSourceInput makeInput() {
4341
public void testGetSuccess() throws Exception {
4442
// Create resolver
4543
EntityClient mockClient = Mockito.mock(EntityClient.class);
46-
EntityService<?> mockService = getMockEntityService();
47-
UpsertIngestionSourceResolver resolver =
48-
new UpsertIngestionSourceResolver(mockClient, mockService);
44+
UpsertIngestionSourceResolver resolver = new UpsertIngestionSourceResolver(mockClient);
4945

5046
// Execute resolver
5147
QueryContext mockContext = getMockAllowContext();
@@ -83,9 +79,7 @@ public void testGetSuccess() throws Exception {
8379
public void testGetUnauthorized() throws Exception {
8480
// Create resolver
8581
EntityClient mockClient = Mockito.mock(EntityClient.class);
86-
EntityService<?> mockService = getMockEntityService();
87-
UpsertIngestionSourceResolver resolver =
88-
new UpsertIngestionSourceResolver(mockClient, mockService);
82+
UpsertIngestionSourceResolver resolver = new UpsertIngestionSourceResolver(mockClient);
8983

9084
// Execute resolver
9185
DataFetchingEnvironment mockEnv = Mockito.mock(DataFetchingEnvironment.class);
@@ -101,12 +95,10 @@ public void testGetUnauthorized() throws Exception {
10195
public void testGetEntityClientException() throws Exception {
10296
// Create resolver
10397
EntityClient mockClient = Mockito.mock(EntityClient.class);
104-
EntityService<?> mockService = getMockEntityService();
10598
Mockito.doThrow(RemoteInvocationException.class)
10699
.when(mockClient)
107100
.ingestProposal(any(), any(), Mockito.eq(false));
108-
UpsertIngestionSourceResolver resolver =
109-
new UpsertIngestionSourceResolver(mockClient, mockService);
101+
UpsertIngestionSourceResolver resolver = new UpsertIngestionSourceResolver(mockClient);
110102

111103
// Execute resolver
112104
DataFetchingEnvironment mockEnv = Mockito.mock(DataFetchingEnvironment.class);
@@ -124,9 +116,7 @@ public void testUpsertWithInvalidCron() throws Exception {
124116

125117
// Create resolver
126118
EntityClient mockClient = Mockito.mock(EntityClient.class);
127-
EntityService<?> mockService = getMockEntityService();
128-
UpsertIngestionSourceResolver resolver =
129-
new UpsertIngestionSourceResolver(mockClient, mockService);
119+
UpsertIngestionSourceResolver resolver = new UpsertIngestionSourceResolver(mockClient);
130120

131121
// Execute resolver
132122
QueryContext mockContext = getMockAllowContext();
@@ -151,9 +141,7 @@ public void testUpsertWithInvalidTimezone() throws Exception {
151141

152142
// Create resolver
153143
EntityClient mockClient = Mockito.mock(EntityClient.class);
154-
EntityService<?> mockService = getMockEntityService();
155-
UpsertIngestionSourceResolver resolver =
156-
new UpsertIngestionSourceResolver(mockClient, mockService);
144+
UpsertIngestionSourceResolver resolver = new UpsertIngestionSourceResolver(mockClient);
157145

158146
// Execute resolver
159147
QueryContext mockContext = getMockAllowContext();

datahub-web-react/src/alchemy-components/components/Checkbox/NativeCheckbox.test.tsx

Lines changed: 0 additions & 71 deletions
This file was deleted.

datahub-web-react/src/alchemy-components/components/Checkbox/NativeCheckbox.tsx

Lines changed: 0 additions & 121 deletions
This file was deleted.

datahub-web-react/src/alchemy-components/components/Tabs/Tabs.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ export interface Props {
234234
tabs: Tab[];
235235
selectedTab?: string;
236236
onChange?: (selectedTabKey: string) => void;
237+
onTabClick?: (activeKey: string, e: React.KeyboardEvent | React.MouseEvent) => void;
237238
urlMap?: Record<string, string>;
238239
onUrlChange?: (url: string) => void;
239240
defaultTab?: string;
@@ -256,6 +257,7 @@ export function Tabs({
256257
tabs,
257258
selectedTab,
258259
onChange,
260+
onTabClick,
259261
urlMap,
260262
onUrlChange = (url) => window.history.replaceState({}, '', url),
261263
defaultTab,
@@ -325,6 +327,7 @@ export function Tabs({
325327
onUrlChange(urlMap[key]);
326328
}
327329
}}
330+
onTabClick={onTabClick}
328331
destroyInactiveTabPane={destroyInactiveTabPane}
329332
$navMarginBottom={styleOptions?.navMarginBottom}
330333
$navMarginTop={styleOptions?.navMarginTop}

0 commit comments

Comments
 (0)