You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "r-sidd (via GitHub)" <gi...@apache.org> on 2025/04/01 19:06:46 UTC

[PR] [FLINK-37601] migrate unirest-java to unirest-java-core [flink]

r-sidd opened a new pull request, #26387:
URL: https://github.com/apache/flink/pull/26387

   ## What is the purpose of the change
   
   Migrate from deprecated unirest-java to unirest-java-core
   
   ## Brief change log
   
   The package has been moved from  [com.mashape.unirest](https://mvnrepository.com/artifact/com.mashape.unirest) to [com.konghq.](https://mvnrepository.com/artifact/com.konghq)
   
   Migrating from version 1.4.9 to unirest-java-core 4.4.5 is recommended to address over 50 security vulnerabilities present in the older version's dependencies. This upgrade will remediate these identified security findings.
   
   Old package - https://mvnrepository.com/artifact/com.mashape.unirest/unirest-java/1.4.9
   
   New package - https://mvnrepository.com/artifact/com.konghq/unirest-java-core/4.4.5
   
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): yes
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] migrate unirest-java to unirest-java-core [flink]

Posted by "r-sidd (via GitHub)" <gi...@apache.org>.
r-sidd commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2773061707

   > Thanks for this contribution @r-sidd ! Library upgrade LGTM.
   > 
   > However, since we only use `Unirest` in one specific place for testing, https://github.com/apache/flink/blob/master/flink-metrics/flink-metrics-prometheus/src/test/java/org/apache/flink/metrics/prometheus/PrometheusReporterTest.java#L248
   > 
   > Maybe we can consider instead removing the dependency on `Unirest` altogether by replacing the call `Unirest.get()` with calls to Java's default HttpClient instead?
   > 
   > ```
   > 
   >     private static final HttpClient HTTP_CLIENT = HttpClient.newHttpClient();
   > 
   >     static HttpResponse<String> pollMetrics(int port) throws IOException, InterruptedException {
   >         return HTTP_CLIENT.send(
   >                 HttpRequest.newBuilder()
   >                 .uri(URI.create("http://localhost:" + port + "/metrics"))
   >                 .GET()
   >                 .build(), HttpResponse.BodyHandlers.ofString());
   >     }
   > ```
   > 
   > A bit more verbose, but reduces dependencies when needed!
   
   Yea sure, does makes sense. Will do the changes :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] migrate unirest-java to unirest-java-core [flink]

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2770449802

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "21bddb99f952629491bed9bce0de91204c5b42d5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "21bddb99f952629491bed9bce0de91204c5b42d5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 21bddb99f952629491bed9bce0de91204c5b42d5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] migrate unirest-java to unirest-java-core [flink]

Posted by "r-sidd (via GitHub)" <gi...@apache.org>.
r-sidd commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2775327756

   @flinkbot run azure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] migrate unirest-java to unirest-java-core [flink]

Posted by "r-sidd (via GitHub)" <gi...@apache.org>.
r-sidd commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2779096749

   > @r-sidd this last change looks good. Please could you amend the Jira and PR title and text to describe the problem you are now fixing.
   
   Yes sure, let me do that


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] migrate unirest-java to unirest-java-core [flink]

Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2778982992

   @r-sidd this last change looks good. Please could you amend the Jira and PR title and text to describe the problem you are now fixing. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] Remove Unirest dependency in PrometheusReporterTest [flink]

Posted by "hlteoh37 (via GitHub)" <gi...@apache.org>.
hlteoh37 merged PR #26387:
URL: https://github.com/apache/flink/pull/26387


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] Remove Unirest dependency in PrometheusReporterTest [flink]

Posted by "r-sidd (via GitHub)" <gi...@apache.org>.
r-sidd commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2783967719

   > LGTM Thanks @r-sidd
   
   Thanks 🙂


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] migrate unirest-java to unirest-java-core [flink]

Posted by "hlteoh37 (via GitHub)" <gi...@apache.org>.
hlteoh37 commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2772636121

   Thanks for this contribution @r-sidd ! Library upgrade LGTM.
   
   However, since we only use `Unirest` in one specific place for testing,
   https://github.com/apache/flink/blob/master/flink-metrics/flink-metrics-prometheus/src/test/java/org/apache/flink/metrics/prometheus/PrometheusReporterTest.java#L248
   
   Maybe we can consider instead removing the dependency on `Unirest` altogether by replacing the call `Unirest.get()` with calls to Java's default HttpClient instead?
   
   ```
   
       private static final HttpClient HTTP_CLIENT = HttpClient.newHttpClient();
   
       static HttpResponse<String> pollMetrics(int port) throws IOException, InterruptedException {
           return HTTP_CLIENT.send(
                   HttpRequest.newBuilder()
                   .uri(URI.create("http://localhost:" + port + "/metrics"))
                   .GET()
                   .build(), HttpResponse.BodyHandlers.ofString());
       }
   
   ```
   A bit more verbose, but reduces dependencies when needed! 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] migrate unirest-java to unirest-java-core [flink]

Posted by "r-sidd (via GitHub)" <gi...@apache.org>.
r-sidd commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2775321038

   Hi @hlteoh37, thanks for the suggestion and the code, I've made the changes and pushed :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-37601] Remove Unirest dependency in PrometheusReporterTest [flink]

Posted by "r-sidd (via GitHub)" <gi...@apache.org>.
r-sidd commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2779120113

   > @r-sidd this last change looks good. Please could you amend the Jira and PR title and text to describe the problem you are now fixing.
   
   I've updated the Jira and the PR details :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org