-
Notifications
You must be signed in to change notification settings - Fork 170
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
[JENKINS-6933] Handle proxy settings #72
Conversation
Subclasses of AbstractCallableCommand will need access to the WebProxySettings to relay to the Server instances they create.
According to https://issues.jenkins-ci.org/browse/JENKINS-20223?focusedCommentId=188427&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-188427 it is not possible to obtain the Jenkins instance from a node, so we go through the remoting channel instead.
These accept an optional ProxyHost instance to configure HttpClient instances with the appropriate web proxy settings.
If a proxy server has been configured in Jenkins and the TFS/VSTS server is not an excluded host, the ModernConnectionAdvisor and ModernHTTPClientFactory will make sure the HttpClient instances are configured appropriately.
This proxy server is scoped to "test"
This will make it possible to verify that the proxy server was used.
AbsractProject#poll() (in version 1.448) would only try to catch AbortException, IOException and InterruptedException. It may be worth expanding the reach of the try..catch in compareRemoteRevisionWith() to catch any other programming error to make them more visible without risking breaking polling on a Jenkins server.
As the name implies, this verifies that the TFS plugin will use the proxy server configured in Jenkins itself. Notice that the test set-up is able to proceed without going through the web proxy, which reduces the chance of interference between tests.
Replaces #66 |
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
This fix builds upon my changes, and I have verified that it still works. Getting the proxy configuration by asking Jenkins itself deals with a small annoyance we still had by having to have a correct environment when starting a slave. |
[JENKINS-6933] Handle proxy settings
Thank you, @ytterx! We couldn't have done it without you.! |
Background
This feature was originally submitted as pull request #66 and this branch improves upon the work by pulling the proxy configuration from Jenkins itself, adding tests and contributing a small fix to the polling feature, discovered while testing.
Documentation
Here are the related changes submitted to document this new feature:
documentation_4.1.0
branchManual testing
8123
./jenkins/pluginManager/advanced
, Prepare for Shutdown via/jenkins/quietDown
then restart Jenkins.003 Router
(gateway) option in its DHCP reservation.wget
was unable to fetch anything ("No route to host.") until I [temporarily] set thehttp_proxy
environment variable./jenkins/pluginManager/advanced
to configure the proxy server in Jenkins.Mission accomplished!