Skip to content

Conversation

@bmatthews68
Copy link
Contributor

This PR fixes #4052 for Gradle 9 and higher without breaking backwards compatibility with earlier versions.

Fixes #4052 🛠️

….0 or later before trying to access the settings file start parameter.
@google-cla
Copy link

google-cla bot commented Nov 28, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @bmatthews68, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the Jib Gradle plugin to ensure compatibility with Gradle 9.0 and future versions. It specifically modifies the FilesTaskV2 to conditionally handle the settings.gradle file, preventing potential issues that arise from changes in Gradle's StartParameter API in newer releases, while preserving functionality for older Gradle environments.

Highlights

  • Gradle 9+ Compatibility: The _jibSkaffoldFilesV2 task has been updated to avoid using StartParameter.getSettingsFile() when the Gradle version is 9.0 or higher, addressing a compatibility issue.
  • Backward Compatibility: The changes ensure that the plugin remains fully functional with Gradle versions older than 9.0, maintaining compatibility across different Gradle environments.
  • Issue Fix: This pull request directly resolves issue When skaffold invokes jib via gradle, a deprecated feature is used that will not work on gradle 9.0 #4052, which was related to the handling of settings files in newer Gradle versions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly addresses the issue of using StartParameter.getSettingsFile() on Gradle 9 and higher by adding a version check. The approach maintains backward compatibility for older Gradle versions.

However, I've noticed that no new tests have been added to verify the behavior on Gradle 9 or higher. It is crucial to add a test case that runs with Gradle 9 to confirm that the logic works as expected and to prevent future regressions. The existing test framework seems to support this via withGradleVersion().

@bmatthews68
Copy link
Contributor Author

@gemini-code-assist

@gemini-code-assist
Copy link
Contributor

Thanks for the ping, @bmatthews68! I've completed my review of your pull request.

Your changes effectively address the compatibility issue with Gradle 9.0 and higher by conditionally handling the settings.gradle file, while maintaining backward compatibility for older Gradle versions. The solution is clean and directly targets the problem described in #4052.

Overall, the code is well-structured and adheres to good practices. I have no further comments or suggestions at this time. Great work!

@diegomarquezp
Copy link
Contributor

Hi @bmatthews68, thanks for your contribution. It looks good, but it just needs a reformat of the file.

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':jib-gradle-plugin:verifyGoogleJavaFormat'.

Copy link
Contributor

@diegomarquezp diegomarquezp left a comment

Choose a reason for hiding this comment

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

@mpeddada1 PTAL

@mpeddada1 mpeddada1 merged commit 7ca8957 into GoogleContainerTools:master Dec 3, 2025
6 of 7 checks passed
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.

When skaffold invokes jib via gradle, a deprecated feature is used that will not work on gradle 9.0

4 participants