Skip to content

feat(gradle): resolve partial versions to the newest matching release - #7659

Merged
viceice merged 1 commit into
viceice/feat/maven-partial-versionsfrom
viceice/feat/gradle-partial-versions
Oct 9, 2026
Merged

viceice merged 1 commit into
viceice/feat/maven-partial-versionsfrom
viceice/feat/gradle-partial-versions

Conversation

@viceice

@viceice viceice commented Oct 8, 2026

Copy link
Copy Markdown
Member

Changes

Partial versions for gradle, like the other resolvers of this stack:

  • install-tool gradle 8 or 9.0 resolves to the newest matching stable release from services.gradle.org/versions/all (the list Renovate's gradle-version datasource uses), read through the CDN and URL replacements; snapshots, nightlies, release candidates, milestones and broken releases are skipped.
  • A version which exists as a release, like 8.10 or 6.9, is installed exactly as given, so pinned versions never change; a partial without a match throws; when the release list can't be loaded or parsed the version is kept.
  • latest, no version, full versions and prereleases like 8.8-rc-2 behave as before.
  • install-tool --help and docs/tools.md document it, and the java container test installs gradle 8.

Context

Please select one of the following:

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Implemented by Claude Sonnet 5.5 and reviewed by Claude Opus 5.5 in Claude Code.

Use of AI in replying to PR comments

Who answers review comments:

  • @viceice will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted. Name the account.
  • An agent will draft replies and reply autonomously. This is heavily discouraged, and we prefer that there are humans in the loop
  • Nobody has explicitly committed to replying.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified tests

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: containerbase/coderabbit/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cc6c74cc-811c-41d5-973d-7ee71cd2cdc0

📥 Commits

Reviewing files that changed from the base of the PR and between e94c1c8 and 9c8c02b.


📒 Files selected for processing (6)
  • docs/tools.md
  • src/cli/install-tool/version-resolvers.spec.ts
  • src/cli/tools/java/gradle.spec.ts
  • src/cli/tools/java/gradle.ts
  • src/cli/tools/java/schema.ts
  • test/java/Dockerfile


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@viceice
viceice added this pull request to stack #7631 October 8, 2026 12:38
@viceice
viceice force-pushed the viceice/feat/gradle-partial-versions branch from be4ccfc to 111bad8 Compare October 8, 2026 12:43
Co-Authored-By: Claude Sonnet 5.5 <michael.kriese+claude-code@mend.io>
Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
@viceice
viceice force-pushed the viceice/feat/gradle-partial-versions branch from 111bad8 to 9c8c02b Compare October 9, 2026 09:52
@viceice
viceice marked this pull request as ready for review October 9, 2026 09:53
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Resolve partial Gradle versions to the newest matching stable release

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Resolve partial Gradle versions to the newest matching stable release while preserving explicitly
 listed releases.
• Keep the requested version when release lookup fails; reject partial versions with no match.
• Document the behavior and cover it with resolver tests and a Java container test.
Diagram

graph TD
  Request["Gradle request"] --> Mode{"Version type?"} -->|partial| List["Release list API"] --> Listed{"Listed release?"} -->|no| Filter["Newest stable"] -->|match| Result["Resolved version"]
  Mode -->|latest or missing| Current["Current release API"] --> Result
  Mode -->|full or prerelease| Result
  List -->|lookup fails| Result
  Listed -->|yes| Result
  Filter -->|no match| Error["No matching release"]
Loading
High-Level Assessment

The approach fits the existing resolver pattern: it reuses shared partial-version matching helpers and Gradle's release list without adding a dependency. Relying on the current-release endpoint or inferring versions from distribution URLs would not provide the release inventory needed to preserve listed versions and exclude unstable entries.

Files changed (6) +193 / -12

Enhancement (2) +88 / -4
gradle.tsResolve partial Gradle versions from the release list +50/-4

Resolve partial Gradle versions from the release list

• Looks up partial versions in Gradle's release list, preserves listed releases, and selects the newest matching stable release otherwise. Keeps the requested version if lookup or parsing fails and exposes partial-version help.

src/cli/tools/java/gradle.ts

schema.tsParse and filter Gradle releases +38/-0

Parse and filter Gradle releases

• Adds a schema that skips malformed entries and separates all listed versions from stable, non-broken numeric releases.

src/cli/tools/java/schema.ts

Tests (3) +100 / -8
version-resolvers.spec.tsUpdate help-text expectations for Gradle +5/-5

Update help-text expectations for Gradle

• Adds Gradle to the partial-version help expectation. Uses Composer to retain coverage for dedicated resolvers without version notes.

src/cli/install-tool/version-resolvers.spec.ts

gradle.spec.tsTest Gradle release selection and fallback +89/-3

Test Gradle release selection and fallback

• Covers newest stable matches, preservation of listed and non-partial versions, absent matches, malformed release data, and lookup failures.

src/cli/tools/java/gradle.spec.ts

DockerfileExercise partial Gradle installation in the Java container +6/-0

Exercise partial Gradle installation in the Java container

• Installs Gradle using major version 8 and verifies that the resulting executable reports a Gradle 8 release.

test/java/Dockerfile

Documentation (1) +5 / -0
tools.mdDocument Gradle partial-version behavior +5/-0

Document Gradle partial-version behavior

• Explains stable-release matching, exact handling of listed releases, lookup fallback, and unchanged latest behavior.

docs/tools.md

@qodo-code-review

qodo-code-review Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Resolved findings
1. Arm64 misses partial-version coverage ✗ Dismissed
Description
test/java/Dockerfile adds install-tool gradle 8 to its partial-version stage, but the matching
arm64 Dockerfile installs Gradle only with a full version. The new release lookup is therefore
exercised in the x64 Java smoke test but not in the arm64 one.
Code

test/java/Dockerfile[268]

+RUN install-tool gradle 8
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new partial-version Gradle install is tested only in the x64 Java Dockerfile.

## Fix Focus Areas
- test/java/Dockerfile[268-272]
- test/java/Dockerfile.arm64[45-49]

## Recommended Fix
Add a Gradle partial-version install and smoke check to the arm64 Java Dockerfile.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Partial Gradle smoke skips real tasks ✗ Dismissed
Description
test-partial-version checks the newly installed Gradle only with gradle --version, although
existing Gradle stages exercise its wrapper task. If a resolved release prints its version but fails
to run that task, the new smoke check still passes.
Code

test/java/Dockerfile[R270-272]

+RUN set -ex; \
+  gradle --version | grep '^Gradle 8\.'; \
+  true
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The partial-version smoke test checks only Gradle's version, despite an existing wrapper-task smoke pattern.

## Fix Focus Areas
- test/java/Dockerfile[268-272]

## Recommended Fix
After installing the partial Gradle version, run a Gradle task such as the wrapper task in an isolated test directory, and retain the major-version assertion.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread test/java/Dockerfile
Comment thread test/java/Dockerfile
@viceice
viceice added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit e2f7802 Oct 9, 2026
60 of 70 checks passed
@viceice
viceice deleted the viceice/feat/gradle-partial-versions branch October 9, 2026 12:05
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.

1 participant