Skip to content

test: Graalvm smoke test#379

Closed
gastonfournier wants to merge 5 commits into
mainfrom
graalvm-smoke-test
Closed

test: Graalvm smoke test#379
gastonfournier wants to merge 5 commits into
mainfrom
graalvm-smoke-test

Conversation

@gastonfournier
Copy link
Copy Markdown
Contributor

Attempt to have a GraalVM validation step

Copilot AI review requested due to automatic review settings May 22, 2026 09:12
As reported in #377 - getContent() when building with GraalVM uses serviceloaders to locate the correct content processor.
But we've already checked that we don't have a gzip
stream, so we're trusting our upstream to return application/json and do
not need a content processor. This saves us a cast from content to
InputStream as well.

fixes: #377
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a GraalVM native-image smoke test to validate HttpFeatureFetcher works in a native binary, and adjusts a small input-stream access detail.

Changes:

  • Introduces a standalone smoke-test main class that spins up a local socket server and validates feature fetching.
  • Updates HttpFeatureFetcher to use getInputStream() instead of casting getContent() to InputStream.
  • Adds a GitHub Actions job to build and run the smoke test as a GraalVM native image.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/test/java/io/getunleash/repository/GraalVmHttpFeatureFetcherSmoke.java Adds a native-image-friendly smoke test that exercises HttpFeatureFetcher end-to-end.
src/main/java/io/getunleash/repository/HttpFeatureFetcher.java Switches to request.getInputStream() for reading the response body.
pom.xml Fixes project version string and applies formatting changes.
.github/workflows/pull_requests.yml Adds a CI job to build and execute the GraalVM native-image smoke test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

with:
distribution: graalvm
java-version: "21"
cache: maven
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It does look like this might be correct, components: 'native-image' might be needed here.

Comment on lines +33 to +35
graalvm-native-image:
runs-on: ubuntu-latest
steps:
Comment thread pom.xml Outdated
<groupId>io.getunleash</groupId>
<artifactId>unleash-client-java</artifactId>
<version>12.2.3-SNAPSHOT</version>
<version>12.2.2-SNAPSHOT</version>
socket.getInputStream(), StandardCharsets.US_ASCII));
OutputStream output = socket.getOutputStream()) {
String line;
while ((line = reader.readLine()) != null && !line.isEmpty()) {}
Comment on lines +68 to +70
} catch (Exception e) {
throw new RuntimeException(e);
}
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented May 22, 2026

Coverage Report for CI Build 26279738811

Coverage increased (+0.2%) to 79.869%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (0 of 1 lines covered, 0.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/main/java/io/getunleash/repository/HttpFeatureFetcher.java 1 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4242
Covered Lines: 3514
Line Coverage: 82.84%
Relevant Branches: 1108
Covered Branches: 759
Branch Coverage: 68.5%
Branches in Coverage %: Yes
Coverage Strength: 9.7 hits per line

💛 - Coveralls

@gastonfournier
Copy link
Copy Markdown
Contributor Author

This doesn't seem to catch any problem so I will just close this idea for now

@github-project-automation github-project-automation Bot moved this from New to Done in Issues and PRs May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants