Skip to content

refactor(java-version): extract adoptium HTTP logic from datasource class#42604

Open
zeitlinger wants to merge 3 commits intorenovatebot:mainfrom
zeitlinger:refactor/java-version-datasource
Open

refactor(java-version): extract adoptium HTTP logic from datasource class#42604
zeitlinger wants to merge 3 commits intorenovatebot:mainfrom
zeitlinger:refactor/java-version-datasource

Conversation

@zeitlinger
Copy link
Copy Markdown

Summary

  • Extracts getPageReleases and the Adoptium fetch loop out of the JavaVersionDatasource class into a standalone adoptium.ts module
  • Exports adoptiumRegistryUrl from adoptium.ts (same value as the previous defaultRegistryUrl in common.ts)
  • No behavior change — customRegistrySupport remains false

Motivation

Prerequisite refactor for #40497 (feat: add GraalVM version datasource), requested by @viceice to keep the GraalVM PR focused on new functionality.

Test plan

  • Existing tests pass without modification
  • New getAdoptiumReleases unit test covers the non-HttpError re-throw path

…lass

Move getPageReleases and the Adoptium fetch logic out of the
JavaVersionDatasource class into a standalone adoptium.ts module.
This makes the code easier to test in isolation and decouples
Adoptium-specific logic from the datasource class.

No behavior change — customRegistrySupport remains false, and the
hardcoded adoptiumRegistryUrl replaces the previously injected
defaultRegistryUrl (which was always the same value).
@zeitlinger zeitlinger marked this pull request as ready for review April 13, 2026 18:00
@viceice viceice self-requested a review April 14, 2026 04:54
Copy link
Copy Markdown
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

it('re-throws non-HttpError', async () => {
const mockHttp = {
getJsonUnchecked: vi.fn().mockRejectedValue(new Error('unexpected')),
} as unknown as Http;
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.

use partial helper

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done in f741934

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