GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Harden java-package validation across distributions by brunoborges · Pull Request #1165 · actions/setup-java

Conversation

@brunoborges

@brunoborges brunoborges commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description:
java-package values were interpreted inconsistently across distributions, allowing typos to select a default artifact or fail only after cache or network work. This change introduces one typed capability registry and validates distribution, package, and Temurin JMOD version combinations before installer construction.

The same registry now drives table-based behavior tests and contract checks for action metadata, README guidance, the advanced compatibility table, and E2E package combinations. The published contract includes the JetBrains JCEF and FreeType variants, jdkfile is restricted to jdk, and the generated setup bundle is updated.

Related issue:
Fixes: #1164

Check list:

  • Ran npm run check locally (format, lint, build, test) and all checks pass.
  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@brunoborges
Harden java-package validation
51683a8
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 10b8fe1e-18f4-42cb-8672-11215715a713
Copilot AI review requested due to automatic review settings July 29, 2026 04:46
@brunoborges
brunoborges requested a review from a team as a code owner July 29, 2026 04:46
Copilot started reviewing on behalf of brunoborges July 29, 2026 04:47
View session
@brunoborges brunoborges added the maintenance Internal refactors/chore work label Jul 29, 2026
@brunoborges
brunoborges merged commit 19c23b3 into main Jul 29, 2026
444 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@brunoborges
brunoborges deleted the brunoborges-harden-java-package-contract branch July 29, 2026 04:50
Copilot AI reviewed Jul 29, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

This PR centralizes and hardens java-package validation by introducing a single distribution→package capability registry, then using it to validate requested package types (and the Temurin jdk+jmods + version constraint) before installer selection. It also aligns the published action contract (action metadata + docs) and adds contract-style tests to keep docs, metadata, and E2E matrices consistent with the registry.

Changes:

  • Add JAVA_PACKAGE_CAPABILITIES + validateJavaPackage() and use it from getJavaDistribution().
  • Expand/clarify the published java-package contract in action.yml, README.md, and the advanced compatibility table.
  • Add contract and factory tests to ensure docs/metadata/E2E combinations match the registry, and to verify rejection/acceptance behavior.
Show a summary per file
File Description
src/distributions/package-types.ts Introduces the typed distribution/package registry and validation logic (including Temurin jdk+jmods version constraint).
src/distributions/distribution-factory.ts Calls centralized package validation before constructing an installer; removes the previous special-case jdk+jmods check.
README.md Updates java-package documentation to reflect all supported variants and points readers to the compatibility table.
docs/advanced-usage.md Updates the package compatibility section wording and clarifies jdkfile validation behavior.
action.yml Expands the java-package input description to include JetBrains variants and clarifies per-distribution support.
tests/java-package-contract.test.ts Adds contract tests to keep action.yml, README, advanced docs, and E2E matrices aligned with the registry.
tests/distributors/distribution-factory.test.ts Adds table-driven acceptance/rejection tests for package validation and Temurin jdk+jmods version gating.
dist/setup/index.js Updates the bundled distribution output to include the new package-types module and validation behavior.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

tests/java-package-contract.test.ts:72

  • The include: matrix parsing assumes distribution values are always single-quoted. YAML allows quoted or unquoted scalars, so this can miss valid entries and silently reduce coverage (future workflow edits could make the test pass while no longer validating all include rows).
    const includedPackages = workflow.matchAll(
      /- distribution: '([^']+)'\s*\n\s*java-package: ([^\s]+)/g
    );
  • Files reviewed: 7/8 changed files
  • Comments generated: 1
  • Review effort level: Low

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread __tests__/java-package-contract.test.ts
Comment on lines +57 to +59
const defaultMatrix = workflow.match(
/distribution:\s*\n\s*\[([^\]]+)\]\s*\n\s*java-package:\s*\['([^']+)'\]/
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

maintenance Internal refactors/chore work

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Harden the java-package contract across distributions

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@brunoborges
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.