Skip to content

Conversation

@BrandonArp
Copy link
Member

No description provided.

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]>
@gemini-code-assist
Copy link

Summary of Changes

Hello @BrandonArp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses and resolves failing Dependabot update tests by upgrading a critical Netty HTTP codec dependency. The update necessitated minor code modifications in HTTP request building logic to ensure proper header handling with the new library version, thereby restoring test stability and system compatibility.

Highlights

  • Dependency Update: The netty.codec.http.version dependency has been updated from 4.2.6.Final to 4.2.7.Final in the pom.xml.
  • API Compatibility: Code in HttpPostSink.java and KairosDbSink.java has been adjusted to explicitly call .toString() on HttpHeaderNames and HttpHeaderValues constants when setting headers, likely to maintain compatibility with the updated Netty library.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the netty-codec-http dependency and adjusts the code to handle what appears to be an API incompatibility by converting Netty's AsciiString header constants to String. The changes are correct in fixing the issue. I've provided suggestions for a cleaner approach using constants from async-http-client's HttpConstants class. This improves readability and is more idiomatic for the library being used.

Comment on lines 130 to 136
.setHeader(HttpHeaderNames.CONTENT_TYPE.toString(), MediaTypes.APPLICATION_JSON.toString())
.setBody(bodyData)
.setMethod(HttpConstants.Methods.POST);

if (_enableCompression) {
requestBuilder.setHeader(HttpHeaderNames.CONTENT_ENCODING, HttpHeaderValues.GZIP);
requestBuilder.setHeader(HttpHeaderNames.CONTENT_ENCODING.toString(), HttpHeaderValues.GZIP.toString());
}

Choose a reason for hiding this comment

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

medium

While adding .toString() fixes the issue, a cleaner approach would be to use the string constants from org.asynchttpclient.util.HttpConstants, which is already imported. This avoids potential issues with Netty's AsciiString type and is more idiomatic when using async-http-client.

Suggested change
.setHeader(HttpHeaderNames.CONTENT_TYPE.toString(), MediaTypes.APPLICATION_JSON.toString())
.setBody(bodyData)
.setMethod(HttpConstants.Methods.POST);
if (_enableCompression) {
requestBuilder.setHeader(HttpHeaderNames.CONTENT_ENCODING, HttpHeaderValues.GZIP);
requestBuilder.setHeader(HttpHeaderNames.CONTENT_ENCODING.toString(), HttpHeaderValues.GZIP.toString());
}
.setHeader(HttpConstants.HttpHeaderNames.CONTENT_TYPE, MediaTypes.APPLICATION_JSON.toString())
.setBody(bodyData)
.setMethod(HttpConstants.Methods.POST);
if (_enableCompression) {
requestBuilder.setHeader(HttpConstants.HttpHeaderNames.CONTENT_ENCODING, HttpConstants.HttpHeaderValues.GZIP);
}

final RequestBuilder requestBuilder = new RequestBuilder()
.setUri(getAysncHttpClientUri())
.setHeader(HttpHeaderNames.CONTENT_TYPE, "application/gzip")
.setHeader(HttpHeaderNames.CONTENT_TYPE.toString(), "application/gzip")

Choose a reason for hiding this comment

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

medium

While adding .toString() fixes the issue, a cleaner approach would be to use the string constant from org.asynchttpclient.util.HttpConstants, which is already imported. This avoids potential issues with Netty's AsciiString type and is more idiomatic when using async-http-client.

Suggested change
.setHeader(HttpHeaderNames.CONTENT_TYPE.toString(), "application/gzip")
.setHeader(HttpConstants.HttpHeaderNames.CONTENT_TYPE, "application/gzip")

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.
@BrandonArp BrandonArp force-pushed the claude/fix-dependabot-test-failure-011CUsgPDqDgaNPq7sv4BZKY branch from 730f4f3 to cc989a8 Compare November 7, 2025 02:12
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.
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.
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.
@BrandonArp BrandonArp merged commit 1e61587 into master Nov 7, 2025
8 checks passed
@BrandonArp BrandonArp deleted the claude/fix-dependabot-test-failure-011CUsgPDqDgaNPq7sv4BZKY branch November 7, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants