Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deprecation) Return actor entity with deprecation aspect #10832

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import com.linkedin.datahub.graphql.generated.DataQualityContract;
import com.linkedin.datahub.graphql.generated.Dataset;
import com.linkedin.datahub.graphql.generated.DatasetStatsSummary;
import com.linkedin.datahub.graphql.generated.Deprecation;
import com.linkedin.datahub.graphql.generated.Domain;
import com.linkedin.datahub.graphql.generated.ERModelRelationship;
import com.linkedin.datahub.graphql.generated.ERModelRelationshipProperties;
Expand Down Expand Up @@ -785,6 +786,7 @@ public void configureRuntimeWiring(final RuntimeWiring.Builder builder) {
configureBusinessAttributeResolver(builder);
configureBusinessAttributeAssociationResolver(builder);
configureConnectionResolvers(builder);
configureDeprecationResolvers(builder);
}

private void configureOrganisationRoleResolvers(RuntimeWiring.Builder builder) {
Expand Down Expand Up @@ -3150,4 +3152,14 @@ private void configureConnectionResolvers(final RuntimeWiring.Builder builder) {
: null;
})));
}

private void configureDeprecationResolvers(final RuntimeWiring.Builder builder) {
builder.type(
"Deprecation",
typeWiring ->
typeWiring.dataFetcher(
"actorEntity",
new EntityTypeResolver(
entityTypes, (env) -> ((Deprecation) env.getSource()).getActorEntity())));
}
Comment on lines +3156 to +3164
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Method configureDeprecationResolvers is not invoked in configureRuntimeWiring.

The configureDeprecationResolvers method is not being called within the configureRuntimeWiring method, which means the deprecation resolvers are not being configured as intended.

  • Ensure that configureDeprecationResolvers is invoked within the configureRuntimeWiring method.
Analysis chain

LGTM! Verify the method invocation.

The code changes are approved.

However, ensure that the configureDeprecationResolvers method is correctly invoked in the configureRuntimeWiring method.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the `configureDeprecationResolvers` method is correctly invoked in the `configureRuntimeWiring` method.

# Test: Search for the method invocation. Expect: The method is invoked.
rg --type java $'configureDeprecationResolvers'

Length of output: 346



Script:

#!/bin/bash
# Description: Verify the context of the `configureDeprecationResolvers` method invocation within the `configureRuntimeWiring` method.

# Test: Search for the `configureRuntimeWiring` method and its content.
rg --type java 'void configureRuntimeWiring' -A 20

Length of output: 2792



Script:

#!/bin/bash
# Description: Verify the context of the `configureDeprecationResolvers` method invocation within the `configureRuntimeWiring` method.

# Test: Search for the `configureRuntimeWiring` method and its content, extending the search to capture more lines.
rg --type java 'void configureRuntimeWiring' -A 40

Length of output: 5426

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public Deprecation apply(
@Nullable QueryContext context, @Nonnull final com.linkedin.common.Deprecation input) {
final Deprecation result = new Deprecation();
result.setActor(input.getActor().toString());
result.setActorEntity(UrnToEntityMapper.map(context, input.getActor()));
result.setDeprecated(input.isDeprecated());
result.setDecommissionTime(input.getDecommissionTime());
result.setNote(input.getNote());
Expand Down
5 changes: 5 additions & 0 deletions datahub-graphql-core/src/main/resources/entity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8183,6 +8183,11 @@ type Deprecation {
The user who will be credited for modifying this deprecation content
"""
actor: String

"""
The hydrated user who will be credited for modifying this deprecation content
"""
actorEntity: Entity
}

"""
Expand Down
Loading