Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect proxy issues and offer fixes. #4043

Merged
merged 4 commits into from Jul 11, 2022
Merged

Conversation

sdedic
Copy link
Member

@sdedic sdedic commented Apr 28, 2022

Proxy settings is one of the very unpleasant parts of Gradle: normal tools tend to honour environment variables, but Gradle knows better: only respects its own settings, either in the project, or in the ~/.gradle/gradle.properties.

This PR processes GradleReports produced after project (re)load. It detects some (not all!) typical situation - the number of matches may expand:

  • Connection timeout because of gradle attempting to connect directly from a corporate network that requires proxy
  • Connection exception to a configured proxy that no longer works (other proxies, or a no proxy at all)

IDE settings are used to 'autodetect' the valid proxy settings, I used a well-known root DNS 8.8.8.8 that everyone should have route to.

Gradle project offer fix that will alter the .properties file (project or user) that defines the proxies. If a proxy is not set up and the fix introduces one, it is always written into user properties file (~/.gradle/gradle.properties).

@sdedic sdedic self-assigned this Apr 28, 2022
@sdedic sdedic added enhancement Gradle [ci] enable "build tools" tests labels Apr 28, 2022
@sdedic sdedic added this to the NB15 milestone Apr 28, 2022
@sdedic sdedic requested review from lkishalmi and ppisl April 28, 2022 07:22
Copy link
Member

@ppisl ppisl left a comment

Choose a reason for hiding this comment

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

I have not noticed a problem.

Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

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

Generally it looks good. I made a few comments though.

* @return files accessor.
* @since 2.24
*/
public GradleFiles getFiles() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the naming of the method be consistent and use getGradleFiles instead of getFiles?

Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

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

getFiles() -> getGradleFiles()

@sdedic
Copy link
Member Author

sdedic commented May 2, 2022

getFiles() -> getGradleFiles()

Addressed in e1b89f8

@sdedic sdedic requested a review from lkishalmi May 2, 2022 08:28
Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

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

Thank you!

@sdedic sdedic merged commit f98f5e0 into apache:master Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Gradle [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants