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 — Optimize Maven configuration warm path by brunoborges · Pull Request #1182 · actions/setup-java

Conversation

@brunoborges

@brunoborges brunoborges commented Jul 30, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Description:
Warm JDK setup runs still paid Maven XML initialization cost even when the runner only needed the default new-file configuration path. This change avoids eager Maven XML work by using deterministic serializers for default settings.xml and new toolchains.xml, deferring Maven configuration modules until after Java setup, and using fast-xml-parser only when an existing toolchains.xml must be parsed for merge.

The Maven settings and toolchain work now runs concurrently where files are independent, while toolchain updates remain serialized so multi-version runs keep deterministic entries. The remaining xmlbuilder2 dependency was removed from runtime and tests, which drops the generated dist/setup/697.index.js DOM/XML-builder chunk that CodeQL flagged. The merge path now preserves custom root attributes, custom toolchains, nested attributes/text, partial JDK entries without IDs, duplicate filtering, and XML escaping through targeted regression tests.

Benchmark workflow assets were removed from this repository; Maven warm-path benchmarking moved to actions/setup-java-benchmarks in actions/setup-java-benchmarks#9.

Related issue:
Fixes: #1181

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
Optimize Maven configuration warm path
22ebe96
Avoid eager Maven XML initialization on warm JDK runs by using deterministic serializers for new Maven settings/toolchains files, lazy-loading xmlbuilder2 for existing toolchains merges, and deferring Maven configuration modules until after Java setup.

Add targeted tests for XML escaping, lazy xmlbuilder2 loading, concurrent Maven configuration, and a manual benchmark workflow for warm-path validation.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4dc58426-5e20-44cb-af16-8da0965fac3b
@brunoborges
brunoborges requested a review from a team as a code owner July 30, 2026 16:23
Copilot AI review requested due to automatic review settings July 30, 2026 16:23
Copilot started reviewing on behalf of brunoborges July 30, 2026 16:23
View session
Copilot stopped reviewing on behalf of brunoborges due to an error July 30, 2026 16:23
An unexpected error occurred. For more details, see the detailed logs in GitHub Actions.
Copilot AI reviewed Jul 30, 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

Note

Copilot was unable to run its full agentic suite in this review.

This PR refactors Maven-related configuration to reduce startup cost (especially around XML handling) and improve orchestration by parallelizing independent steps.

Changes:

  • Added lightweight XML escaping helpers and switched Maven settings/toolchains XML generation to avoid eagerly loading xmlbuilder2.
  • Refactored toolchain ID validation into a dedicated module and updated setup flow to overlap Maven auth + toolchains configuration.
  • Added targeted tests and a benchmarking workflow/script to measure Maven configuration performance and bundle size impact.
Show a summary per file
File Description
src/xml.ts Introduces reusable XML escaping helpers for text/attributes.
src/toolchains.ts Defers xmlbuilder2 loading to merge path only; adds manual XML generation for new toolchains and reorganizes toolchain ID validation export.
src/toolchain-ids.ts Extracts validateToolchainIds into a dedicated module.
src/setup-java.ts Reworks orchestration to collect toolchain configs during install and configure Maven (auth/toolchains/args) with more concurrency.
src/auth.ts Replaces xmlbuilder2 settings.xml generation with manual XML + escaping.
dist/setup/874.index.js Bundled output updates reflecting new lazy-loading / module splits.
dist/setup/81.index.js New bundle chunk for auth/xml/gpg changes.
dist/setup/767.index.js Bundle module id remapping for dependencies.
dist/setup/463.index.js Bundled output updates reflecting new lazy-loading / module splits.
dist/setup/451.index.js New bundle chunk for toolchains/xml/toolchain-ids changes.
dist/setup/242.index.js Bundle module id remapping for node externals.
dist/setup/220.index.js Bundled output updates reflecting new lazy-loading / module splits.
dist/setup/172.index.js New bundle chunk for Maven args logic.
tests/toolchains.test.ts Updates tests for async toolchain generation and adds escaping coverage.
tests/setup-java.test.ts Updates orchestration tests and adds a concurrency/overlap test for Maven configuration.
tests/maven-xml-loading.test.ts Adds coverage ensuring xmlbuilder2 is only loaded on merge path.
tests/benchmark-maven-configuration.sh Adds local benchmark harness for timing and bundle sizing.
tests/auth.test.ts Adds escaping semantics test for settings.xml generation.
.github/workflows/benchmark-maven-configuration.yml Adds workflow to run benchmarks across OS/cache/version/toolchains matrices.

Review details

Tip

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

  • Files reviewed: 11/21 changed files
  • Comments generated: 3
  • Review effort level: Low

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/toolchains.ts Resolved

Uh oh!

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

Comment thread src/setup-java.ts Resolved

Uh oh!

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

Comment thread __tests__/toolchains.test.ts Resolved

Uh oh!

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

@brunoborges
Address Maven optimization PR feedback
7eadc3b
Make the toolchain XML generator consistently async, remove redundant Maven configuration await handling, and reuse the existing XML test helper.

Configure CodeQL to skip generated dist output so newly split vendored chunks do not report duplicate generated-code alerts.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4dc58426-5e20-44cb-af16-8da0965fac3b
@brunoborges

brunoborges commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the Copilot review feedback in 7eadc3b:\n\n- Made generateToolchainDefinition consistently async and updated tests to await both fast and merge paths.\n- Removed the redundant second await of mavenConfiguration in setup-java.ts.\n- Removed the duplicate nested xmlElementText helper and reused the file-level helper.\n- Added CodeQL config for the reusable workflow so generated dist/** files are excluded from analysis; the failing alerts were in the newly split generated xmlbuilder2 bundle chunk.

All reactions

Sorry, something went wrong.

Uh oh!

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

brunoborges added 5 commits July 30, 2026 14:24
@brunoborges
Apply rubber duck review suggestions
15e8c6a
Document XML attribute escaping, simplify Maven configuration awaiting, and add a regression test that feeds fast-path toolchains output into the merge path.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4dc58426-5e20-44cb-af16-8da0965fac3b
@brunoborges
Delete .github/codeql/codeql-config.yml
f44ffec
@brunoborges
Update codeql-analysis.yml
85dda0a
@brunoborges
Replace xmlbuilder2 in Maven toolchain merge
e52b9af
Use fast-xml-parser for existing toolchains.xml parsing and serialize merged Maven toolchains deterministically. This removes the bundled xmlbuilder2 DOM/XML builder chunk from dist while preserving merge behavior for custom attributes, custom toolchains, partial entries, duplicate filtering, and escaping.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4dc58426-5e20-44cb-af16-8da0965fac3b
@brunoborges
Move Maven benchmark out of setup-java
35c48fb
Remove the Maven warm-path benchmark workflow and helper script from setup-java. Benchmark coverage is being moved to actions/setup-java-benchmarks so this action repository only carries the runtime optimization, tests, and generated distribution artifacts.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4dc58426-5e20-44cb-af16-8da0965fac3b
@brunoborges
brunoborges merged commit 5827477 into actions:main Jul 30, 2026
87 checks passed

Uh oh!

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

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

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Optimize Maven configuration on the warm JDK path

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 01402775 — 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.