Skip to content

Commit 1e61587

Browse files
BrandonArpdependabot[bot]claude
authored
Fix failing Dependabot update tests (#571)
* Bump io.netty:netty-codec-http from 4.2.6.Final to 4.2.7.Final Bumps [io.netty:netty-codec-http](https://github.com/netty/netty) from 4.2.6.Final to 4.2.7.Final. - [Commits](netty/netty@netty-4.2.6.Final...netty-4.2.7.Final) --- updated-dependencies: - dependency-name: io.netty:netty-codec-http dependency-version: 4.2.7.Final dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Fix Netty 4.2.7 compatibility by using string literals for HTTP headers Replace Netty HttpHeaderNames and HttpHeaderValues constants with plain string literals to avoid compatibility issues with Netty 4.2.7.Final. Changes: - Replace HttpHeaderNames.CONTENT_TYPE with "Content-Type" - Replace HttpHeaderNames.CONTENT_ENCODING with "Content-Encoding" - Replace HttpHeaderValues.GZIP with "gzip" - Remove unused Netty header imports This avoids any potential incompatibilities between AsyncHttpClient 3.0.3 and Netty 4.2.7's header constant implementations. * Add Netty BOM to dependency management to resolve version conflicts AsyncHttpClient 3.0.3 brings in various Netty 4.2 modules transitively, but the project also has old Netty 4.0.x versions defined (netty.version and netty.all.version). This version mismatch was causing runtime failures where no HTTP requests were being sent. By adding the Netty BOM (Bill of Materials) to dependencyManagement, all Netty modules across the project will be forced to use version 4.2.7.Final consistently, preventing classpath conflicts. This should resolve the test failures in KairosDbSinkTest where requests were not being sent to the mock server. * Remove unused netty-codec-http dependency Since we replaced all Netty header constants with string literals, the explicit netty-codec-http dependency is no longer directly used. AsyncHttpClient brings in the required Netty dependencies transitively, and the Netty BOM in dependencyManagement ensures they're all at version 4.2.7.Final. This resolves the Maven dependency analyzer warning about unused declared dependencies. * Consolidate Netty version properties to use netty.version Replaced the netty.codec.http.version property with the standard netty.version property, updating it from 4.0.56.Final to 4.2.7.Final. This makes the versioning clearer - netty.version is now the single source of truth for the Netty version used throughout the project, applied via the Netty BOM in dependencyManagement. --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude <[email protected]>
1 parent 159ec65 commit 1e61587

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

pom.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,8 @@
138138
<metrics.http.extra.version>0.14.1</metrics.http.extra.version>
139139
<metrics.aggregator.protocol.version>1.3.1</metrics.aggregator.protocol.version>
140140
<mockito.version>5.20.0</mockito.version>
141-
<netty.version>4.0.56.Final</netty.version>
141+
<netty.version>4.2.7.Final</netty.version>
142142
<netty.all.version>4.0.21.Final</netty.all.version>
143-
<netty.codec.http.version>4.2.6.Final</netty.codec.http.version>
144143
<ning.http.client.version>1.9.31</ning.http.client.version>
145144
<oval.version>3.2.1</oval.version>
146145
<play.ws.version>3.0.9</play.ws.version>
@@ -860,11 +859,6 @@
860859
<artifactId>async-http-client</artifactId>
861860
<version>${asynchttpclient.version}</version>
862861
</dependency>
863-
<dependency>
864-
<groupId>io.netty</groupId>
865-
<artifactId>netty-codec-http</artifactId>
866-
<version>${netty.codec.http.version}</version>
867-
</dependency>
868862
<dependency>
869863
<groupId>org.playframework</groupId>
870864
<artifactId>play-ahc-ws-standalone_${scala.version}</artifactId>
@@ -976,6 +970,13 @@
976970
<scope>import</scope>
977971
<type>pom</type>
978972
</dependency>
973+
<dependency>
974+
<groupId>io.netty</groupId>
975+
<artifactId>netty-bom</artifactId>
976+
<version>${netty.version}</version>
977+
<scope>import</scope>
978+
<type>pom</type>
979+
</dependency>
979980
</dependencies>
980981
</dependencyManagement>
981982
<profiles>

src/main/java/com/arpnetworking/tsdcore/sinks/HttpPostSink.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import com.fasterxml.jackson.annotation.JacksonInject;
2626
import com.google.common.collect.ImmutableSet;
2727
import com.google.common.collect.Lists;
28-
import io.netty.handler.codec.http.HttpHeaderNames;
29-
import io.netty.handler.codec.http.HttpHeaderValues;
3028
import net.sf.oval.Validator;
3129
import net.sf.oval.constraint.CheckWith;
3230
import net.sf.oval.constraint.CheckWithCheck;
@@ -127,12 +125,12 @@ protected RequestInfo createRequest(final AsyncHttpClient client, final byte[] s
127125

128126
final RequestBuilder requestBuilder = new RequestBuilder()
129127
.setUri(getAysncHttpClientUri())
130-
.setHeader(HttpHeaderNames.CONTENT_TYPE, MediaTypes.APPLICATION_JSON.toString())
128+
.setHeader("Content-Type", MediaTypes.APPLICATION_JSON.toString())
131129
.setBody(bodyData)
132130
.setMethod(HttpConstants.Methods.POST);
133131

134132
if (_enableCompression) {
135-
requestBuilder.setHeader(HttpHeaderNames.CONTENT_ENCODING, HttpHeaderValues.GZIP);
133+
requestBuilder.setHeader("Content-Encoding", "gzip");
136134
}
137135

138136
return new RequestInfo(requestBuilder.build(), serializedData.length, bodyData.length);

src/main/java/com/arpnetworking/tsdcore/sinks/KairosDbSink.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import com.fasterxml.jackson.databind.ObjectMapper;
3636
import com.google.common.collect.ImmutableMap;
3737
import com.google.common.collect.Lists;
38-
import io.netty.handler.codec.http.HttpHeaderNames;
3938
import it.unimi.dsi.fastutil.doubles.Double2LongMap;
4039
import net.sf.oval.constraint.Min;
4140
import net.sf.oval.constraint.NotNull;
@@ -177,7 +176,7 @@ protected RequestInfo createRequest(final AsyncHttpClient client, final byte[] s
177176

178177
final RequestBuilder requestBuilder = new RequestBuilder()
179178
.setUri(getAysncHttpClientUri())
180-
.setHeader(HttpHeaderNames.CONTENT_TYPE, "application/gzip")
179+
.setHeader("Content-Type", "application/gzip")
181180
.setBody(bodyData)
182181
.setMethod(HttpConstants.Methods.POST);
183182

0 commit comments

Comments
 (0)