dist: Apply Copilot review suggestions from PR #1042 (GraalVM Community)#1059
Merged
brunoborges merged 2 commits intoJun 23, 2026
Merged
Conversation
…M Community) - installer: surface a clear error when the GraalVM Community releases listing is not a JSON array, instead of silently treating an error payload (rate limit, auth failure, etc.) as "no releases" which later surfaced as a misleading "version not found" error. - docs: fix the GraalVM Community advanced-usage example to check the installed binary versions (java/native-image --version) rather than running a non-existent HelloWorldApp classpath that fails when copied. - tests: cover the new non-array release listing error path. Rebuilt dist bundle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Follow-up to the previously-merged GraalVM Community support work, improving error surfacing when querying GitHub releases and making the GraalVM Community documentation example copy/pasteable.
Changes:
- Throw a descriptive error when the GitHub releases API returns a non-array payload (instead of silently treating it as “no releases”).
- Update the GraalVM Community advanced usage example to verify installed binaries via
--version. - Add a unit test for the new non-array releases listing error path and rebuild the bundled
dist/output.
Show a summary per file
| File | Description |
|---|---|
src/distributions/graalvm/installer.ts |
Surfaces unexpected/non-array GitHub API responses as explicit errors during GraalVM Community version discovery. |
docs/advanced-usage.md |
Fixes the GraalVM Community workflow example to be self-contained by using java --version / native-image --version. |
__tests__/distributors/graalvm-installer.test.ts |
Adds coverage for the new error path when releases listing isn’t a JSON array. |
dist/setup/index.js |
Updates the compiled/bundled output to include the installer change. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/4 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #1042 (now merged) addressing the two suggestions left by the Copilot reviewer that weren't applied before merge.
1.
src/distributions/graalvm/installer.ts— surface API errors instead of masking themThe GraalVM Community release listing previously treated any non-array JSON result as "no releases" and broke out of pagination. If the GitHub API returned an error payload (rate limiting, auth failure, etc.), this would later surface as a misleading "version not found" error rather than reporting the actual API failure.
Now, a non-array response throws a descriptive error including the HTTP status code and a pointer to the GraalVM Community download page. A legitimate empty array (
[]) still terminates pagination normally.2.
docs/advanced-usage.md— make the GraalVM Community example self-containedThe example ran
java -cp java HelloWorldApp/native-image -cp java HelloWorldApp, but never createdHelloWorldAppor ajavaclasspath directory, so it would fail when copied as-is. It now checks the installed binaries' versions (java --version/native-image --version), matching the GraalVM (Oracle) example just above it.Tests
Added a test covering the new non-array release listing error path. Full GraalVM suite passes (50 tests). Rebuilt the
dist/bundle.Related
Check list