diff --git a/hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/request/AttributeRequest.java b/hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/request/AttributeRequest.java index 64458fc9..0f1c61e1 100644 --- a/hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/request/AttributeRequest.java +++ b/hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/request/AttributeRequest.java @@ -3,9 +3,9 @@ import org.hypertrace.core.graphql.common.schema.attributes.arguments.AttributeExpression; public interface AttributeRequest { - AttributeAssociation attributeExpression(); + AttributeAssociation attributeExpressionAssociation(); default String asMapKey() { - return attributeExpression().value().asAlias(); + return attributeExpressionAssociation().value().asAlias(); } } diff --git a/hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/request/DefaultAttributeRequestBuilder.java b/hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/request/DefaultAttributeRequestBuilder.java index ed27e43b..f956ec1a 100644 --- a/hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/request/DefaultAttributeRequestBuilder.java +++ b/hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/request/DefaultAttributeRequestBuilder.java @@ -117,6 +117,6 @@ private Stream resolveAttributeExpression(SelectedField att @Value @Accessors(fluent = true) static class DefaultAttributeRequest implements AttributeRequest { - AttributeAssociation attributeExpression; + AttributeAssociation attributeExpressionAssociation; } } diff --git a/hypertrace-core-graphql-common-schema/src/test/java/org/hypertrace/core/graphql/common/request/DefaultAttributeRequestBuilderTest.java b/hypertrace-core-graphql-common-schema/src/test/java/org/hypertrace/core/graphql/common/request/DefaultAttributeRequestBuilderTest.java index 3026aaf9..034460b9 100644 --- a/hypertrace-core-graphql-common-schema/src/test/java/org/hypertrace/core/graphql/common/request/DefaultAttributeRequestBuilderTest.java +++ b/hypertrace-core-graphql-common-schema/src/test/java/org/hypertrace/core/graphql/common/request/DefaultAttributeRequestBuilderTest.java @@ -70,6 +70,6 @@ void canBuildRequestForSelectionSet() { .blockingGet(); assertEquals(1, returned.size()); - assertEquals(expectedResultExpression, returned.get(0).attributeExpression()); + assertEquals(expectedResultExpression, returned.get(0).attributeExpressionAssociation()); } } diff --git a/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/AttributeExpressionConverter.java b/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/AttributeExpressionConverter.java index 14cff9a1..2f26f46e 100644 --- a/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/AttributeExpressionConverter.java +++ b/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/AttributeExpressionConverter.java @@ -11,11 +11,12 @@ class AttributeExpressionConverter implements Converter, Expression> { @Override - public Single convert(AttributeAssociation attributeExpression) { + public Single convert( + AttributeAssociation attributeExpressionAssociation) { Builder builder = org.hypertrace.gateway.service.v1.common.AttributeExpression.newBuilder(); - builder.setAttributeId(attributeExpression.attribute().id()); - attributeExpression.value().subpath().ifPresent(builder::setSubpath); - builder.setAlias(attributeExpression.value().asAlias()); + builder.setAttributeId(attributeExpressionAssociation.attribute().id()); + attributeExpressionAssociation.value().subpath().ifPresent(builder::setSubpath); + builder.setAlias(attributeExpressionAssociation.value().asAlias()); return Single.just(Expression.newBuilder().setAttributeExpression(builder).build()); } } diff --git a/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/AttributeMapConverter.java b/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/AttributeMapConverter.java index 8cd41c2a..12167d68 100644 --- a/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/AttributeMapConverter.java +++ b/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/AttributeMapConverter.java @@ -41,9 +41,10 @@ private Single> buildAttributeMapEntry( return this.valueConverter .convert( response.get(attributeRequest.asMapKey()), - attributeRequest.attributeExpression().attribute()) + attributeRequest.attributeExpressionAssociation().attribute()) .map( value -> - new SimpleImmutableEntry<>(attributeRequest.attributeExpression().value(), value)); + new SimpleImmutableEntry<>( + attributeRequest.attributeExpressionAssociation().value(), value)); } } diff --git a/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/SelectionExpressionSetConverter.java b/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/SelectionExpressionSetConverter.java index bc9a8644..aadd4f8a 100644 --- a/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/SelectionExpressionSetConverter.java +++ b/hypertrace-core-graphql-gateway-service-utils/src/main/java/org/hypertrace/core/graphql/utils/gateway/SelectionExpressionSetConverter.java @@ -31,7 +31,7 @@ public Single> convert(Collection attributeReq private Single buildAliasedSelectionExpression(AttributeRequest attributeRequest) { return this.attributeExpressionConverter - .convert(attributeRequest.attributeExpression()) + .convert(attributeRequest.attributeExpressionAssociation()) .map(Expression::toBuilder) .map(Builder::build); } diff --git a/hypertrace-core-graphql-log-event-schema/src/test/java/org/hypertrace/core/graphql/log/event/dao/BaseDaoTest.java b/hypertrace-core-graphql-log-event-schema/src/test/java/org/hypertrace/core/graphql/log/event/dao/BaseDaoTest.java index 04c02b8c..8160e7eb 100644 --- a/hypertrace-core-graphql-log-event-schema/src/test/java/org/hypertrace/core/graphql/log/event/dao/BaseDaoTest.java +++ b/hypertrace-core-graphql-log-event-schema/src/test/java/org/hypertrace/core/graphql/log/event/dao/BaseDaoTest.java @@ -36,7 +36,7 @@ static class DefaultLogEventRequest implements LogEventRequest { @Value @Accessors(fluent = true) static class DefaultAttributeRequest implements AttributeRequest { - AttributeAssociation attributeExpression; + AttributeAssociation attributeExpressionAssociation; } @Value diff --git a/hypertrace-core-graphql-platform/build.gradle.kts b/hypertrace-core-graphql-platform/build.gradle.kts index e53fb0ae..0a801738 100644 --- a/hypertrace-core-graphql-platform/build.gradle.kts +++ b/hypertrace-core-graphql-platform/build.gradle.kts @@ -16,7 +16,10 @@ dependencies { api("io.github.graphql-java:graphql-java-annotations:8.3") api("org.slf4j:slf4j-api:1.7.30") api("io.reactivex.rxjava3:rxjava:3.0.9") - api("com.google.protobuf:protobuf-java-util:3.14.0") + api("com.google.protobuf:protobuf-java-util:3.19.2") + api("com.google.protobuf:protobuf-java:3.19.2") { + because("https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEPROTOBUF-2331703") + } api("org.projectlombok:lombok:1.18.18") api("com.google.code.findbugs:jsr305:3.0.2") diff --git a/hypertrace-core-graphql-span-schema/src/main/java/org/hypertrace/core/graphql/span/dao/GatewayServiceSpanConverter.java b/hypertrace-core-graphql-span-schema/src/main/java/org/hypertrace/core/graphql/span/dao/GatewayServiceSpanConverter.java index 64587153..e1d96932 100644 --- a/hypertrace-core-graphql-span-schema/src/main/java/org/hypertrace/core/graphql/span/dao/GatewayServiceSpanConverter.java +++ b/hypertrace-core-graphql-span-schema/src/main/java/org/hypertrace/core/graphql/span/dao/GatewayServiceSpanConverter.java @@ -51,7 +51,11 @@ private Single convert( new ConvertedSpan( attrMap .get( - request.spanEventsRequest().idAttribute().attributeExpression().value()) + request + .spanEventsRequest() + .idAttribute() + .attributeExpressionAssociation() + .value()) .toString(), attrMap, spanIdToLogEvents)); diff --git a/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/DaoTestUtil.java b/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/DaoTestUtil.java index e793d0bd..a4f100a0 100644 --- a/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/DaoTestUtil.java +++ b/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/DaoTestUtil.java @@ -35,7 +35,7 @@ class DaoTestUtil { @Value @Accessors(fluent = true) static class DefaultAttributeRequest implements AttributeRequest { - AttributeAssociation attributeExpression; + AttributeAssociation attributeExpressionAssociation; } @Value diff --git a/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/SpanLogEventRequestBuilderTest.java b/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/SpanLogEventRequestBuilderTest.java index a7140512..ffa5fba0 100644 --- a/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/SpanLogEventRequestBuilderTest.java +++ b/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/SpanLogEventRequestBuilderTest.java @@ -109,10 +109,10 @@ protected void configure() { return Single.just( List.of( AttributeAssociation.of( - spanIdAttribute.attributeExpression().attribute(), + spanIdAttribute.attributeExpressionAssociation().attribute(), new NormalizedFilter( AttributeExpression.forAttributeKey( - spanIdAttribute.attributeExpression().value().key()), + spanIdAttribute.attributeExpressionAssociation().value().key()), filterArgument.operator(), filterArgument.value())))); }) @@ -120,7 +120,7 @@ protected void configure() { .build(any(), any(), anyCollection()); when(attributeStore.getForeignIdAttribute(any(), anyString(), anyString())) - .thenReturn(Single.just(spanIdAttribute.attributeExpression().attribute())); + .thenReturn(Single.just(spanIdAttribute.attributeExpressionAssociation().attribute())); doAnswer( invocation -> { diff --git a/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/SpanLogEventResponseConverterTest.java b/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/SpanLogEventResponseConverterTest.java index d1cf3c62..6d8211bc 100644 --- a/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/SpanLogEventResponseConverterTest.java +++ b/hypertrace-core-graphql-span-schema/src/test/java/org/hypertrace/core/graphql/span/dao/SpanLogEventResponseConverterTest.java @@ -58,9 +58,9 @@ void testBuildResponse() { List.of(spanIdAttribute, traceIdAttribute, attributesAttribute); when(attributeStore.getForeignIdAttribute(any(), anyString(), anyString())) - .thenReturn(Single.just(spanIdAttribute.attributeExpression().attribute())); + .thenReturn(Single.just(spanIdAttribute.attributeExpressionAssociation().attribute())); when(attributeRequestBuilder.buildForAttribute( - spanIdAttribute.attributeExpression().attribute())) + spanIdAttribute.attributeExpressionAssociation().attribute())) .thenReturn(spanIdAttribute); doAnswer( @@ -91,9 +91,9 @@ void testBuildResponse_spanIdNotRequested() { Collection attributeRequests = List.of(traceIdAttribute, attributesAttribute); when(attributeStore.getForeignIdAttribute(any(), anyString(), anyString())) - .thenReturn(Single.just(spanIdAttribute.attributeExpression().attribute())); + .thenReturn(Single.just(spanIdAttribute.attributeExpressionAssociation().attribute())); when(attributeRequestBuilder.buildForAttribute( - spanIdAttribute.attributeExpression().attribute())) + spanIdAttribute.attributeExpressionAssociation().attribute())) .thenReturn(spanIdAttribute); doAnswer( diff --git a/hypertrace-core-graphql-trace-schema/src/main/java/org/hypertrace/core/graphql/trace/dao/GatewayServiceTraceConverter.java b/hypertrace-core-graphql-trace-schema/src/main/java/org/hypertrace/core/graphql/trace/dao/GatewayServiceTraceConverter.java index 181f2904..263e481a 100644 --- a/hypertrace-core-graphql-trace-schema/src/main/java/org/hypertrace/core/graphql/trace/dao/GatewayServiceTraceConverter.java +++ b/hypertrace-core-graphql-trace-schema/src/main/java/org/hypertrace/core/graphql/trace/dao/GatewayServiceTraceConverter.java @@ -45,7 +45,9 @@ private Single convert( .map( attrMap -> new ConvertedTrace( - attrMap.get(request.idAttribute().attributeExpression().value()).toString(), + attrMap + .get(request.idAttribute().attributeExpressionAssociation().value()) + .toString(), attrMap)); }