Repository navigation
Add GitHub Token Support for GraalVM and Refactor Code - #849
v-HarithaVattikuti merged 14 commits into
Conversation
|
out of curiosity, I also hit API Rate Limit issues when using |
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for GitHub tokens to address API rate limits and refactors code for improved readability and maintainability.
- Introduces an optional token parameter to the GitHub HTTP headers helper.
- Refactors URL construction and error handling in the GraalVM installer.
- Updates associated tests with better grouping and improved mocking.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/util.ts | Added an optional token parameter to getGitHubHttpHeaders to support GitHub token usage. |
| src/distributions/graalvm/installer.ts | Refactored file URL construction, error handling, and platform logic for the GraalVM installer. |
| tests/distributors/graalvm-installer.test.ts | Improved test grouping, added helpers for mocking HTTP responses, and refined architecture mapping tests. |
Comments suppressed due to low confidence (1)
src/util.ts:186
- Consider updating the function's documentation or inline comments to clearly describe the new optional 'token' parameter and its behavior.
export function getGitHubHttpHeaders(token?: string): OutgoingHttpHeaders {
| const osType = distribution.getPlatform(); | ||
| if (osType === 'windows' && distroArch == 'aarch64') { | ||
| if (osType === 'windows' && distroArch === 'aarch64') { | ||
| return; // skip, aarch64 is not available for Windows |
There was a problem hiding this comment.
[nitpick] Instead of returning early inside the test body to skip the unsupported Windows aarch64 case, consider using a conditional test skip (e.g. test.skip for that iteration) to make the intent clearer.
| return; // skip, aarch64 is not available for Windows | |
| test.skip('Skipping test: aarch64 is not available for Windows'); |
fniephaus
left a comment
There was a problem hiding this comment.
LGTM, thanks for adding support for authenticated requests to avoid hitting rate limits.
@robstoll this PR is not touching the code responsible for pulling JetBrains JDKs. The relevant code seems to support the |
bcde537
67460fe
[//]: # (dependabot-start)⚠️ \*\*Dependabot is rebasing this PR\*\*⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.0.0 to 5.1.0. Release notes *Sourced from [actions/setup-java's releases](https://github.com/actions/setup-java/releases).* > v5.1.0 > ------ > > What's Changed > -------------- > > ### New Features > > * Add support for `.sdkmanrc` file in `java-version-file` parameter by [`@guicamest`](https://github.com/guicamest) in [actions/setup-java#736](https://redirect.github.com/actions/setup-java/pull/736) > * Add support for Microsoft OpenJDK 25 builds by [`@the-mod`](https://github.com/the-mod) in [actions/setup-java#927](https://redirect.github.com/actions/setup-java/pull/927) > > ### Bug Fixes & Improvements > > * Update Regex to Support All ASDF Versions for the supported distributions in tool-versions File by [`@aparnajyothi-y`](https://github.com/aparnajyothi-y) in [actions/setup-java#767](https://redirect.github.com/actions/setup-java/pull/767) > * Enhance error logging for network failures to include endpoint/IP details, add retry mechanism and update workflows to use macos-15-intel by [`@priya-kinthali`](https://github.com/priya-kinthali) in [actions/setup-java#946](https://redirect.github.com/actions/setup-java/pull/946) > * Update SapMachine URLs by [`@RealCLanger`](https://github.com/RealCLanger) in [actions/setup-java#955](https://redirect.github.com/actions/setup-java/pull/955) > * Add GitHub Token Support for GraalVM and Refactor Code by [`@mahabaleshwars`](https://github.com/mahabaleshwars) in [actions/setup-java#849](https://redirect.github.com/actions/setup-java/pull/849) > > ### Documentation changes > > * Update documentation to use checkout and Java v5 by [`@lmvysakh`](https://github.com/lmvysakh) in [actions/setup-java#903](https://redirect.github.com/actions/setup-java/pull/903) > * Clarify JAVA\_HOME and PATH setup in README by [`@chiranjib-swain`](https://github.com/chiranjib-swain) in [actions/setup-java#841](https://redirect.github.com/actions/setup-java/pull/841) > > ### Dependency updates > > * Upgrade prettier from 2.8.8 to 3.6.2 and document breaking changes in v5 by [`@dependabot`](https://github.com/dependabot) in [actions/setup-java#873](https://redirect.github.com/actions/setup-java/pull/873) > * Upgrade actions/publish-action from 0.3.0 to 0.4.0 by [`@dependabot`](https://github.com/dependabot) in [actions/setup-java#912](https://redirect.github.com/actions/setup-java/pull/912) > > New Contributors > ---------------- > > * [`@lmvysakh`](https://github.com/lmvysakh) made their first contribution in [actions/setup-java#903](https://redirect.github.com/actions/setup-java/pull/903) > * [`@chiranjib-swain`](https://github.com/chiranjib-swain) made their first contribution in [actions/setup-java#841](https://redirect.github.com/actions/setup-java/pull/841) > * [`@the-mod`](https://github.com/the-mod) made their first contribution in [actions/setup-java#927](https://redirect.github.com/actions/setup-java/pull/927) > * [`@priya-kinthali`](https://github.com/priya-kinthali) made their first contribution in [actions/setup-java#946](https://redirect.github.com/actions/setup-java/pull/946) > * [`@guicamest`](https://github.com/guicamest) made their first contribution in [actions/setup-java#736](https://redirect.github.com/actions/setup-java/pull/736) > > **Full Changelog**: <actions/setup-java@v5...v5.1.0> Commits * [`f2beeb2`](actions/setup-java@f2beeb2) Bump actions/publish-action from 0.3.0 to 0.4.0 ([#912](https://redirect.github.com/actions/setup-java/issues/912)) * [`4e7e684`](actions/setup-java@4e7e684) feat: Add support for `.sdkmanrc` file in `java-version-file` parameter ([#736](https://redirect.github.com/actions/setup-java/issues/736)) * [`46c56d6`](actions/setup-java@46c56d6) Add GitHub Token Support for GraalVM and Refactor Code ([#849](https://redirect.github.com/actions/setup-java/issues/849)) * [`66b9457`](actions/setup-java@66b9457) Update SapMachine URLs ([#955](https://redirect.github.com/actions/setup-java/issues/955)) * [`6ba5449`](actions/setup-java@6ba5449) Enhance error logging for network failures to include endpoint/IP details, ad... * [`de5a937`](actions/setup-java@de5a937) adds microsoft openjdk25 builds ([#927](https://redirect.github.com/actions/setup-java/issues/927)) * [`ead9eaa`](actions/setup-java@ead9eaa) Update Regex to Support All ASDF Versions for the supported distributions in ... * [`8c57fa3`](actions/setup-java@8c57fa3) Clarify JAVA\_HOME and PATH setup in README ([#841](https://redirect.github.com/actions/setup-java/issues/841)) * [`a7ab372`](actions/setup-java@a7ab372) Bump prettier from 2.8.8 to 3.6.2 ([#873](https://redirect.github.com/actions/setup-java/issues/873)) * [`d0351b4`](actions/setup-java@d0351b4) Update documentation to use checkout and Java v5 ([#903](https://redirect.github.com/actions/setup-java/issues/903)) * See full diff in [compare view](actions/setup-java@dded088...f2beeb2) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps the github-actions group with 9 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `6.0.0` | `6.0.1` | | [actions/setup-java](https://github.com/actions/setup-java) | `5.0.0` | `5.1.0` | | [graalvm/setup-graalvm](https://github.com/graalvm/setup-graalvm) | `1.4.3` | `1.4.4` | | [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `2.4.2` | `2.5.0` | | [github/codeql-action](https://github.com/github/codeql-action) | `4.31.5` | `4.31.7` | | [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) | `7.0.9` | `7.0.11` | | [ruby/setup-ruby](https://github.com/ruby/setup-ruby) | `1.268.0` | `1.269.0` | | [updatecli/updatecli-action](https://github.com/updatecli/updatecli-action) | `2.96.0` | `2.97.0` | | [actions/setup-node](https://github.com/actions/setup-node) | `6.0.0` | `6.1.0` | Updates `actions/checkout` from 6.0.0 to 6.0.1 Release notes *Sourced from [actions/checkout's releases](https://github.com/actions/checkout/releases).* > v6.0.1 > ------ > > What's Changed > -------------- > > * Update all references from v5 and v4 to v6 by [`@ericsciple`](https://github.com/ericsciple) in [actions/checkout#2314](https://redirect.github.com/actions/checkout/pull/2314) > * Add worktree support for persist-credentials includeIf by [`@ericsciple`](https://github.com/ericsciple) in [actions/checkout#2327](https://redirect.github.com/actions/checkout/pull/2327) > * Clarify v6 README by [`@ericsciple`](https://github.com/ericsciple) in [actions/checkout#2328](https://redirect.github.com/actions/checkout/pull/2328) > > **Full Changelog**: <actions/checkout@v6...v6.0.1> Commits * [`8e8c483`](actions/checkout@8e8c483) Clarify v6 README ([#2328](https://redirect.github.com/actions/checkout/issues/2328)) * [`033fa0d`](actions/checkout@033fa0d) Add worktree support for persist-credentials includeIf ([#2327](https://redirect.github.com/actions/checkout/issues/2327)) * [`c2d88d3`](actions/checkout@c2d88d3) Update all references from v5 and v4 to v6 ([#2314](https://redirect.github.com/actions/checkout/issues/2314)) * See full diff in [compare view](actions/checkout@1af3b93...8e8c483) Updates `actions/setup-java` from 5.0.0 to 5.1.0 Release notes *Sourced from [actions/setup-java's releases](https://github.com/actions/setup-java/releases).* > v5.1.0 > ------ > > What's Changed > -------------- > > ### New Features > > * Add support for `.sdkmanrc` file in `java-version-file` parameter by [`@guicamest`](https://github.com/guicamest) in [actions/setup-java#736](https://redirect.github.com/actions/setup-java/pull/736) > * Add support for Microsoft OpenJDK 25 builds by [`@the-mod`](https://github.com/the-mod) in [actions/setup-java#927](https://redirect.github.com/actions/setup-java/pull/927) > > ### Bug Fixes & Improvements > > * Update Regex to Support All ASDF Versions for the supported distributions in tool-versions File by [`@aparnajyothi-y`](https://github.com/aparnajyothi-y) in [actions/setup-java#767](https://redirect.github.com/actions/setup-java/pull/767) > * Enhance error logging for network failures to include endpoint/IP details, add retry mechanism and update workflows to use macos-15-intel by [`@priya-kinthali`](https://github.com/priya-kinthali) in [actions/setup-java#946](https://redirect.github.com/actions/setup-java/pull/946) > * Update SapMachine URLs by [`@RealCLanger`](https://github.com/RealCLanger) in [actions/setup-java#955](https://redirect.github.com/actions/setup-java/pull/955) > * Add GitHub Token Support for GraalVM and Refactor Code by [`@mahabaleshwars`](https://github.com/mahabaleshwars) in [actions/setup-java#849](https://redirect.github.com/actions/setup-java/pull/849) > > ### Documentation changes > > * Update documentation to use checkout and Java v5 by [`@lmvysakh`](https://github.com/lmvysakh) in [actions/setup-java#903](https://redirect.github.com/actions/setup-java/pull/903) > * Clarify JAVA\_HOME and PATH setup in README by [`@chiranjib-swain`](https://github.com/chiranjib-swain) in [actions/setup-java#841](https://redirect.github.com/actions/setup-java/pull/841) > > ### Dependency updates > > * Upgrade prettier from 2.8.8 to 3.6.2 and document breaking changes in v5 by [`@dependabot`](https://github.com/dependabot) in [actions/setup-java#873](https://redirect.github.com/actions/setup-java/pull/873) > * Upgrade actions/publish-action from 0.3.0 to 0.4.0 by [`@dependabot`](https://github.com/dependabot) in [actions/setup-java#912](https://redirect.github.com/actions/setup-java/pull/912) > > New Contributors > ---------------- > > * [`@lmvysakh`](https://github.com/lmvysakh) made their first contribution in [actions/setup-java#903](https://redirect.github.com/actions/setup-java/pull/903) > * [`@chiranjib-swain`](https://github.com/chiranjib-swain) made their first contribution in [actions/setup-java#841](https://redirect.github.com/actions/setup-java/pull/841) > * [`@the-mod`](https://github.com/the-mod) made their first contribution in [actions/setup-java#927](https://redirect.github.com/actions/setup-java/pull/927) > * [`@priya-kinthali`](https://github.com/priya-kinthali) made their first contribution in [actions/setup-java#946](https://redirect.github.com/actions/setup-java/pull/946) > * [`@guicamest`](https://github.com/guicamest) made their first contribution in [actions/setup-java#736](https://redirect.github.com/actions/setup-java/pull/736) > > **Full Changelog**: <actions/setup-java@v5...v5.1.0> Commits * [`f2beeb2`](actions/setup-java@f2beeb2) Bump actions/publish-action from 0.3.0 to 0.4.0 ([#912](https://redirect.github.com/actions/setup-java/issues/912)) * [`4e7e684`](actions/setup-java@4e7e684) feat: Add support for `.sdkmanrc` file in `java-version-file` parameter ([#736](https://redirect.github.com/actions/setup-java/issues/736)) * [`46c56d6`](actions/setup-java@46c56d6) Add GitHub Token Support for GraalVM and Refactor Code ([#849](https://redirect.github.com/actions/setup-java/issues/849)) * [`66b9457`](actions/setup-java@66b9457) Update SapMachine URLs ([#955](https://redirect.github.com/actions/setup-java/issues/955)) * [`6ba5449`](actions/setup-java@6ba5449) Enhance error logging for network failures to include endpoint/IP details, ad... * [`de5a937`](actions/setup-java@de5a937) adds microsoft openjdk25 builds ([#927](https://redirect.github.com/actions/setup-java/issues/927)) * [`ead9eaa`](actions/setup-java@ead9eaa) Update Regex to Support All ASDF Versions for the supported distributions in ... * [`8c57fa3`](actions/setup-java@8c57fa3) Clarify JAVA\_HOME and PATH setup in README ([#841](https://redirect.github.com/actions/setup-java/issues/841)) * [`a7ab372`](actions/setup-java@a7ab372) Bump prettier from 2.8.8 to 3.6.2 ([#873](https://redirect.github.com/actions/setup-java/issues/873)) * [`d0351b4`](actions/setup-java@d0351b4) Update documentation to use checkout and Java v5 ([#903](https://redirect.github.com/actions/setup-java/issues/903)) * See full diff in [compare view](actions/setup-java@dded088...f2beeb2) Updates `graalvm/setup-graalvm` from 1.4.3 to 1.4.4 Release notes *Sourced from [graalvm/setup-graalvm's releases](https://github.com/graalvm/setup-graalvm/releases).* > v1.4.4 > ------ > > What's Changed > -------------- > > * Bump actions/checkout from 5.0.0 to 6.0.0 in the github-actions-updates group by [`@dependabot`](https://github.com/dependabot)[bot] in [graalvm/setup-graalvm#198](https://redirect.github.com/graalvm/setup-graalvm/pull/198) > * Bump the npm-updates group with 10 updates by [`@dependabot`](https://github.com/dependabot)[bot] in [graalvm/setup-graalvm#197](https://redirect.github.com/graalvm/setup-graalvm/pull/197) > > **Full Changelog**: <graalvm/setup-graalvm@v1.4.3...v1.4.4> Commits * [`790e289`](graalvm/setup-graalvm@790e289) Bump version to `1.4.4`. * [`434a92b`](graalvm/setup-graalvm@434a92b) Update dist files. * [`fe4a6b3`](graalvm/setup-graalvm@fe4a6b3) Update dependencies * [`d8578a7`](graalvm/setup-graalvm@d8578a7) Bump the npm-updates group with 10 updates * [`98e485c`](graalvm/setup-graalvm@98e485c) Bump actions/checkout in the github-actions-updates group * See full diff in [compare view](graalvm/setup-graalvm@dec5790...790e289) Updates `softprops/action-gh-release` from 2.4.2 to 2.5.0 Release notes *Sourced from [softprops/action-gh-release's releases](https://github.com/softprops/action-gh-release/releases).* > v2.5.0 > ------ > > What's Changed > -------------- > > ### Exciting New Features 🎉 > > * feat: mark release as draft until all artifacts are uploaded by [`@dumbmoron`](https://github.com/dumbmoron) in [softprops/action-gh-release#692](https://redirect.github.com/softprops/action-gh-release/pull/692) > > ### Other Changes 🔄 > > * chore(deps): bump the npm group across 1 directory with 5 updates by [`@dependabot`](https://github.com/dependabot)[bot] in [softprops/action-gh-release#697](https://redirect.github.com/softprops/action-gh-release/pull/697) > * chore(deps): bump actions/checkout from 5.0.0 to 5.0.1 in the github-actions group by [`@dependabot`](https://github.com/dependabot)[bot] in [
Description:
Related issue:
Check list: