Skip to content

SapMachine EA requests can select stable releases #1216

Closed

Description

@jdubois

Description:
SapMachine release filtering is one-sided. SapMachineDistribution.parseVersions() excludes EA entries when a stable version is requested, but it does not exclude GA entries when an EA version is requested. The base installer normalizes <major>-ea to <major> and records stable = false, so both release classes remain eligible for the same SemVer range. Descending SemVer/build sorting can then place a GA release first.

The one-sided predicate is at installer.ts lines 177-180, after EA normalization sets the stability flag at base-installer.ts lines 509-515. The remaining candidates are sorted newest-first at installer.ts lines 225-234.

Task version:
v6 (current main at ab597f914a6894678251803485c09f413263b889)

Platform:

  • Ubuntu
  • macOS
  • Windows

The defect is platform-independent because it occurs while filtering the SapMachine manifest.

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Use a deterministic SapMachine manifest fixture with two matching Linux x64 JDK entries under major 25:

{
  "25": {
    "lts": "false",
    "updates": {
      "25.0.1": {
        "sapmachine-25.0.1": { "ea": "false", "assets": { "jdk": { "linux-x64": { "tar.gz": { "name": "ga", "checksum": "ga", "url": "https://example.test/ga.tar.gz" } } } } }
      },
      "25": {
        "sapmachine-25+10": { "ea": "true", "assets": { "jdk": { "linux-x64": { "tar.gz": { "name": "ea", "checksum": "ea", "url": "https://example.test/ea.tar.gz" } } } } }
      }
    }
  }
}

Construct SapMachineDistribution with version: "25-ea", architecture: "x64", and packageType: "jdk"; mock the manifest response and Linux platform; then call findPackageForDownload("25"). Both 25.0.1 (GA) and 25.0.0+10 (EA) pass the current filter and satisfy the normalized range. sortParsedVersions() orders 25.0.1 first, so the GA URL is selected.

Expected behavior:
An EA request selects only entries marked as early access and resolves https://example.test/ea.tar.gz. Stable requests continue to select only GA entries. Exact-version matching, package/platform filtering, and sorting within the selected release class remain unchanged.

Actual behavior:
The EA request keeps both GA and EA entries and resolves https://example.test/ga.tar.gz.

Acceptance criteria:

  • Stable and EA SapMachine requests filter to mutually exclusive release classes.
  • java-version: <major>-ea cannot resolve a stable SapMachine build.
  • String and boolean forms of SapMachine EA metadata are classified consistently.
  • Exact-version behavior, package/platform filtering, sorting, and existing stable resolution remain unchanged.
  • A regression fixture contains competing GA and EA candidates that fails under the current implementation and selects the EA candidate after the fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions