Skip to content

Commit

Permalink
Merge branch 'master' into test-case-urn-1
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored Mar 22, 2024
2 parents f19e7b2 + 8cb65bd commit c8b28b5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/actions/ci-optimization/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ runs:
- "metadata-jobs/**"
- "metadata-service/**"
- "metadata-utils/**"
- "datahub-graphql-core/**"
- "smoke-test/**"
- "docker/**"
kafka-setup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,11 +1183,12 @@ private void configureMutationResolvers(final RuntimeWiring.Builder builder) {
new DeleteGlossaryEntityResolver(this.entityClient, this.entityService))
.dataFetcher(
"updateName", new UpdateNameResolver(this.entityService, this.entityClient))
.dataFetcher("addRelatedTerms", new AddRelatedTermsResolver(this.entityService,
this.entityClient))
.dataFetcher(
"removeRelatedTerms", new RemoveRelatedTermsResolver(this.entityService,
this.entityClient))
"addRelatedTerms",
new AddRelatedTermsResolver(this.entityService, this.entityClient))
.dataFetcher(
"removeRelatedTerms",
new RemoveRelatedTermsResolver(this.entityService, this.entityClient))
.dataFetcher(
"createNativeUserResetToken",
new CreateNativeUserResetTokenResolver(this.nativeUserService))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public CompletableFuture<Boolean> get(DataFetchingEnvironment environment) throw
if (GlossaryUtils.canManageChildrenEntities(context, parentUrn, _entityClient)) {
try {
final TermRelationshipType relationshipType = input.getRelationshipType();
final Urn urn = Urn.createFromString(input.getUrn());
final List<Urn> termUrns =
input.getTermUrns().stream().map(UrnUtils::getUrn).collect(Collectors.toList());
validateRelatedTermsInput(urn, termUrns);
Expand Down
6 changes: 5 additions & 1 deletion datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ export class DatasetEntity implements Entity<Dataset> {
component: AccessManagement,
display: {
visible: (_, _1) => this.appconfig().config.featureFlags.showAccessManagement,
enabled: (_, _2) => true,
enabled: (_, dataset: GetDatasetQuery) => {
const accessAspect = dataset?.dataset?.access;
const rolesList = accessAspect?.roles;
return !!accessAspect && !!rolesList && rolesList.length > 0;
},
},
},
{
Expand Down
7 changes: 7 additions & 0 deletions datahub-web-react/src/graphql/dataset.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ fragment nonSiblingDatasetFields on Dataset {
assertions(start: 0, count: 1) {
total
}
access {
roles {
role {
urn
}
}
}
operations(limit: 1) {
timestampMillis
lastUpdatedTimestamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull;
Expand Down Expand Up @@ -193,12 +192,14 @@ private void submitMetrics(ExecutionResult executionResult) {
// Extract top level resolver, parent is top level query. Assumes single query per call.
List<Map<String, Object>> resolvers =
(List<Map<String, Object>>) executionData.get("resolvers");
Optional<Map<String, Object>> parentResolver =
resolvers.stream()
.filter(resolver -> resolver.get("parentType").equals("Query"))
.findFirst();
String fieldName =
parentResolver.isPresent() ? (String) parentResolver.get().get("fieldName") : "UNKNOWN";
resolvers.stream()
.filter(
resolver -> List.of("Query", "Mutation").contains(resolver.get("parentType")))
.findFirst()
.map(parentResolver -> parentResolver.get("fieldName"))
.map(Object::toString)
.orElse("UNKNOWN");
MetricUtils.get()
.histogram(MetricRegistry.name(this.getClass(), fieldName))
.update(totalDuration);
Expand Down

0 comments on commit c8b28b5

Please sign in to comment.