Skip to content

dist: Apply Copilot review suggestions from PR #1042 (GraalVM Community)#1059

Merged
brunoborges merged 2 commits into
actions:mainfrom
brunoborges:fix/graalvm-community-copilot-suggestions
Jun 23, 2026
Merged

dist: Apply Copilot review suggestions from PR #1042 (GraalVM Community)#1059
brunoborges merged 2 commits into
actions:mainfrom
brunoborges:fix/graalvm-community-copilot-suggestions

Conversation

@brunoborges

Copy link
Copy Markdown
Contributor

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 them

The 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-contained

The example ran java -cp java HelloWorldApp / native-image -cp java HelloWorldApp, but never created HelloWorldApp or a java classpath 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

  • Documentation changes (docs/advanced-usage.md)
  • Tests added/updated

…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>
Copilot AI review requested due to automatic review settings June 23, 2026 17:24
@brunoborges brunoborges requested a review from a team as a code owner June 23, 2026 17:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@brunoborges brunoborges merged commit 1bcf9fb into actions:main Jun 23, 2026
591 of 592 checks passed
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.

2 participants